libqalculate-0.9.10/0000755000175000017500000000000012757636740011265 500000000000000libqalculate-0.9.10/data/0000755000175000017500000000000012757636740012176 500000000000000libqalculate-0.9.10/data/planets.xml.in0000644000175000017500000000750312705146643014707 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.10/data/prefixes.xml.in0000644000175000017500000000634412705146643015070 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 hecto 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.10/data/units.xml.in0000644000175000017500000024147612744162755014421 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 true 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 true 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>Hectogram r:hg_c g 2 1 <_title>Metric Ton (Tonne) <_names>ar:t,tonne,p:tonnes,ton,p:tons true 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>Atomic Mass <_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>Dalton <_names>ar:Da,dalton,p:daltons true g_p_mol 1 1 <_title>Kilodalton r:kDa_c Da 3 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 Celsius <_names>ar:oC,au:°C,au:℃,r:celsius,p:celsius,centigrade,p:centigrades false <_title>Degree Rankine <_names>ar:oR,au:°R,r:rankine K 5/9 1 <_title>Degree Fahrenheit <_names>ar:oF,au:°F,au:℉,r:fahrenheit <_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. Barrel (oil) <_names>ar:bbl,barrel,p:barrels 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 true 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 true 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 Celsius) <_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.602176620770032661E-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>Hartree <_names>ar:Ha,as:E_h,hartree J 4.359744650E-18 1 <_title>Rydberg <_names>ar:Ry,s:rydberg_unit Ha 0.5 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 true <_title>Byte (8-bit) <_names>r:byte,p:bytes,octet,p:octets true 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.10/data/functions.xml0000644000175000017500000127104712747054305014652 00000000000000 Matrices & Vectors Matrices & Vecteurs Matrices & vectoren Matriser & Vektorer 矩阵与向量 Construct Vector Construire un Vecteur Vector construeren Skapa vektor 构造向量 r:vector vektor Returns a vector with listed elements. Retourne un vecteur avec les éléments listés. Retourneert een vector met de opgegeven elementen. Returnerar en vektor med listade element. 使用列出的元素生成一个向量并返回。 Elements Éléments Elementen Element 多个元素 Generate Vector Générer un vecteur Vector aanmaken Skapa vektor 生成向量 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. Retourne un vecteur généré par une fonction à une variable (par défaut : x) parcourant des valeurs entre min et max. Le quatrième argument est soit le nombre d'éléments voulus si le sixième argument est faux (par défaut) ou le pas entre chaque valeur de la 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 Fonction Functie Funktion 函数 Min Min 最小值 Max Max 最大值 Dimension / Step size Dimension / Taille du pas Dimensie / stapgrootte Dimension / stegstorlek 维数/步长 Variable Variabele Variabel 变量 Use step size Utiliser le pas Stapgrootte gebruiken Använd stegstorlek 使用步长 Sort Trier Sorteren Sortera 排序 r:sort sorteren sortera Returns a sorted vector. ex. sort([6, 1, 4])=[1, 4, 6] Retourne un vecteur trié 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 Vecteur Vektor 向量 Ascending Ascendant Oplopend Stigande 升序 Rank Rangorde Rangordna r:rank rangorde rangordna Returns a vector with values of elements replaced with their mutual ranks. ex. rank([6, 1, 4]) = [3, 1, 2] Retourne un vecteur dont les valeurs de éléments ont été remplacées par leur rang respectif. 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 Vecteur Vektor 向量 Ascending Ascendant Oplopend Stigande 升序 Vector Limits Limites de Vecteur Vectorgrenzen Vektorgränser 向量限 r:limits limites grenzen gränser Returns a part of a vector between two positions. Retourne une partie de vecteur entre deux positions. Retourneert een deel van een vector tussen twee posities. Returnerar en del av en vektor mellan två positioner. 返回一个向量两个位置之间的一部分。 Vector Vecteur Vektor 向量 Lower limit Limite inférieure Ondergrens Undre gräns 下限 Upper limit Limite Supérieure Bovengrens Övre gräns 上限 Dimension Dimensie Dimension 维数 r:dimension dimensie Returns the number of elements in a vector. Retourne le nombre d'éléments dans un vecteur. Retourneert het aantal elementen in een vector. Returnerar antalet element i en vektor. 返回一个向量内的元素数量。 Vector Vecteur Vektor 向量 Merge Vectors Regrouper les Vecteurs Vectoren samenvoegen Sammanslå vektorer 合并向量 r:mergevectors regrouper_vecteurs vectorensamenvoegen Returns a vector with the elements from two vectors. Retourne un vecteur avec les éléments de deux vecteurs. Retourneert een vector met de elementen van twee vectoren. Returnerar en vektor med element från två vektorer. 将两个向量合成一个并返回。 Vector 1 Vecteur 1 Vektor 1 向量1 Vector 2 Vecteur 2 Vektor 2 向量2 Construct Matrix Construire une Matrice Matrix construeren Skapa matris 构造矩阵 r:matrix matrice matris Returns a matrix with specified dimensions and listed elements. Omitted elements are set to zero. Retourne une matrice avec les dimensions spécifiées et les éléments listés. Les éléments omis sont fixés à zéro. 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 Lignes Rijen Rader Columns Colonnes Kolommen Kolumner Elements Éléments Elementen Element 多个元素 Convert Matrix to Vector Convertir une matrice en vecteur Matrix naar vector converteren Omvandla matris till vektor 将矩阵转换为向量 r:matrix2vector matrice_vers_vecteur Puts each element of a matrix in vertical order in a vector. Met chaque élément d'une matrice dans un vecteur en la parcourant verticalement. 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 Matrice Matris 矩阵 Matrix Area Matrixbereik Matrisarea 子矩阵 r:area oppervlak Returns a part of a matrix. Retourne une partie de matrice. Retourneert een deel van een matrix. Returnerar en del av en matris. 返回矩阵的一部分。 Matrix Matrice Matris 矩阵 Start row Ligne de départ Startrij Startrad 起始行 Start column Colonne de départ Startkolom Startkolumn 起始列 End row Terminer la ligne Einde rij Slutrad 结束行 End column Terminer la colonne Einde kolom Slutkolumn 结束列 Rows Lignes Rijen Rader r:rows rijen rader Returns the number of rows in a matrix. Retourne le nombre de lignes d'une matrice. Retourneert het aantal rijen in een matrix. Returnerar antalet rader i en matris. 返回矩阵中的行数。 Matrix Matrice Matris 矩阵 Columns Colonnes Kolommen Kolumner r:columns colonnes kolommen kolumner Returns the number of columns in a matrix. Retourne le nombre de colonnes dans une matrice. Retourneert het aantal kolommen in een matrix. Returner antalet kolumner i en matris. 返回矩阵的列数。 Matrix Matrice Matris 矩阵 Extract row as vector Extraire une ligne comme vecteur Rij als vector uit (matrix) halen Skapa vektor från rad 将行提取为向量 r:row rij rad Returns a row in a matrix as a vector. Retourne une ligne dans une matrice sous forme de vecteur. Retourneert een rij in een matrix als een vector. Returnerar en rad i en matris som en vektor. 将矩阵的一行作为向量返回。 Matrix Matrice Matris 矩阵 Row Ligne Rij Rad Extract Column as Vector Extraire une Colonne comme Vecteur Kolom als vector uit (matrix) halen Extrahera kolumn som vektor 将列提取为向量 r:column colonne kolom kolumn Returns a column in a matrix as a vector. Retourne une colonne de matrice comme vecteur. Retourneert een kolom van een matrix als een vector. Returnerar en kolumn i en matris som en vektor. 将矩阵的一列作为向量返回。 Matrix Matrice Matris 矩阵 Column Colonne Kolom Kolumn Elements Éléments Elementen Element 多个元素 r:elements éléments elementen Returns the number of elements in a matrix or vector. Retourne le nombre d'éléments dans une matrice ou un vecteur. Retourneert het aantal elementen in een matrix of vector. Returnerar antalet element i en matris eller vektor. 返回一个矩阵或向量内的元素数目。 Matrix or vector Matrice ou vecteur Matrix of vector Matris eller vektor 矩阵或向量 Element Élément Element 一个元素 r:element élément Returns the element at specified position in a matrix (row and column) or vector (index). Retourne l'élément de matrice à la position spécifiée (ligne et colonne) ou vecteur (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 Matrice/Vecteur Matrix/vector Matris/vektor 矩阵/向量 Row/index Ligne/indice Rij/Index Rad/index 行/下标 Column Colonne Kolom Kolumn Transpose Transposée Transponeren Transponera 转置 r:transpose transponeren transponera Returns the transpose of a matrix. Retourne la transposée d'une matrice. Retourneert de getransponeerde van een matrix. Returnerar transponeringen av en matris. 返回矩阵的转置。 Matrix Matrice Matris 矩阵 Identity Identité Identiteit Identitetsmatris 单位矩阵 r:identity identité identiteit identitetsmatris Returns the identity matrix of a matrix or with specified number of rows/columns. Retourne la matrice identité ou une matrice avec le nombre indiqué de lignes/colonnes. 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 Matrice ou lignes/colonnes Matrix of rijen/kolommen Matris eller rader/kolumner 矩阵或行/列 Determinant Déterminant Determinanten 行列式 r:det Calculates the determinant of a matrix. Calcule le déterminant d'une matrice. Berekent de determinant van een matrix. Beräknar determinanten för en matris. 计算矩阵的行列式。 Matrix Matrice Matris 矩阵 Permanent 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. Calcule le permanent d'une matrice. Le permanent diffère du déterminant dans le fait que tous les signes dans le développement en mineurs sont pris positifs. 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 Matrice Matris 矩阵 Adjugate (Adjoint) Comatrice Aangrenzend Adjungerad matris (Adjunkt) 伴随矩阵 r:adj Calculates the adjugate or adjoint of a matrix. Calcule la comatrice de la matrice Berekent de geadjungeerde matrix. Beräknar den adjungerade matrisen eller adjunkten för en matris. 计算矩阵的伴随矩阵 Matrix Matrice Matris 矩阵 Cofactor Cofacteur Kofaktor 余因子 r:cofactor cofacteur kofaktor Calculates the cofactor of the element at specified position. Calcule le cofacteur à la position désignée. Berekent de cofactor van het element op de opgegeven positie. Beräknar kofaktorn för elementet på angiven position 计算指定位置元素的余因子。 Matrix Matrice Matris 矩阵 Row Ligne Rij Rad Column Colonne Kolom Kolumn Matrix Inverse Inverse de Matrice Inverse matrix Matrisinvers 求逆矩阵 r:inverse invers Calculates the inverse of a matrix. The inverse is the matrix that multiplied by the original matrix equals the identity matrix (AB = BA = I). Calcule l'inverse d'une matrice. L'inverse est la matrice qui multipliée à la matrice originale est égale à la matrice identité (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 Matrice Matris 矩阵 Load CSV File Charger un Fichier CSV Inlezen CSV-bestand Ladda CSV-fil 载入CSV文件 r:load lees ladda Returns a matrix imported from a CSV data file. Retourne une matrice importée d'un fichier de données CSV. Retourneert een matrix, geïmporteerd uit een CSV-gegevensbestand. Returnerar en matris importerad från en CSV-datafil. 返回从CSV数据文件导入的矩阵 Filename Nom de fichier Bestandsnaam Filnamn 文件名 First data row Première ligne de données Eerste gegevensrij Första raden med data 第一行数据 Separator Séparateur Scheidingsteken Avskiljare 分隔符 Export To CSV File Exporter dans un ficher CSV Exporteren naar CSV-bestand Exportera till CSV-fil 导出到CSV文件 r:export exporteren exportera Exports a matrix to a CSV data file. Exporte une matrice dans un fichier de données CSV. Exporteert een matrix naar een CSV-gegevensbestand. Exporterar en matris till en CSV-datafil 将矩阵导出到CSV数据文件 Matrix/vector Matrice/Vecteur Matrix/vector Matris/vektor 矩阵/向量 Filename Nom de fichier Bestandsnaam Filnamn 文件名 Separator Séparateur Scheidingsteken Avskiljare 分隔符 Norm (length) Norme (longueur) Norm (lengte) Normal 范数(长度) r:norm Calculates the norm/length of a vector. Calcule la norme d'un vecteur. Berekent de norm/lengte van een vector. Beräknar normalen för en vektor. 计算向量的范数/长度。 abs((\x*\x)^(1/2)) Vector Vecteur Vektor 向量 false Cross Product Uitproduct Vektoriell produkt 向量积 r:cross uitproduct vektoriell 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 Vecteur 1 Vektor 1 向量1 dimension(\x)==3 Vector 2 Vecteur 2 Vektor 2 向量2 dimension(\x)==3 Combinatorics Combinatoire Combinatoriek Kombinatorik 组合学 Factorial Factorielle Faculteit Fakultet 阶乘 Calculates the factorial of an integer. Multiplies 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 Calcule la factorielle d'un entier. Multiplie l'argument avec tous les entiers positifs plus petits : n(n-1)(n-2)...2*1. Peut aussi être entré comme un nombre suivi d'un point d'exclamation. p. ex. 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 factorielle faculteit fakultet Value Valeur Waarde Värde Double Factorial Factorielle double Dubbele faculteit Dubbelfakultet 双阶乘 r:factorial2 factorielle2 faculteit2 fakultet2 Calculates the double factorial of an integer. Multiplies 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 Calcule la double factorielle d'un entier. Multiplie l'argument avec tous les deuxièmes entiers positifs plus petits : n(n-2)(n-4)... Peut aussi être entré comme un nombre suivi de deux points d'exclamation. p. ex. 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 Valeur Waarde Värde Multifactorial Multifactorielle Multifaculteit Multifakultet 多阶乘 r:multifactorial multifactorielle multifaculteit multifakultet Calculates the multifactorial of an integer. Multiplies 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 Calcule la multifactorielle d'un entier. Multiplie l'argument avec tous les entiers positifs plus petits placés tous les x (n(n-x)(n-2x)...). Peut aussi être entré comme un nombre suivi de trois points d'exclamation ou plus. p. ex. 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 Valeur Waarde Värde Factorial Factorielle Faculteit Fakultet 阶乘 Binomial Coefficient Coefficient binomial Binomiaalcoëfficiënt Binomial koefficient 二项式系数 r:binomial binomiaal Exponent Exposant Exponent 指数 Index Index 下标 Hyperfactorial Hyperfactorielle Hyperfaculteit Hyperfakultet hyper阶乘 r:hyperfactorial hyperfactorielle hyperfaculteit hyperfakultet product(x^x,1,\x,x) Calculates the hyperfactorial of an integer. Multiplies 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 Calcule l'hyperfactorielle d'un entier. Multiplie l'argument élevé à lui-même avec tous les entiers positifs plus petits élevés à eux-mêmes (1^1 * 2^2 ... n^n). p. ex. hyperfactorial(3) = (3^3) * (2^2) * (1^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 Valeur Waarde Värde 1 Superfactorial Superfactorielle Superfaculteit Superfakultet 超级阶乘 r:superfactorial superfaculteit superfakultet product(factorial(x),0,\x,x) Calculates the superfactorial of an integer. Multiplies 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 Calcule la superfactorielle d'un entier. Multiplie la factorielle de l'argument avec la factorielle de tous les entiers positifs plus petits (1! * 2! ... n!). ex. superfactorielle(5) = 5! * 4! * 3! * 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 Valeur Waarde Värde 0 Permutations (Variations) Permutaties (Variaties) Permutationer (Variationer) 排列 r:perm,variations perm,variaties variationer \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. Retourne le nombre d'arrangements possibles d'une liste ordonnée avec un nombre d'objets à choisir et une taille de liste. Si il y a trois objets (1, 2 et 3) qui sont mis dans une liste à deux positions, les alternatives sont [1, 2], [2, 1], [1, 3], [3, 1], [2, 3] et [3, 2], et le nombre de permutations est donc 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 Objets Objecten Objekt 对象个数 Size Taille Grootte Storlek 大小 Combinations Combinaisons Combinaties Kombinationer 组合 r:comb kam kombinationer \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. Retourne le nombre d'arrangements possibles d'une liste non ordonnée avec un nombre d'objets à choisir et une taille de liste. S'il y a trois objets (1,2 et 3) qui sont mis dans une liste à deux positions, les alternatives sont [1, 2], [1, 3], et [2, 3], et le nombre de combinaisons est donc 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 Objets Objecten Objekt 对象个数 Size Taille Grootte Storlek 大小 Derangements Arrangements Derangementen Derangemang 重排数 r:derangements derangementen derangemang 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. Retourne le nombre de réarrangements possibles d'une liste non ordonnée, d'une certaine taille, où aucun des objets n'est à sa position initiale. Si la liste de départ est [1, 2, 3], les réarrangements possibles sont [2, 3, 1] et [3, 1, 2]; le nombre de réarrangements est donc 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 Nombre d'éléments Aantal elementen Antal element 元素个数 1 Number Theory Théorie des Nombres Getallentheorie Nummerteori 数论 Absolute Value Valeur absolue Absolute waarde Absolut värde 绝对值 r:abs Value Valeur Waarde Värde Arithmetics Arithmétique Rekenen Aritmetik 算术 Signum Sigma 符号函数 r:sgn Number Nombre Nummer Nummer 数字 Numerator Numérateur Teller Täljare 分子 r:numerator numérateur noemer täljare Number Nombre Nummer Nummer 数字 Denominator Dénominateur Noemer Nämnare 分母 r:denominator dénominateur noemer nämnare Number Nombre Nummer Nummer 数字 Remainder Reste Rest Rest 余数 r:rem Numerator Numérateur Teller Täljare 分子 Denominator Dénominateur Noemer Nämnare 分母 Modulus Coefficient Modulus Modulus r:mod . Numerator Numérateur Teller Täljare 分子 Denominator Dénominateur Noemer Nämnare 分母 Negate Opposé Ander teken Negera r:neg anderteken -\x Value Valeur Waarde Värde Reciprocal Réciproque Omgekeerde waarde (x naar 1/x) Reciprok 倒数 r:inv \x^(-1) Value Valeur Waarde Värde Multiply Multiplier Vermenigvuldigen Multiplicera r:multiply multiplier vermenigvuldigen multiplicera product(element(\x,"x"),1,dimension(\x),"x") Factors Facteurs Factoren Faktorer 因子 Add Ajouter Optellen Addera r:add optellen addera total(\x) Terms Termes Termen Termer Subtract Aftrekken Subtrahera r:subtract aftrekken subtrahera csum(2,-1,element(\x,1),"y"-"x","x","y",\x) Terms Termes Termen Termer Divide Diviser Delen Dela r:divide divise delen dela \x/\y Numerator Numérateur Teller Täljare 分子 Denominator Dénominateur Noemer Nämnare 分母 Raise Élever Machtverheffen Upphöj 乘方 r:raise machtverheffen upphöj \x^\y Base Grondtal Bas 基/底 Exponent Exposant Exponent 指数 Polynomials Polynômes Polynomen (veeltermen) Polynomer 多项式 Coefficient Coëfficiënt Koefficient 系数 r:coeff Polynomial Polynôme Polynoom (veelterm) Polynom 多项式 Number Nombre Nummer Nummer 数字 Variable Variabele Variabel 变量 Leading Coefficient Coefficient dominant Eerste coëfficiënt Ledande koefficient 首项系数 r:lcoeff Polynomial Polynôme Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Trailing Coefficient Laatste coëfficiënt Avslutande koefficient 末项系数 r:tcoeff Polynomial Polynôme Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Polynomial Degree Degré du Polynôme Graad van polynoom (veelterm) Polynomgrad 多项式次数 r:degree degré graad grad Polynomial Polynôme Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Lowest Degree (Valuation) Plus Petit Degré (Estimation) Laagste graad (waardebepaling) Lägsta grad (valuering) 末项次数(估计) r:ldegree lgraad Polynomial Polynôme Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Content Part Part du Montant Inhoudgedeelte Innehållsdel 常数公因子 r:pcontent pinhoud Polynomial Polynôme Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Primitive Part Primitieve deel Primitiv del 原始部分 r:primpart Polynomial Polynôme Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Unit Part Eenheidsgedeelte Enhetsdel 单位部分 r:punit peenheid Polynomial Polynôme Polynoom (veelterm) Polynom 多项式 Variable Variabele Variabel 变量 Greatest Common Divisor Plus Grand Diviseur Commun Grootste gemene deler Största gemensamma delare 最大公约数 r:gcd pgcd ggd 1st value 1ère valeur 1e waarde 1:a värdet 值1 2nd value 2e valeur 2de waarde 2:a värdet 值2 Least Common Multiple Plus Petit Facteur Commun Kleinste gemene veelvoud Minsta gemensamma multipel 最小公倍数 r:lcm kgv 1st value 1ère valeur 1e waarde 1:a värdet 值1 2nd value 2e valeur 2de waarde 2:a värdet 值2 Rounding Arrondi Afronding Avrundning 取整 Round Arrondi Afronden Avrunda 取整 r:round afronden avrunda Value Valeur Waarde Värde Round Downwards Arrondi à la Valeur Inférieure Naar beneden afronden Avrunda neråt 向下取整 r:floor plancher golv Value Valeur Waarde Värde Round Upwards Arrondi à la Valeur Supérieure Naar boven afronden Avrunda uppåt 向上取整 r:ceil plafond tak Value Valeur Waarde Värde Round Towards Zero Afronden in de richting van nul Avrunda mot noll 向零取整 r:trunc afkap Value Valeur Waarde Värde Extract Integer Part Extraire la Partie Entière Gehele deel uit (getal) halen Extrahera heltal 提取整数部分 r:int Value Valeur Waarde Värde Extract Fractional Part Extraire la Partie Fractionnaire Fractionele deel uit (getal) halen Extrahera bråkdel 提取分数部分 r:frac Value Valeur Waarde Värde Number Bases Bases Numériques Grondtallen voor talstelsels Nummerbaser 数字进制 Number Base Base Numérique Grondtal talstelsel Nummerbas 数字进制 r:base grondtal bas Returns an integer from a number of specified base between 2 and 36 Retourne un entier à partir d'un nombre dans une base spécifiée entre 2 et 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 Nombre Nummer Nummer 数字 Base Grondtal Bas 基/底 Binary Binaire Binair Binär 二进制 r:bin Returns an integer from a binary number Retourne un entier à partir d'un nombre binaire Converteert een binair getal naar een geheel getal Returnerar ett heltal från ett binärt tal 返回一个二进制数字表示的整数值。 Binary number Nombre binaire Binair getal Binärt nummer 二进制数 Octal Octaal Oktal 八进制 r:oct okt Returns an integer from an octal number Retourne un entier à partir d'un nombre octal Converteert een octaal getal naar een geheel getal Returnerar ett heltal från ett oktalt tal 返回一个八进制数字表示的整数值。 Octal number Nombre octal Octaal getal Oktalt nummer 八进制数 Hexadecimal Hexadécimal Hexadecimaal Hexadecimal 十六进制 r:hex Returns a value from a hexadecimal number Retourne une valeur à partir d'un nombre hexadécimal Converteert een hexadecimaal getal naar een getal Returnerar ett värde från ett hexadecimalt tal 返回一个十六进制数字表示的数值 Hexadecimal number Nombre hexadécimal Hexadecimaal getal Hexadecimalt nummer 十六进制数 Integers Entiers Gehele getallen Heltal 整数 Even Pair Jämnt r:even pair jämn Number Nombre Nummer Nummer 数字 Odd Impair Oneven Ojämnt r:odd impair oneven udda Number Nombre Nummer Nummer 数字 Step Functions Stapfuncties Språngfunktioner 阶梯函数 Heaviside Step Function Heaviside stapfunctie Heavisides stegfunktion Heaviside阶梯函数 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. Stegfunktion även kallad "enhetsstegfunktion". Returnerar 0 om x < 0, 1 om x > 0, och 1/2 om x = 0. 间断函数也被称作是" 单位阶跃函数"。当 x < 0时值为0, x > 0时值为1, x = 0时则为1/2。 (1/2)*(1+sgn(\x)) Value Valeur Waarde Värde false false Ramp Function Rampfunctie Rampfunktion 斜坡函数 r:ramp (\x+abs(\x))/2 Value Valeur Waarde Värde false false Rectangular Function Rechthoekige functie Rektangulär funktion 矩阵函数 r:rectangular rechthoekig rektangulär heaviside(\x+(1/2))-heaviside(\x-(1/2)) Value Valeur Waarde Värde false false Sigmoid Function Sigmoïde functie Sigmoidfunktion sigmoid函数 r:sigmoid sigmoïde 1/(1+e^(-\x)) Value Valeur Waarde Värde false Logit Transformation Logit transformatie Logit transformation Logit变换 r:logit ln(\x/(1-\x)) Value Valeur Waarde Värde Triangular Function Driehoekige functie Triangulär funktion 三角函数 r:triangular driehoekig triangulär if(abs(\x)<1,1-abs(\x),0) Value Valeur Waarde Värde false false Analysis Analyse Analyse Analys 分析 Real Part Partie Réelle Reële deel Reell del 实部 r:re Complex number Nombre complexe Complex getal Komplext nummer 复数 Imaginary Part Partie Imaginaire Imaginaire deel Imaginär del 虚部 r:im Complex number Nombre complexe Complex getal Komplext nummer 复数 Gamma Function Fonction Gamma Gamma-functie Gammafunktion γ函数 r:gamma Beta Function Fonction bêta Beta-functie Betafunktion β函数 r:beta Exponents & Logarithms Exponentielles et logarithmes Exponenten & Logaritmen Exponenter & Logaritmer 指数与对数 Square Root Racine Carrée Vierkantswortel Kvadratrot 平方根 au:√,r:sqrt Value Valeur Waarde Värde Square Carré Vierkant Kvadrat 正方形 r:sq Value Valeur Waarde Värde Exponential (e^x) Exponentielle (e^x) Exponent (e^x) Exponentialfunktion (e^x) e的乘方 r:exp Exponent Exposant Exponent 指数 Natural Logarithm Logarithme Naturel (népérien) Natuurlijke logaritme Naturlig logaritm 自然对数 r:ln Value Valeur Waarde Värde Base-N Logarithm Logarithme en base N Logaritme met grondtal N Bas-N-logaritm 以n为底的对数 r:log Value Valeur 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). Returnerar den inverterade funktionen för mx*e^x såsom ln() gör för e^x. 返回函数mx*e^x的逆函数。 Value Valeur Waarde Värde Base-2 Logarithm Logarithme en base 2 Logaritme met grondtal 2 Bas-2-logaritm 以2为底的对数 rs:log2 Returns the base n logarithm. Retourne le logarithme en base n. Retourneert de logaritme met grondtal n. Returnerar logaritmen för bas n. 返回以n为底的对数。 log(\x,2) Value Valeur Waarde Värde false 0 Base-10 Logarithm Logarithme en base 10 Logaritme met grondtal 10 Bas-10-logaritm 以10为底的对数 rs:log10 Returns the base n logarithm. Retourne le logarithme en base n. Retourneert de logaritme met grondtal n. Returnerar logaritmen för bas n. 返回以n为底的对数。 log(\x,10) Value Valeur Waarde Värde false 0 Complex Exponential (Cis) Exponentielle Complexe Complex Exponentieel (Cis) Komplex exponentialfunction (Cis) 复指数(Cis) r:cis e^(\x*i) Exponent Exposant Exponent 指数 2 raised the to power X 2 élevé à la puissance X 2 tot de macht X 2 upphöjt med X 2的乘方 rs:exp2 2^\x Exponent Exposant Exponent 指数 10 raised the to power X 10 élevé à la puissance X 10 tot de macht X 10 upphöjt med X 10的乘方 rs:exp10 10^\x Exponent Exposant Exponent 指数 Cube Root Racine Cubique Derdemachtswortel Kubikrot 立方根 au:∛,r:cbrt \x^(1/3) Value Valeur Waarde Värde Nth root Racine n-ième N-de wortel N:te roten N次方根 r:root wortel rot \x^(1/\y) Base Grondtal Bas 基/底 Exponent Exposant Exponent 指数 X raised to the power Y X élevé à la puissance Y X tot de macht Y X upphöjt med Y X的Y次方 r:pow macht upphöj \x^\y Base Grondtal Bas 基/底 Exponent Exposant Exponent 指数 Square root (x * pi) Racine carrée (x * pi) Vierkantswortel (x * pi) Kvadratrot (x * pi) 平方根(x*π) r:sqrtpi Returns the non-negative square root of x * pi Retourne la racine carrée de 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 Valeur strictement positive Niet-negatieve waarde Icke-negativt nummer 非负值 0 Trigonometry Trigonométrie Goniometrie Trigonometri 三角学 Sine Sinus Sinus Sinus 正弦 r:sin Angle Hoek Vinkel 角度 Cosine Cosinus Cosinus Cosinus 余弦 r:cos Angle Hoek Vinkel 角度 Tangent Tangente Tangens Tangens 正切 r:tan Angle Hoek Vinkel 角度 Inverse Sine Arcsinus Inverse sinus Invers sinus 反正弦 r:asin arcsin Inverse Cosine Arccosinus Inverse cosinus Invers cosinus 反余弦 r:acos arccos Inverse Tangent Arctangente Inverse tangens Invers tangens 反正切 r:atan arctan Hyperbolic Sine Sinus Hyperbolique Hyperbolische sinus Sinus hyperbolicus 双曲正弦 r:sinh Hyperbolic Cosine Cosinus Hyperbolique Hyperbolische cosinus Cosinus hyperbolicus 双曲余弦 r:cosh Hyperbolic Tangent Tangente Hyperbolique Hyperbolische tangens Tangens hyperbolicus 双曲正割 r:tanh Inverse Hyperbolic Sine Argsinus Hyperbolique Inverse hyperbolische sinus Invers sinus hyperbolicus 反双曲正弦 r:asinh argsh Inverse Hyperbolic Cosine Argcosinus Hyperbolique Inverse hyperbolische cosinus Invers cosinus hyperbolicus 反双曲余弦 r:acosh argcosh Inverse Hyperbolic Tangent Argtangente Hyperbolique Inverse hyperbolische tangens Invers tangens hyperbolicus 反双曲正切 r:atanh argth Radians to Default Angle Unit Radians en Unité d'Angle par Défaut Radialen naar standaard hoekeenheid Radians till färvald vinkelenhet 将弧度转换到缺省角度单位 r:radtodef radnaardef Radians Radialen Radianer 弧度 Secant Secans Sekant 正割 r:sec 1/cos(\x) Angle Hoek Vinkel 角度 false Cosecant Cosécante Cosecant Cosekant 余割 r:csc 1/sin(\x) Angle Hoek Vinkel 角度 false Cotangent Cotangente Cotangens Cotangens 余切 r:cot cos(\x)/sin(\x) Angle Hoek Vinkel 角度 false Hyperbolic Secant Sécante hyperbolique Hyperbolische secans Sekant hyperbolicus 双曲正切 r:sech 1/cosh(\x) Hyperbolic Cosecant Cosécante hyperbolique Hyperbolische cosecans Cosekant hyperbolicus 双曲余割 r:csch 1/sinh(\x) Hyperbolic Cotangent Cotangente Hyperbolique Hyperbolische cotangens Cotangens hyperbolicus 双曲余切 r:coth cosh(\x)/sinh(\x) Inverse Secant Arcsécante Inverse secans Invers sekant 反正割 r:asec radtodef(0.5pi+i*ln(sqrt(1-1\x^2)+i/\x)) Inverse Cosecant Arccosécante Inverse cosecans Invers cosekant 反余割 r:acsc radtodef(-i*ln(sqrt(1-1\x^2)+i/\x)) Inverse Cotangent Arccotangente Inverse cotangens Invers cotangens 反余切 r:acot radtodef(i/2*(ln((\x-i)/\x)-ln((\x+i)/\x))) Inverse Hyperbolic Secant Argsécante Hyperbolique Inverse hyperbolische secans Invers sekant hyperbolicus 反双曲正割 r:asech ln(sqrt(1/\x-1)*sqrt(1/\x+1)+1/\x) Inverse Hyperbolic Cosecant Argcosécante Hyperbolique Inverse hyperbolische cosecans Invers cosekant hyperbolicus 反双曲余割 r:acsch ln(sqrt(1+1/\x^2)+1/\x) Inverse Hyperbolic Cotangent Argcotangente Hyperbolique Inverse hyperbolische cotangens Invers cotangens hyperbolicus 反双曲余切 r:acoth (ln(1+1/\x)-ln(1-1/\x))/2 Miscellaneous Divers Diversen Diverse 杂项 Body Mass Index (BMI) Indice de masse corporelle (IMC) Body Mass Index (BMI) (Index voor lichaamsmassa) 体质指数(BMI) -r:bmi imc 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). Calcule l'Indice de Masse Corporelle. L'IMC est parfois interprété de la façon suivante (bien qu'il varie selon l'âge, le sexe, etc.) : Maigreur < 18.5 Corpulence normale 18.5-25 Surpoids 25-30 Obésité > 30 Notez que vous devez utiliser des unités pour la masse (p. ex. 59kg) et la taille (p. 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 Poids Gewicht Vikt 重量 Length Longueur Lengte Längd 长度 Riemann Zeta Riemann Zeta Riemanns Zeta Riemann Zeta r:zeta Integral point Point intégral Gehele waarde Integralpunkt 积分点 Roman Number Nombre Romain Romeins getal Romerskt tal 罗马数字 r:roman romeins Returns the value of a roman number. Retourneert de waarde van een Romeins getal. Returnerar värdet för romerska siffror. 返回罗马数字表示的值。 Roman number Nombre romain Romeins getal Romerskt tal 罗马数字 Kronecker Delta Kronecker Delta Kroneckerdelta Kronecker Delta 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) Valeur 1 (i) Waarde 1 (i) Värde 1 (i) 值1(i) false false Value 2 (j) Valeur 2 (j) Waarde 2 (j) Värde 2 (j) 值2(i) false false Fibonacci Number Fibonaccital r:fibonacci Returns the n-th term of the Fibonacci sequence. Returnerar tal n i Fibonaccis talföljd. (golden^\x−(1−golden)^\x)/sqrt(5) Index (n) Index (n) 0 false Statistics Statistique Statistiek Statistik 统计 Descriptive Statistics Statistiques Descriptives Beschrijvende statistiek Beskrivande statistik 描述性统计 Sum (total) Somme (total) Som (totaal) Summa (total) 总和 r:total totaal totalt Data Donnée Gegevens Data 数据 Percentile Percentiel Percentil 百分位数 r:percentile percentiel percentil Vector Vecteur Vektor 向量 Percentile (%) Percentiel (%) Percentil (%) 百分位数(%) Min Min 最小值 r:min Returns the lowest value. Retourne la valeur la plus petite. Retourneert de kleinste waarde. Returnerar det lägsta värdet. 返回最小值。 Vector Vecteur Vektor 向量 Max Max 最大值 r:max Returns the highest value. Retourne la plus grande valeur. Retourneert de grootste waarde. Returnerar det högsta värdet. 返回最大值。 Vector Vecteur Vektor 向量 Mode Modus Typvärde 模式 r:mode modus typvärde Returns the most frequently occurring value. Retourne la valeur qui apparaît le plus souvent. Retourneert de meest voorkomende waarde. Returnerar det mest förekommande värdet. 返回最常出现的值。 Vector Vecteur Vektor 向量 Range Bereik Omfång 范围 r:range bereik omfång Calculates the difference between the min and max value. Calcule la différence entre la valeur minimale et maximale. Berekent het verschil tussen de kleinste en de grootste waarde. Beräknar skillnaden mellan min och max värdet. 计算最大和最小值之间的差。 max(\x)-min(\x) Data Donnée Gegevens Data 数据 Median Médianne Mediaan Median 中位数 r:median médiane mediaan percentile(\x,50) Data Donnée Gegevens Data 数据 Quartile Quartile Kwartiel Kvartil 四分位数 r:quartile kwartiel kvartil percentile(\x,25*\y) Data Donnée Gegevens Data 数据 Quartile Quartile Kwartiel Kvartil 四分位数 1 3 Decile Décile Deciel Decil 十分位数 r:decile deciel decil percentile(\x,10*\y) Data Donnée Gegevens Data 数据 Decile Décile Deciel Decil 十分位数 0 100 Interquartile Range Écart interquartile Interkwartiel bereik Kvartilavstånd 四分位距 r:iqr Calculates the difference between the first and third quartile. Calcule la différence entre le premier et le troisième 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 Donnée Gegevens Data 数据 Number of Samples Nombre d'Échantillons Aantal monsters Antal 样本数量 r:number nombre getal antal Returns the number of samples. Retourne le nombre d'échantillons. Retourneert het aantal monsters. Returnerar antalet prov. 返回样本数量。 dimension(\x) Data Donnée Gegevens Data 数据 Random Number Nombre Aléatoire Willekeurig getal Slumptal 随机数 r:rand wilk slumptal 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. Génère un nombre pseudo-aléatoire. Retourne un nombre réel entre 0 et 1, si le plafond est zéro (valeur par défaut), ou un entier entre 1 et le plafond (inclusivement). 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 Plafond Ceil Tak 顶部值 Random Number Between Limits Nombre Aléatoire entre les limites Willekeurig getal tussen twee grenswaarden Slumptal mellan gränser 在某一范围内的随机数 r:randbetween wilktussen Returns an integer between (including) bottom and top. Retourne un entier entre le bas et le haut (inclusivement). 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 Bas Onder Nedre gräns 底部 Top Haut Boven Övre gräns 顶部 Means Moyenne Gemiddelden Medelvärde 平均 Mean Moyenne Gemiddelde Medelvärde 平均 r:mean,average moyenne gemiddelde medel total(\x)/dimension(\x) Data Donnée Gegevens Data 数据 Harmonic Mean Moyenne Harmonique Harmonisch gemiddelde Harmoniskt medelvärde 调和平均 r:harmmean harmgem harmmedel dimension(\x)/csum(1,-1,0,"y"+1/"x","x","y",\x) Data Donnée Gegevens Data 数据 Geometric Mean Moyenne géométrique Meetkundig gemiddelde Geometriskt medelvärde 几何平均 r:geomean moyenne_géométrique meetkgem geomedel abs(csum(1,-1,1,"y"*"x","x","y",\x)^(1/dimension(\x))) Data Donnée Gegevens Data 数据 Trimmed Mean Getrimd gemiddelde Trimmat medelvärde 截尾均值 r:trimmean trimgemidd mean(limits(sort(\x),round(dimension(\x)/100*\y)+1,round(dimension(\x)/100*(100-\y)))) Data Donnée 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 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 Donnée Gegevens Data 数据 Winsorized percentage (at each end) Gewinsoriseerd percentage (aan beide kanten) Winsorprocent (i båda ändarna) Winsorized百分比(在每一端) Weighted Mean Moyenne Pondérée Gewogen gemiddelde Viktat medelvärde 加权平均 r:weighmean gewogengemidd 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 Donnée Gegevens Data 数据 Weights Poids Gewichten Vikter 权重 Quadratic Mean (RMS) Moyenne Quadratique (RMS) Kwadratisch gemiddelde (RMS) Kvadratiskt medelvärde 均方(RMS) r:rms abs((csum(1,-1,0,"y"+"x"^2,"x","y",\x)/dimension(\x))^(1/2)) Data Donnée Gegevens Data 数据 Moments Momenten Moment 统计矩 Standard Deviation (entire population) Standaarddeviatie (gehele populatie) Standardavvikelse (komplett population) 标准差(总体) r:stdevp abs(varp(\x)^(1/2)) Data Donnée Gegevens Data 数据 Standard Deviation (random sampling) Standaarddeviatie (willekeurige steekproef) Standardavvikelse (slumpmässigt urval) 标准差(随机采样) r:stdev standardavvikelse abs(var(\x)^(1/2)) Data Donnée Gegevens Data 数据 Variance (entire population) Variance (population entière) Variantie (gehele populatie) Varians (komplett population) 方差(总体) r:varp mean(\x) csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)/dimension(\x) Data Donnée Gegevens Data 数据 Variance (random sampling) Variance (échantillon aléatoire) Variantie (willekeurige steekproef) Varians (slumpmässigt urval) 方差(随机样本) r:var mean(\x) csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)/(dimension(\x)-1) Data Donnée Gegevens Data 数据 Standard Error Standaardfout Standardfel 标准误差 r:stderr standardfel abs((var(\x)/dimension(\x))^(1/2)) Data Donnée Gegevens Data 数据 Mean Deviation Déviation Moyenne Gemiddelde afwijking Medelavvikelse 均差 r:meandev gemiddev medelavvikelse mean(\x) csum(1,-1,0,"y"+abs("x"-\1),"x","y",\x)/dimension(\x) Data Donnée Gegevens Data 数据 Covariance Covariantie Kovarians 协方差 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 Donnée 1 Gegevens 1 Data 1 数据1 Data 2 Donnée 2 Gegevens 2 Data 2 数据2 Pooled Variance Pooled variantie Gemensam varians 合并方差 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 Donnée 1 Gegevens 1 Data 1 数据1 Data 2 Donnée 2 Gegevens 2 Data 2 数据2 Regression Régression Regressie Regression 回归分析 Statistical Correlation Corrélation Statistique Statistische correlatie Statistisk korrelation 统计相关 r:cor covar(\x,\y)/(stdev(\x)*stdev(\y)) Data 1 Donnée 1 Gegevens 1 Data 1 数据1 Data 2 Donnée 2 Gegevens 2 Data 2 数据2 Pearson's Correlation Coefficient Coefficient de Corrélation de Pearson Pearson's correlatiecoëfficiënt Pearsons korrelationskoefficient 个人相关系数 r:pearson,r:correl korrelation 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 Donnée 1 Gegevens 1 Data 1 数据1 Data 2 Donnée 2 Gegevens 2 Data 2 数据2 Spearman's Rho Spearman's Rho Spearmans Rho r:spearman dimension(\x)=dimension(\y) pearson(rank(\x),rank(\y)) Data 1 Donnée 1 Gegevens 1 Data 1 数据1 Data 2 Donnée 2 Gegevens 2 Data 2 数据2 Durbin-Watson Durbin-Watson Durbin-Watson Durbin-Watson 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 Donnée Gegevens Data 数据 Statistical Tests Statistische testen Statistika tester 统计测试 Unpaired T-Test Ongepaarde T-proef T-test 非配对T测试 r:ttest poolvar(\x,\y)^2 (mean(\x)-mean(\y))/abs(((\1)/dimension(\x)+(\1)/dimension(\y))^(1/2)) Data 1 Donnée 1 Gegevens 1 Data 1 数据1 Data 2 Donnée 2 Gegevens 2 Data 2 数据2 Paired T-Test Test du T Gepaarde t-proef Parvist t-test 配对t检验 r:pttest mean(\x-\y)/stderr(\x-\y) Data 1 Donnée 1 Gegevens 1 Data 1 数据1 Data 2 Donnée 2 Gegevens 2 Data 2 数据2 Distribution Distributie Distribution 分布 Rayleigh Distribution Distribution de Rayleigh Rayleigh-verdeling Rayleighfördelning Rayleigh分布 r:rayleigh Returns the probability density p(x) at x for a Rayleigh distribution with scale parameter sigma. (from Gnumeric) Retourne la densité de probabilité p(x) au x choisi pour une distribution de Rayleigh avec le paramètre d'échelle sigma. (utilise 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 Distribution de Queue de Rayleigh Rayleigh-staartverdeling Rayleighsvansfördelning Rayleigh尾分布 r:rayleightail rayleighstaart 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 Limite inférieure Ondergrens Undre gräns 下限 Sigma Sigma Sigma Sigma 0 Pareto Distribution Distribution de Pareto Paretoverdeling Paretofördelning Pareto分布 r:pareto Returns the probability density p(x) at x for a Pareto distribution with exponent and scale. (from Gnumeric) Retourne la densité de probabilité p(x) au x choisi pour une distribution de Pareto avec l'exposant et l'échelle. (utilise 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 Exposant Exponent 指数 0 Scale Échelle Schaal Skala 规模 0 Logistic Distribution Distribution logistique Logistische verdeling Logistisk distribution Logistic分布 r:logistic logistique logistisch 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 Échelle Schaal Skala 规模 0 Date & Time Date & Heure Datum & Tijd Datum & Tid 日期与时间 Days between two dates Jours entre deux dates Aantal dagen tussen twee data Antal dagar mellan två datum 两个日期之间的天数 r:days jours dagen dagar 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. Retourne le nombre de jours entre deux dates. La base est la manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360, 1 : jours réels (par défaut), 2 : jours réels/360, 3 : jours réels/365 ou 4 : Européenne 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 Première date Eerste datum Första datumet 第一个日期 Second date Tweede datum Andra datumet 第二个日期 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 Financial function mode Mode de fonctions financières Financiële functiemodus Läge för financiella funktioner 金融函数模式 Years between two dates Années entre deux dates Jaren tussen twee data Antal är mellan två datum 两个日期之间相隔的年数 r:yearfrac jaarfrac 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. Retourne le nombre d'années (sous forme de fraction) entre deux dates. La base est la manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360, 1 : jours réels (par défaut), 2 : jours réels/360, 3 : jours réels/365 ou 4 : Européenne 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 Première date Eerste datum Första datumet 第一个日期 Second date Tweede datum Andra datumet 第二个日期 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 Financial function mode Mode de fonctions financières Financiële functiemodus Läge för financiella funktioner 金融函数模式 Week of Year Semaine de l'Année Week van het jaar Vecka på året 一年中的第几周 r:week vecka Date Datum Datum 日期 Week begins on Sunday La semaine commence le dimanche Week begint op zondag Veckor börjar på söndag 每周从星期天开始 Day of Week Jour de la semaine Dag van de week Veckodag 星期中的第几天 r:weekday weekdag veckodag Date Datum Datum 日期 Week begins on Sunday La semaine commence le dimanche Week begint op zondag Veckor börjar på söndag 每周从星期天开始 Month Mois Maand Månad 月份 r:month mois maand månad Date Datum Datum 日期 Day of Month Jour du mois Dag van de maand Månadsdag 月份中的第几天 r:day jour dag dag Date Datum Datum 日期 Year Année Jaar År r:year jaar år Date Datum Datum 日期 Day of Year Jour de l'année Dag van het jaar Dag på året 一年中的第几天 r:yearday jaardag årsdag Date Datum Datum 日期 Current Time Heure actuelle Huidige tijd Nuvarande tid 当前时间 r:time tijd tid Standard Date Format Format de Date Standard Standaardnotatie voor datum Standard-datumformat 标准日期格式 r:isodate isodatum Date Datum Datum 日期 Local Date Format Format de Date Local Lokale datumnotatie Lokalt datumformat 本地日期格式 r:localdate lokaledatum lokalt_datum Date Datum Datum 日期 Date to Unix Timestamp Date selon l'Horodatage Unix Datum naar Unix-timestamp Datum till Unixtid 将时间转换为Unix时间戳 r:timestamp Date Datum Datum 日期 Unix Timestamp to Date Unix Timestamp naar datum Unixtid till datum Unix时间戳转换为日期 r:stamptodate stampnaardatum Timestamp Timestamp Unixtid 时间戳 Add Days Dagen bijtellen Addera dagar 加日 r:addDays dagen bijtellen adderaDagar Date Datum Datum 日期 Days Dagen Dagar Add Months Maanden bijtellen Addera månader 加月份 r:addMonths maanden bijtellen adderaMånader Date Datum Datum 日期 Months Maanden Månader 月份 Add Years Jaren bijtellen Addera år 加年 r:addYears jaren bijtellen adderaÅr Date Datum Datum 日期 Years Années Jaren Antal år Add Time Tijd optellen Addera tid 加时间 r:addTime tijd bijtellen adderaTid 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/d)) Date Datum Datum 日期 Time Temps Tijd Tid 时间 isNumber(\x/d) Utilities Utilitaires Hulpmiddelen Verktyg 工具 ASCII Value Valeur ASCII ASCII-waarde ASCII värde ASCII值 r:code kod Character Caractère Karakter Tecken 字符 ASCII Char Caractère ASCII ASCII-kar ASCII tecken ASCII字符 r:char tecken Value Valeur Waarde Värde Length of string Longueur de la chaîne Lengte van karakterrij Textsträngslängd 字符串长度 r:len längd Text Texte Tekst Text 文字 Concatenate Strings Concaténer les chaînes Karakterrijen samenvoegen Sammanfoga textsträngar 连接字符串 r:concatenate samenvoegen sammanfoga Text string 1 Chaîne de texte 1 Tekstrij 1 Textsträng 1 文字1 Text string 2 Chaîne de texte 2 Tekstrij 2 Textsträng 2 文字2 Replace Remplacer Vervangen Ersätt 替换 r:replace vervangen ersätt Replaces a certain value in an expression with a new value. The expression is calculated before the replacement if the fourth argument is true. Remplace une certaine valeur dans une expression par une nouvelle valeur. L'expression est calculée avant le remplacement si le quatrième argument est vrai. 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 Valeur originale Originele waarde Ursprungligt värde 原始值 New value Nouvelle valeur Nieuwe waarde Nytt värde 新值 Precalculate expression Expression précalculée Voorbereken expressie Beräkna uttrycket först 预先计算表达式 Strip Units Eenheden verwijderen Ta bort enheter 剥离单位 r:nounit,strip_units geeneenheid,eenheden_weg Removes all units from an expression. The expression is calculated before the removal. Enlève toutes les unités de l'expression. L'expression est calculée avant la suppression. 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 Calculer les Éléments de Vecteur Vector-elementen verwerken Modifiera vektorelement 处理向量元素 r:process verwerken Function Fonction Functie Funktion 函数 Element variable Variable Élément Elementvariabele Elementvariabel 元素变量 Vector Vecteur Vektor 向量 Index variable Variable d'index Indexvariabele Indexvariabel 下标变量 Vector variable Variable vecteur Vectorvariabele Vektorvariabel 向量变量 Process Matrix Elements Calculer les Éléments de Matrice Matrix-elementen verwerken Modifiera matriselement 处理矩阵元素 r:processm Function Fonction Functie Funktion 函数 Element variable Variable Élément Elementvariabele Elementvariabel 元素变量 Matrix Matrice Matris 矩阵 Row variable Variable de Ligne Rijvariabele Radvariabel 行变量 Column variable Variable de colonne Kolomvariabele Kolumnvariabel 列标量 Matrix variable Variable matricielle Matrixvariabele Matrisvariabel 矩阵变量 Custom Sum of Elements Somme d'éléments personnalisée Aangepaste som van elementen Anpassad elementsumma 元素的自定义和 r:csum csom First element Premier élément Eerste element Första elementet 最后一个元素 Last element Dernier élément Laatste element Sista elementet 最后一个元素 Initial value Valeur initiale Beginwaarde Initialt värde 初始值 Function Fonction Functie Funktion 函数 Value variable Variable valeur Waarde variabele Värdevariabel 值变量 Element variable Variable Élément Elementvariabele Elementvariabel 元素变量 Vector Vecteur Vektor 向量 Index variable Variable d'index Indexvariabele Indexvariabel 下标变量 Vector variable Variable vecteur Vectorvariabele Vektorvariabel 向量变量 Select Vector Elements Sélectionner les Éléments de Vecteur Vectorelementen selecteren Utvälj vektorelement 选择矩阵元素 r:select selecteer Vector Vecteur Vektor 向量 Condition Conditie Förutsättning 条件 Element variable Variable Élément Elementvariabele Elementvariabel 元素变量 Select first match Sélectionner la première occurrence Eerste overeenkomst secteren Välj första matchande element 选择第一个匹配项 Function Fonction Functie Funktion 函数 r:function fonction functie funktion Expression Expressie Uttryck 表达式 Arguments Arguments Argumenten Parametrar 自变量 Title Titre Titel Titel 标题 r:title titel titel Name Nom Naam Namn 名称 Display Error Afficher l'erreur Weergavefout Visa felmeddelande 显示错误 r:error erreur fout fel Message Bericht Meddelande 信息 Display Warning Afficher l'avertissement Waarschuwing weergeven Visa varning 显示警告 r:warning waarschuwing varning Message Bericht Meddelande 信息 Display Message Afficher le message Bericht weergeven Visa meddelande 显示信息 r:message bericht meddelande Message Bericht Meddelande 信息 Save as Variable Enregistrer comme variable Opslaan als variabele Spara som variabel 作为变量保存 r:save opslaan spara Value Valeur Waarde Värde Name Nom Naam Namn 名称 Category Catégorie Categorie Kategori 类别 Title Titre Titel Titel 标题 RPN Stack Register Registre de Pile NPI RPN-register in stapelgeheugen RPN-stackregister RPN栈寄存器 r:register Returns the value of a RPN stack register. Retourne la valeur d'un registre de pile NPI. Retourneert de waarde in een register van het RPN-stapelgeheugen. Returnerar värdet för ett register på RPN-stacken. 返回RPN栈寄存器的值。 Index Index 下标 RPN Stack Vector Vecteur de Pile NPI RPN-vector in stapelgeheugen RPN-stackvektor RPN栈向量 r:stack stapelgeheugen Returns the RPN stack as a vector. Retourne la pile NPI sous forme de vecteur. 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 Value Valeur Waarde Värde Is Real Is een reëel getal Är reellt 是实数 r:isReal isReëel ärReellt Value Valeur Waarde Värde Is Rational Is een rationaal getal Är rationellt 是有理数 r:isRational isRationaal ärRationellt Value Valeur Waarde Värde Is Integer Is een geheel getal Är heltal 是整数 r:isInteger isGeheel ärHeltal Value Valeur Waarde Värde Represents Number Geeft een getal weer Representar nummer 代表数字 r:representsNumber isGetal representerarNummer Value Valeur Waarde Värde Represents Real Geeft een reëel getal weer Representerar reellt tal 代表实数 r:representsReal isReëel representerarReelt Value Valeur Waarde Värde Represents Rational Geeft een rationaal getal weer Representerar rationellt tal 代表有理数 r:representsRational isRationaalgetal representerarRationellt Value Valeur Waarde Värde Represents Integer Geeft een geheel getal weer Representerar ett heltal 代表整数 r:representsInteger isGeheelgetal representarHeltal Value Valeur Waarde Värde Logical Logique Logisch Logik 逻辑 For...Do For...Do (Pour...Faire) For...Do För...utför For...Do r:for pour för Initial value of counter Valeur initiale du compteur Beginwaarde van teller Initialt värde för räknare 计数器初始值 Counter variable Variable de compteur Tellervariabele Räknarvariabel 计数器变量 For condition Condition de boucle for For-voorwaarde Medans-villkor For条件 Counter update function Fonction d'incrémentation du compteur Functie voor bijwerken van de teller Funktion för uppdatering av räknare 计数器更新函数 Initial value Valeur initiale Beginwaarde Initialt värde 初始值 Do function Fonction 'faire' Do-functie Funktion Do函数 Value variable Variable valeur Waarde variabele Värdevariabel 值变量 If...Then...Else Si...Sinon..Alors If...Then...Else Om...då...annars If...Then...Else r:if si om Tests a condition and returns a value depending on the result. Teste une condition et retourne une valeur en fonction du résultat. 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 Expression si la condition est remplie Expressie indien aan conditie wordt voldaan Uttryck om villkoret uppfylls 条件满足时的表达式 Expression if condition is NOT met Expression si la condition N'EST PAS remplie Expressie indien NIET aan conditie wordt voldaan Uttryck om villkoret INTE uppfylls 条件不满足时的表达式 Logical Exclusive OR OU Exclusif Logique Booleaanse XOR 逻辑排斥OR r:xor Value 1 Valeur 1 Waarde 1 Värde 1 值1 Value 2 Valeur 2 Waarde 2 Värde 2 值2 Bitwise Exclusive OR OU exclusif bit à bit Bitsgewijs XOR 按位排斥OR r:bitxor Value 1 Valeur 1 Waarde 1 Värde 1 值1 Value 2 Valeur 2 Waarde 2 Värde 2 值2 Bitwise Shift Décalage de bits Bitsgewijs verschuiven (shift) 按位移位 r:shift Number Nombre Nummer Nummer 数字 Bits Bits 比特 Algebra Algèbre Algebra Algebra 代数 Sum Somme Som Summa 求和 au:Σ,r:sum au:Σ,som au:Σ,summa Corresponds to the sum symbol. Adds terms for each x ranging from the lower to the upper limit. Correspond au symbole de la somme. Ajoute les termes pour chaque x allant de la borne inférieure à la borne supérieure. 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) Limite inférieure (i) Ondergrens (i) Undre gräns (i) 下限(i) Upper limit (n) Limite Supérieure (n) Bovengrens (n) Övre gräns (n) 上限(n) Index variable Variable d'index Indexvariabele Indexvariabel 下标变量 Product Produit Product Produkt 连乘 au:Π,r:product au:Π,produkt Corresponds to the product symbol. Multiplies factors for each x ranging from the lower to the upper limit. Correspond au symbole du produit. Multiplie les facteurs pour chaque x allant de la la limite inférieure à la limite supérieure. 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 Factoriser l'expression Expressie voor factor Faktoruttryck 因子表达式 Lower limit (i) Limite inférieure (i) Ondergrens (i) Undre gräns (i) 下限(i) Upper limit (n) Limite Supérieure (n) Bovengrens (n) Övre gräns (n) 上限(n) Index variable Variable d'index Indexvariabele Indexvariabel 下标变量 Solve for multiple variables Résoudre pour des variables multiples Oplossen voor meerdere variabelen Lös för flera variabler 多变量求解 r:multisolve meerdereoplossen r:multisolve Equation vector Vecteur d'équation Vergelijkingsvector Ekvationsvektor 方程向量 Variable vector Variable vecteur Variabele vector Variabelvektor 变量向量 Solve equation Résoudre l'équation Vergelijking oplossen Lös ekvation 方程求解 r:solve oplossen lös Equation Équation Vergelijking Ekvation 方程 With respect to Met betrekking tot Med avseende på 关于 Solve for two variables Résoudre pour deux variables Oplossen voor twee variabelen Lös för två variabler 双变量求解 r:solve2 oplossen2 lös2 Solves two equations with two unknown variables. Returns the value of the first variable. Résout deux équations à deux inconnues. Retourne la valeur de la première 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 Équation 2 Vergelijking 1 Ekvation 1 方程1 Equation 2 Équation 2 Vergelijking 2 Ekvation 2 方程 Variable 1 Variabele 1 Variabel 1 变量1 Variable 2 Variabele 2 Variabel 2 变量2 Find Linear Function Trouver une fonction affine Lineaire functie bepalen Finn linjär funktion 寻找线性函数 r:linearfunction lineairefunctie linjär_funktion Finds the linear function for the straight line between two distinct points. Trouve la fonction affine pour la ligne droite passant entre deux points distincts. 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 y1 x2 y2 Calculus Calcul Calculus Calculus 微积分 Differentiate Derivera 百分位数 r:diff Function Fonction Functie Funktion 函数 With respect to Met betrekking tot Med avseende på 关于 Order Ordre Orde Ordning 次数 Integrate Intégrale Integreren Integrera 积分 r:integrate intégrer integreren integrera Function Fonction Functie Funktion 函数 Variable of integration Variable d'intégration Integratievariabele Variabel för integration 积分变量 Lower limit Limite inférieure Ondergrens Undre gräns 下限 Upper limit Limite Supérieure Bovengrens Övre gräns 上限 Extreme Values Valeurs extrêmes Uiterste waarden Extremvärden 极限值 r:extremum uiterste solve(diff(\x, \Y{x})=0, \Y) Function Fonction Functie Funktion 函数 With respect to Met betrekking tot Med avseende på 关于 Geometry Géométrie Meetkunde Geometri 几何 Triangle Driehoek Triangel 三角形 Hypotenuse Hypoténuse Hypotenusa Hypotenusa 斜边 r:hypot sqrt(\x^2+\y^2) Side A Côté A Zijde A Sida A 边A Side B Côté B Zijde B Sida B 边B Triangle Area Aire de Triangle Oppervlakte van driehoek Triangelarea 三角形面积 r:triangle driehoek triangel (\x*\y)/2 Base Grondtal Bas 基/底 Height Hauteur Hoogte Höjd 高度 Triangle Perimeter Périmètre de Triangle Omtrek van driehoek Triangelomkrets (直角)三角形周长 r:triangle_perimeter driehoek_omtrek triangelomkrets \x+\y+hypot(\x,\y) Side A Côté A Zijde A Sida A 边A Side B Côté B Zijde B Sida B 边B Circle Cercle Cirkel Cirkel 圆形 Circle Area Aire d'un cercle Cirkeloppervlak Cirkelarea 圆面积 r:circle cercle cirkel cirkel Calculates the area of a circle using the radius Calcule l'aire d'un cercle d'après son rayon Berekent met de straal het oppervlak van een cirkel Beräknar arean för en cirkel. 使用半径计算圆面积 \x^2*pi Radius Rayon Straal Radie 半径 Circle Circumference Circonférence d'un cercle Cirkelomtrek Cirkelomkrets 圆周长 r:circumference circonférence cirkelomtrek omkrets Calculates the area of a circle using the radius Calcule l'aire d'un cercle d'après son rayon Berekent met de straal het oppervlak van een cirkel Beräknar arean för en cirkel. 使用半径计算圆面积 \x*2*pi Radius Rayon Straal Radie 半径 Cylinder Cylindre Cilinder Cylinder 圆柱 Cylinder Volume Volume d'un cylindre Volume van cilinder Cylindervolym 圆柱体积 r:cylinder cylindre cilinder \x^2*pi*\y Radius Rayon Straal Radie 半径 Height Hauteur Hoogte Höjd 高度 Surface Area of Cylinder Aire de la Surface d'un Cylindre Oppervlaktegrootte van cilinder Ytarea för en cylinder 圆柱体表面积 r:cylinder_sa cilinder_opp cylinderyta 2*(\x^2*pi)+2*pi*\x*\y Radius Rayon Straal Radie 半径 Height Hauteur Hoogte Höjd 高度 Cone Cône Kegel Kon 圆锥 Cone Volume Volume d'un cône Volume van kegel Konvolym 圆锥体积 r:cone cône kegel kon \x^2*pi*\y/3 Radius Rayon Straal Radie 半径 Height Hauteur Hoogte Höjd 高度 Surface Area of Cone Aire de la Surface d'un Cône Oppervlaktegrootte van kegel Ytarea för en kon 圆锥表面积 r:cone_sa kegel_opp konyta \x^2*pi+pi*\x*abs((\y^2+\x^2)^(1/2)) Radius Rayon Straal Radie 半径 Height Hauteur Hoogte Höjd 高度 Sphere Sphère Bol Sfär 球体 Sphere Volume Volume de Sphère Volume van bol Sfärvolym 球体积 r:sphere bol sfär \x^3*pi*4/3 Radius Rayon Straal Radie 半径 Surface Area of Sphere Aire de la Surface d'une Sphère Oppervlaktegrootte van bol Ytarea för en sfär 球体表面积 r:sphere_sa bol_oppervlak sfäryta \x^2*pi*4 Radius Rayon Straal Radie 半径 Square Carré Vierkant Kvadrat 正方形 Square Area Aire d'un Carré Oppervlakte van vierkant Kvadratarea 正方形面积 r:square vierkant kvadrat \x^2 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Square Perimeter Périmètre d'un Carré Omtrek van vierkant Kvadratomkrets 正方形周长 r:square_perimeter vierkant_omtrek kvadratomkrets \x*4 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Cube Derdemacht Kub 立方体 Cube Volume Volume d'un cube Volume kubus Kubvolym 立方体体积 r:cube kubus kub \x^3 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Surface Area of Cube Aire de la Surface d'un Cube Oppervlaktegrootte van kubus Ytarea för en kub 立方体表面积 r:cube_sa kubus_opp kubyta (\x^2)*6 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Rectangle Rechthoek Rektangel 矩形 Rectangle Area Aire de Rectangle Oppervlak rechthoek Rektangelarea 矩形面积 r:rect rektangel \x*\y Length Longueur Lengte Längd 长度 Width Largeur Breedte Bredd 宽度 Rectangle Perimeter Périmètre de Rectangle Omtrek rechthoek Rektangelomkrets 矩形周长 r:rect_perimeter rect_omtrek rektangelomkrets (\x+\y)*2 Length Longueur Lengte Längd 长度 Width Largeur Breedte Bredd 宽度 Prism Prisme Prisma Prism 棱柱 Volume of Rectangular Prism Volume de Prisme Rectangulaire Inhoud van rechthoekig prisma Volym för en rektangulär prism 矩形棱柱体积 r:rectprism rectprisma rektangelprism Calculates the volume of a prism with rectangular base. Calcule le volume d'un prisme à base rectangulaire. 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 Longueur Lengte Längd 长度 Width Largeur Breedte Bredd 宽度 Height Hauteur Hoogte Höjd 高度 Surface Area of Rectangular Prism Aire de la Surface d'un Prisme Rectangulaire Oppervlaktegrootte van rechthoekig prisma Ytarea för en rektangulär prism 矩形棱柱表面积 r:rectprism_sa rectprisma_opp rektangelprismyta Calculates the surface area of a prism with rectangular base. Calcule l'aire de la surface d'un prisme à base rectangulaire. 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 Longueur Lengte Längd 长度 Width Largeur Breedte Bredd 宽度 Height Hauteur Hoogte Höjd 高度 Volume of Triangular Prism Volume de Prisme Rectangulaire Inhoud van driehoekig prisma Volym för en triangulär prism 三角棱柱体积 r:triangleprism driehoekprisma triangelprism Calculates the volume of a prism with triangular base. Calcule le volume d'un prisme à base triangulaire. 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 Longueur Lengte Längd 长度 Width Largeur Breedte Bredd 宽度 Height Hauteur Hoogte Höjd 高度 Pyramid Pyramide Piramide Pyramid 锥体 Pyramid Volume Volume de Pyramide Volume van piramide Pyramidvolym 锥体体积 r:pyramid piramide Calculates the volume of a 3-dimensional shape standing on a rectangular base and terminating in a point at the top. Calcule le volume d'une forme à trois dimensions basée sur un rectangle et se finissant en un point au sommet. 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 Longueur de la taille Lengte van basis Basens längd 底面长度 Width of base Largeur de la base Basislengte Basens bredd 底面宽度 Height Hauteur Hoogte Höjd 高度 Volume of Regular Tetrahedron Volume de Tétraèdre Régulier Inhoud van regelmatig viervlak (tetraëder) Volym för en liksidig tetrahedron 正四面体体积 r:tetrahedron tetraëder sqrt(2)/12*\x^3 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Surface Area of Regular Tetrahedron Aire de la Surface d'un Tétraèdre Régulier Oppervlaktegrootte van regelmatig viervlak (tetraëder) Ytarea för en liksidig tetrahedron 正四面体表面积 r:tetrahedron_sa tetraëder_opp tetrahedronyta sqrt(3)*\x^2 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Height of Regular Tetrahedron Hauteur d'un Tétraèdre Régulier Hoogte van een regelmatig viervlak (tetraëder) Höjden på en liksidig tetrahedron 正四面体的高度 r:tetrahedron_height tetraëder_hoogte tetrahedronhöjd sqrt(6)/3*\x Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Volume of Square Pyramid Volume de Pyramide à Base Carrée Inhoud van vierkant prisma Volym för en kvadratisk pyramid 方锥体体积 r:sqpyramid vierkpiramide kvpyramid sqrt(2)/6*\x^3 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Surface Area of Square Pyramid Aire de la Surface d'une Pyramide Oppervlaktegrootte van vierkante piramide Ytarea för en kvadratisk pyramid 方锥体表面积 r:sqpyramid_sa vierkpiramide_opp kvpyramidyta (1+sqrt(3))*\x^2 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Height of Square Pyramid Hauteur d'une Pyramide à Base Carrée Hoogte van een vierkante piramide Höjden på en kvadratisk pyramid 方角锥的高度 r:sqpyramid_height midhoogte_vierkpiramide kvpyramidhöjd sqrt(2)/2*\x Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Parallelogram Parallélogramme Parallellogram Parallelogram 平行四边形 Parallelogram Area Aire d'un Parallélogramme Oppervlak van parallellogram Parallelogramarea 平行四边形面积 r:parallelogram parallélogramme parallellogram parallellogram 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 Hauteur Hoogte Höjd 高度 Parallelogram Perimeter Périmètre d'un Parallélogramme Omtrek van parallellogram Parallelogramomkrets 平行四边形周长 r:parallelogram_perimeter périmètre_de_parallélogramme parallellogram_omtrek parallellogramomkrets 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 Côté A Zijde A Sida A 边A Side B Côté B Zijde B Sida B 边B Trapezoid Trapezium Trapetsoid 梯形 Trapezoid Area Oppervlakte van trapezium Trapetsoidarea 梯形面积 r:trapezoid trapezium trapetsoid 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 Côté A Zijde A Sida A 边A Side B Côté B Zijde B Sida B 边B Height Hauteur Hoogte Höjd 高度 Economics Économie Economie Ekonomi 经济学 Microeconomics Micro-économie Microëconomie Mikroekonomi 微观经济学 Elasticity Élasticité Elasticiteit Elasticitet 弹性 r:elasticity élasticité elasticiteit elasticitet 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. Calcule l'élasticité de la demande. Fonctionne également pour l'élasticité de l'offre, de revenu, de prix croisés, etc. Remplacez simplement demande par offre, ou prix par revenu... Ex. elasticity(100-x^2, 3) calcule l'élasticité de la demande quand le prix est 3 pour la fonction "Q = 100 - x^2" où x est la variable de prix par défaut. 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 Fonction de la demande Vraagfunctie Efterfrågefunktion 需求函数 Price Prix Prijs Pris 价格 Price variable Variable de prix Prijsvariabele Prisvariabel 价格变量 Consumer Surplus Plus-value du Consommateur Consumentenoverschot Konsumentöverskott 消费者剩余 r:csurplus konsumentöverskott select(solve(\x=\y,\z),x>=0,x,1) replace(integrate(\x-replace(\y,\Z{x},\1),\Z),\Z,\1,1) Demand function Fonction de la demande Vraagfunctie Efterfrågefunktion 需求函数 Supply function or price Aanbodfunctie of prijs Tillgångsfunktion eller pris 供给函数或价格 Quantity variabel Variable de quantité Hoeveelheidvariabele Kvantitetsvariabel 数量变量 Producer Surplus Surplus du Producteur Producentenoverschot Producentöverskott r:psurplus producentöverskott 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 Fonction de la demande ou prix Vraagfunctie of prijs Efterfrågefunktion eller pris 需求函数或价格 Quantity variabel Variable de quantité Hoeveelheidvariabele Kvantitetsvariabel 数量变量 Finance Financiën Finans 金融 Sum-of-Years Digits Depreciation Afschrijving volgens som der jaren Årlig avskrivningssumma 年数总和折旧 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. Calcule la dépréciation d'un actif d'après son coût, sa valeur résiduelle, sa durée prévue et une période particulière. Cette méthode accélère le taux de dépréciation, ainsi les frais de dépréciation sont plus importants dans les premières périodes que dans les dernières. Le coût amortissable est la valeur réelle moins la valeur résiduelle. La vie utile est le nombre de périodes (typiquement années) pendant lesquelles les actifs sont dépréciés. 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 Coût Kosten Kostnad 成本 Salvage value Restwaarde Slutvärde 残值 Life Vie Levensduur Livslängd Period Période Termijn Period 周期 Straight Line Depreciation Gelijkblijvende afschrijving Linjär avskrivning 直线折旧 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. Calcule la dépréciation linéaire d'un actif pour une période. Le coût est le montant pour lequel vous avez payé pour l'actif. La valeur résiduelle est la valeur de l'actif à la fin de la période. La vie est le nombre de périodes pendant lesquelles l'actif est déprécié. 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 Coût Kosten Kostnad 成本 Salvage value Restwaarde Slutvärde 残值 Life Vie Levensduur Livslängd Present Value Valeur Actuelle Huidige waarde Nuvärde 现值 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. Retourne la valeur actuelle d'un investissement. Si type = 1 alors le paiement est fait au début de la période, si type = 0 (ou omis) il est fait à la fin de chaque période. 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 Taux d'intérêt Rentepercentage Räntesats 利率 Number of periods Nombre de périodes Aantal termijnen Antal perioder 期数 Payment made each period Versement effectué à chaque période Termijnbetaling Periodisk avbetalning 每期支付 Future value Valeur future Toekomstige waarde Framtida värde 未来值 Type Type Typ 类型 Nominal Interest Rate Taux d'Intérêt Nominal Nominaal rentepercentage Nominell räntesats 名义利率 r:nominal nominaal Calculates the nominal interest rate from a given effective interest rate compounded at given intervals. Calcule le taux d'intérêt nominal pour un taux d'intérêt effectif donné composé à des intervalles donnés. 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 Taux d'intérêt effectif Effectief rentepercentage Effektiv räntesats 有效利率 Periods Périodes Termijnen Antal perioder 周期 Zero Coupon Zonder coupons Nollkupong 零息 r:zero_coupon geen_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 Valeur nominale Nominale waarde Nominellt värde 票面价值 Interest rate Taux d'intérêt Rentepercentage Räntesats 利率 Years Années Jaren Antal år Treasury Bill Yield Opbrengst kortlopende overheidsobligatie zonder coupons Avkastningen för statsskuldväxel 短期债券收益 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 Échéance Vervaldatum Mognadsdatum 到期日期 Price per $100 face value Prix pour 100 $ de valeur faciale Pris per 100 kr nominellt värde 每$100票面价值的价格 Treasury Bill Price Prijs kortlopende overheidsobligatie zonder coupons Värde för statsskuldväxel 短期债券价格 r:tbillprice Returns the price per $100 value for a treasury bill. Retourne le prix pour 100 $ de valeur de bons du trésor. 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 Échéance Vervaldatum Mognadsdatum 到期日期 Discount rate Taux d'actualisation Discontopercentage Diskonto 贴现率 Treasury Bill Equivalent Equivalent van kortlopende overheidsobligatie zonder coupons Statsskultväxelavkastning motsvarande obligation 短期债券等价物 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 Échéance Vervaldatum Mognadsdatum 到期日期 Discount rate Taux d'actualisation Discontopercentage Diskonto 贴现率 Interest paid on a given period of an investment (ISPMT) Intérêt payé pour une période donnée d'un investissement Rente betaald over een gegeven investeringstermijn (ISPMT) Ränta betalad under specifik betalningsperiod (ISPMT) 给定投资期内要支付的利息(ISPMT) r:ispmt Calculates the interest paid on a given period of an investment. Calcule l'intérêt d'un investissement payé sur une période donnée. 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 Période d'amortissement Amortisatieperiode Amorteringsperiod 偿还期 1 Number of periods Nombre de périodes Aantal termijnen Antal perioder 期数 1 Present value Valeur actuelle Huidige waarde Nuvärde 现值 Payment for a loan Versement pour un emprunt Betaling voor een lening Betalning för ett lån 贷款偿还 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. Note that the interest rate here refers to the rate for each period and if you calculate with an annual rate, each period will be interpreted as a whole year (to get monthly payments, divide the result by 12). (-\z*((1+\x)^\y)-\A{0})/((1+\x*\B{0})*(((1+\x)^\y-1)/\x)) Rate Räntesats 利率 Number of periods Nombre de périodes Aantal termijnen Antal perioder 期数 Present value Valeur actuelle Huidige waarde Nuvärde 现值 Future value Valeur future Toekomstige waarde Framtida värde 未来值 Type Type Typ 类型 Periods of an investment Termijnen van een investering Perioder för en investering 投资的期数 r:nper nterm 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. Calcule le nombre de périodes d'un investissement reposant sur des paiements périodiques constants et un taux d'intérêt constant.. Le type définit l'échéance. 1 pour paiement en début de période et 0 (par défaut) pour paiement en fin de période. 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 Taux d'intérêt Rentepercentage Räntesats 利率 Payment made each period Versement effectué à chaque période Termijnbetaling Periodisk avbetalning 每期支付 Present value Valeur actuelle Huidige waarde Nuvärde 现值 Future value Valeur future Toekomstige waarde Framtida värde 未来值 Type Type Typ 类型 Duration Durée Duur Duration 持续时间 r:duration durée tijdsduur Calculates the duration of a security. Calcule la durée d'une obligation. Berekent de looptijd van een waardepapier. Beräknar livslängden på en säkerhet. 计算债券的持续时间。 Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Échéance Vervaldatum Mognadsdatum 到期日期 Annual coupon rate (%) Taux de coupon annuel (%) Jaarlijkse couponopbrengst (%) Årlig kupongränta (%) 年息票利率(%) Annualized yield (%) Revenu annualisé Teruggerekende opbrengst per jaar (%) Årlig avkastning (%) 年度基础换算后的收益率(%) Frequency Fréquence Frequentie Frekvens 频率 Day counting basis Base de comptage des jours 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 Returns the number of periods needed for an investment to attain a desired value. Retourne le nombre de périodes nécessaires à un investissement pour atteindre un valeur désirée. 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 Räntesats 利率 Present value Valeur actuelle Huidige waarde Nuvärde 现值 Future value Valeur future Toekomstige waarde Framtida värde 未来值 Payment of an annuity going towards principal (PPMT) Versements d'une rente orientée vers le capital Aflossingsdeel van een termijn van een annuïteit (PPMT) Betalning för livränta som går mot kapital (PPMT) 本金的年金支付额(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. Calcule le montant des versements d'une rente orientée vers le capital. Le type définit la date de paiement. 1 pour des paiements en début de période et 0 (par défaut) pour des paiements en fin de période. 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 Période d'amortissement Amortisatieperiode Amorteringsperiod 偿还期 1 Number of periods Nombre de périodes Aantal termijnen Antal perioder 期数 1 Present value Valeur actuelle Huidige waarde Nuvärde 现值 Desired future value Valeur future souhaitée Gewenste toekomstige waarde Önskat framtida värde 期望的未来价值 Type Type Typ 类型 Effective Interest Rate Taux d'intérêt effectif Effectief rentepercentage Effektiv räntesats 有效利率 r:effect effet Calculates the effective interest for a given nominal rate. Calcule l'intérêt effectif pour un taux nominal donné. 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 Taux d'intérêt nominal Nominaal rentepercentage Nominell räntesats 名义利率 Periods Périodes Termijnen Antal perioder 周期 Future Value Valeur Future Toekomstige waarde Framtida värde 未来值 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. Calcule la valeur future d'un investissement. Cela est basé sur des paiements constants périodiques et un taux d'intérêt constant. Si le type = 1 alors le paiement est effectué au début de chaque période; si le type = 0 (ou omis), il a lieu à la fin de chaque période. 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 Taux d'intérêt Rentepercentage Räntesats 利率 Number of periods Nombre de périodes Aantal termijnen Antal perioder 期数 Payment made each period Versement effectué à chaque période Termijnbetaling Periodisk avbetalning 每期支付 Present value Valeur actuelle Huidige waarde Nuvärde 现值 Type Type Typ 类型 Return on continuously compounded interest Retour sur intérêt continûment composé Opbrengst van continu samengestelde rente Avkastning på fortlöpande sammansatt ränta 根据连续复合利率的回报 r:continuous continu Calculates the return on continuously compounded interest, given the principal, nominal rate and time in years. Calcule le retour sur intérêt composé continument, étant donnés le taux nominal principal et la durée en années. Berekent de opbrengst bij een continu samengestelde rente, gegeven de hoofdsom, nominale rente en de tijd in jaren. 根据给定的本金、名义利率和以年为单位的时间,计算连续复合利率的回报。 \x*exp(\y*\z) Principal Capital Hoofdsom 本金 Interest rate Taux d'intérêt Rentepercentage Räntesats 利率 Years Années Jaren Antal år Compound Composé Samengesteld Sammansatt 复合值 r:compound samenstellen 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 Capital Hoofdsom 本金 Nominal interest rate Taux d'intérêt nominal Nominaal rentepercentage Nominell räntesats 名义利率 Periods per year Termijnen per jaar Perioder per år 每年的期数 Years Années Jaren Antal år Payment of an annuity going towards interest (IPMT) Versements d'une rente orientée vers les intérêts Interestdeel van een termijn van een annuïteit (IPMT) Betalning för livränta som går mot ränta (IPMT) 利息的年金支付额(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. Calcule le montant des versements d'une rente orientée vers les intérêts. Le type définit la date de paiement. 1 pour des paiements en début de période et 0 (par défaut) pour des paiements en fin de période. 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 Période Termijn Period 周期 1 Number of periods Nombre de périodes Aantal termijnen Antal perioder 期数 1 Present value Valeur actuelle Huidige waarde Nuvärde 现值 Future value Valeur future Toekomstige waarde Framtida värde 未来值 Type Type Typ 类型 Interest rate for a fully invested security Taux d'intérêt d'une obligation entièrement investie Interestpercentage voor een waardepapier waarvan de hoofdsom aan het einde vrijvalt Räntesats för betalt värdepapper 一项已充分投资证券的利率 r:intrate renteperc 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. Retourne le taux d'intérêt pour une obligation entièrement investie. La base est les manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 30/360.La date de contrat doit être antérieure à l'échéance. 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 Échéance Vervaldatum Mognadsdatum 到期日期 Investment Investissement Investering Investering 投资 Redemption Amortissement Aflossing Utlösande summa 偿还 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Dollar Fraction Fraction en dollars Dollar fractie Kronor till bråktal 美元分数 r:dollarfr Converts a decimal dollar price into a dollar price expressed as a fraction. Convertit un prix en dollars décimaux en un prix en dollars sous forme de 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 Dollar décimal Decimale dollar Bråktal till kronor 小数表示的美元 Denominator of fraction Dénominateur d'une fraction Noemer van breuk Bråktalets nämnare 分数的分母 1 Dollar Decimal Dollar décimal Dollar decimaal Decimaltal 美元小数 r:dollarde Converts a dollar price expressed as a fraction into a dollar price expressed as a decimal number. Convertit en prix en dollars sous forme de fraction en un prix en dollars décimaux. 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 fractionnaire Dollar als breuk Bråktal 分数表示的美元 Denominator of fraction Dénominateur d'une fraction Noemer van breuk Bråktalets nämnare 分数的分母 1 Amount received at maturity for a security bond Montant reçu à maturité par un bon de sécurité Ontvangen bedrag voor een waardepapier op vervaldatum Erhållet belopp för en säkerhet vid mognad 债券到期时获得的金额 r:received ontvangen 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. Retourne le montant reçu à échéance pour un investissement en obligation. La base est les manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 30/360.La date de contrat doit être antérieure à l'échéance. 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 Échéance Vervaldatum Mognadsdatum 到期日期 Investment Investissement Investering Investering 投资 Discount rate Taux d'actualisation Discontopercentage Diskonto 贴现率 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Discount rate for a security Taux d'actualisation d'une obligation Discontopercentage voor een waardepapier Reduceringshastighet för säkerhet 证券的贴现率 r:disc kort 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 Échéance Vervaldatum Mognadsdatum 到期日期 Price per $100 face value Prix pour 100 $ de valeur faciale Pris per 100 kr nominellt värde 每$100票面价值的价格 Redemption Amortissement Aflossing Utlösande summa 偿还 Day counting basis Base de comptage des jours 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 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. Retourne les intérêts cumulés d'une obligation dont le versement à lieu à échéance. La base est les manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 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 Date de fin Uitgiftedatum Startdatum 发表日期 Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Annual rate of security Taux de sécurité annuel Jaarlijkse rente van waardepapier Årlig hastighet 证券年利率 Par value Montant nominal Nominale waarde Nominellt värde 面值 Day counting basis Base de comptage des jours 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 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. Retourne les intérêts cumulés pour une obligation dont les versements sont périodiques. Les fréquences autorisées sont 1 - annuelle, 2 - semestrielle ou 4 - trimestrielle. La base est les manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 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 Date de fin Uitgiftedatum Startdatum 发表日期 First interest Premier intérêt Eerste rente Första ränteinbetalning 第一笔利息 Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Annual rate of security Taux de sécurité annuel Jaarlijkse rente van waardepapier Årlig hastighet 证券年利率 Par value Montant nominal Nominale waarde Nominellt värde 面值 Frequency Fréquence Frequentie Frekvens 频率 1 4 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Number of coupons to be paid Nombre de coupons à payer Aantal te betalen coupons Antal förfallande kuponger 要支付的息票数量 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. Retourne le nombre de coupons à payer entre la date de transaction et l'échéance. La base est les manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 30/360.La date de contrat doit être antérieure à l'échéance. 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 Échéance Vervaldatum Mognadsdatum 到期日期 Frequency Fréquence Frequentie Frekvens 频率 1 12 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Price per $100 face value of a discounted security Pris per 100 kr nominellt värde för diskonterat värdepapper r:pricedisc prijskorting Calculates and returns the price per $100 face value of a discounted security. 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 kr värde av en diskonterad 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 \a-\z*\a*yearfrac(\x,\y,\B{0},1) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Échéance Vervaldatum Mognadsdatum 到期日期 Discount Escompte Korting Diskonto 贴现 Redemption Amortissement Aflossing Utlösande summa 偿还 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Price per $100 face value of a security Prix pour 100 $ de valeur faciale d'une obligation Pris per 100 kr nominellt värde för säkerhet 一支证券每$100票面价值的价格 r:pricemat prijsmat 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. Calcule et retourne le prix par obligation de 100$ de valeur faciale. L'obligation paie des intérêts à maturité. La base est la manière de compter les jours que vous souhaitez utiliser : 0: US 30/360 (par défaut), 1: jours réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 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 Échéance Vervaldatum Mognadsdatum 到期日期 Issue date Date de fin Uitgiftedatum Startdatum 发表日期 Discount rate Taux d'actualisation Discontopercentage Diskonto 贴现率 Annual yield Revenu annuel Opbrengst per jaar Årlig avkastning 年收益 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Level-Coupon Bond Obligatie met gelijkblijvende coupons Jämn kupongobligation 息票债券 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 Valeur nominale Nominale waarde Nominellt värde 票面价值 Coupon rate Taux du coupon Couponrente Kupongränta 息票利率 Coupons per year Coupons par an Aantal coupons per jaar Antal kuponger per år 息票数每年 Years Années Jaren Antal år Market interest rate Taux d'intérêt du marché Marktrente Marknadsränta 市场利率 libqalculate-0.9.10/data/Makefile.in0000644000175000017500000003701412757636731014170 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(xmldir)" DATA = $(xml_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 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_CLAGS = @CLN_CLAGS@ 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@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ 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_build_prefix = @top_build_prefix@ 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu data/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-xmlDATA: $(xml_DATA) @$(NORMAL_INSTALL) @list='$(xml_DATA)'; test -n "$(xmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(xmldir)" || exit $$?; \ done uninstall-xmlDATA: @$(NORMAL_UNINSTALL) @list='$(xml_DATA)'; test -n "$(xmldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xmldir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 html-am: info: info-am info-am: install-data-am: install-xmlDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 \ cscopelist-am ctags-am 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 tags-am uninstall uninstall-am uninstall-xmlDATA .PRECIOUS: Makefile @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.10/data/datasets.xml0000644000175000017500000003151012727775144014447 00000000000000 Data Sets Ensembles de Données Gegevensverzamelingen Dataset 数据集 !datasets!Elements Elementen Element 元素 elements.xml r:atom r:atome atoom !datasets!Element Element 元素 Symbol Symbole Symbool Symbol 符号 text true r:symbol r:symbole symbool !datasets!Number Nombre Getal Nummer 编号 number true !datasets!r:number r:nombre getal nummer 编号 Name Nom Naam Namn 名称 text true r:name r:nom naam namn 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 Polyatomic Non-Metal 9 Diatomic Non-Metal 10 Noble Gas 11 Unknown chemical properties Ett nummer som representerar en elementgrupp: 1 Alkalimetall 2 Jordalkalimetall 3 Lantanid 4 Aktinid 5 Övergångsmetall 6 Metall 7 Halvmetall 8 Polyatomisk icke-metall 9 Diatomisk icke-metall 10 Ädelgas 11 Okända kemiska egenskaper number r:class r:classe klasse klass Weight Poids Gewicht Vikt 重量 number true AMU true r:weight,mass r:poids,masse gewicht,massa vikt,massa Boiling Point Kookpunt Kokpunkt 沸点 number K true r:boiling kokend kokpunkt Melting Point Smeltpunt Smältpunkt 熔点 number K true r:melting smeltend smältpunkt Density Densité Dichtheid Densitet 密度 Density at 295K Dichtheid bij 295K Densitet vid 295K 295K时的密度 number g/cm^3 true r:density r:densité dichtheid densitet X Position Position en X X Positie X坐标 number true r:x_pos Y Position Position en Y Y Positie Y坐标 number true r:y_pos Planets Planètes 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 r:planète planeet Planet Planète Planeet 行星 Name Nom Naam Namn 名称 text true r:name r:nom naam namn Orbital Period (Year) Période Orbitale (Année) Omloopperiode (Jaar) Omkretstid (år) 轨道周期(年) number d true !datasets!r:year r:année jaar år Average Orbital Speed Vitesse Orbitale Moyenne Gemiddelde baansnelheid Genomsnittlig kretsloppshastighet 平均归到速度 number km/s true r:speed r:vitesse snelheid hastighet Eccentricity Excentricité Excentriciteit Excentricitet 偏心率 number true r:eccentricity r:excentricité excentriciteit excentricitet Inclination Inclinaison Inclinatie Inklination 倾角 number true r:inclination r:inclinaison inclinatie inklination Number of Satellites Nombre de Satellites Aantal satellieten Antal satelliter 卫星个数 number r:satellites satellieten satelliter !datasets!Mass Masse Massa Massa 质量 number kg true r:mass r:masse massa massa Mean Density Densité Moyenne Gemiddelde dichtheid Genomsnittlig densitet 平均密度 number g/cm^3 true r:density r:densité dichtheid densitet Surface Area Aire Oppervlak (3D) Ytarea 表面积 number km^2 true !datasets!r:area r:aire oppervlak 面积 Equatorial Gravity Gravité Équatoriale Equatoriale zwaartekracht Ekvatoriell tyngdkraft 赤道重力 number m/s^2 true r:gravity r:gravité zwaartekracht tyngdkraft Mean Surface Temperature Température Moyenne de Surface Gemiddelde oppervlaktetemperatuur Genomsnittlig yttemperatur 平均表面温度 number K true r:temperature r:température temperatuur temperatur libqalculate-0.9.10/data/elements.xml0000644000175000017500000011064612727775144014463 00000000000000 Hydrogen Hydrogène Waterstof Väte 9 1.008 20.271 13.99 0.00008988 1 1 Helium Hélium 10 4.002602 4.222 0.0001785 18 1 Lithium Litium 1 6.94 1603 453.65 0.533 1 2 Beryllium Béryllium 2 9.0121831 2742 1560 1.85 2 2 Boron Bore Boor Bor 7 10.81 4200 2349 2.34 13 2 Carbon Carbone Koolstof Kol 8 12.011 2.267 14 2 Nitrogen Azote Stikstof Kväve 9 14.007 77.355 63.15 0.0012506 15 2 Oxygen Oxygène Zuurstof Syre 9 15.999 90.188 54.36 0.001429 16 2 Fluorine Fluor Fluor Fluor 9 18.998403163 85.04 53.48 0.001696 17 2 Neon Néon 10 20.1797 27.104 24.56 0.0008999 18 2 Sodium Natrium Natrium 1 22.98976928 1156.090 370.944 0.971 1 3 Magnesium Magnésium 2 24.305 1363 923 1.738 2 3 Aluminum Aluminium Aluminium 6 26.9815385 2743 933.47 2.698 13 3 Silicon Silicium Silicium Kisel 7 28.085 3538 1687 2.3296 14 3 Phosphorus Phosphore Fosfor Fosfor 8 30.973761998 550 317.30 1.82 15 3 Sulfur Soufre Zwavel Svavel 8 32.06 717.8 388.36 2.067 16 3 Chlorine Chlore Chloor Klor 9 35.45 239.11 171.6 0.003214 17 3 Argon 10 39.948 87.302 83.81 0.0017837 18 3 Potassium Kalium Kalium 1 39.0983 1032 336.7 0.862 1 4 Calcium Kalcium 2 40.078 1757 1115 1.54 2 4 Scandium Skandium 5 44.955908 3109 1814 2.989 3 4 Titanium Titane Titaan Titan 5 47.867 3560 1941 4.54 4 4 Vanadium Vanadin 5 50.9415 3680 2183 6.11 5 4 Chromium Chrome Chroom Krom 5 51.9961 2755 2180 7.15 6 4 Manganese Manganèse Mangaan Mangan 5 54.938044 2334 1519 7.44 7 4 Iron Fer IJzer Järn 5 55.845 3143 1811 7.874 8 4 Cobalt Kobalt Kobolt 5 58.933194 3200 1768 8.86 9 4 Nickel Nikkel 5 58.6934 3002 1728 8.912 10 4 Copper Cuivre Koper Koppar 5 63.546 2835 1357.77 8.96 11 4 Zinc Zink Zink 5 65.38 1180 692.68 7.134 12 4 Gallium 6 69.723 2673 302.9146 5.907 13 4 Germanium 7 72.630 3106 1211.40 5.323 14 4 Arsenic Arsenicum Arsenik 7 74.921595 887 1090 5.776 15 4 Selenium Sélénium Selen 8 78.971 958 494 4.809 16 4 Bromine Brome Broom Brom 9 79.904 332.0 265.8 3.122 17 4 Krypton 10 83.798 119.735 115.78 0.003733 18 4 Rubidium 1 85.4678 961 312.45 1.532 1 5 Strontium 2 87.62 1650 1050 2.64 2 5 Yttrium 5 88.90584 3203 1799 4.469 3 5 Zirconium Zirkonium 5 91.224 4650 2128 6.506 4 5 Niobium Niob 5 92.90637 5017 2750 8.57 5 5 Molybdenum Molybdène Molybdeen Molybden 5 95.95 4912 2896 10.22 6 5 Technetium Technétium Teknetium 5 [98] 4538 2430 11.5 7 5 Ruthenium Rutenium 5 101.07 4423 2607 12.37 8 5 Rhodium Rodium 5 102.90550 3968 2237 12.41 9 5 Palladium 5 106.42 3236 1828.05 12.02 10 5 Silver Argent Zilver 5 107.8682 2483 1234.93 10.501 11 5 Cadmium Kadmium 5 112.414 1040 594.22 8.69 12 5 Indium 6 114.818 2345 429.75 7.31 13 5 Tin Étain Tenn 6 118.710 2875 505.08 7.287 14 5 Antimony Antimoine Antimoon Antimon 7 121.760 1908 903.78 6.685 15 5 Tellurium Tellure Telluur Tellur 7 127.60 1261 722.66 6.232 16 5 Iodine Iode Jood Jod 9 126.90447 457.4 386.85 4.93 17 5 Xenon Xénon 10 131.293 165.051 161.40 0.005887 18 5 Cesium Césium 1 132.90545196 944 301.7 1.873 1 6 Barium Baryum 2 137.327 1910 1000 3.596 2 6 Lanthanum Lanthane Lanthaan Lantan 3 138.9054 3737 1193 6.145 3 9 Cerium Cérium 3 140.116 3716 1068 6.77 4 9 Praseodymium Praséodyme Praseodym 3 140.90766 3403 1208 6.773 5 9 Neodymium Néodyme Neodym 3 144.242 3347 1297 7.007 6 9 Promethium Prométhium Prometium 3 [145] 3273 1315 7.26 7 9 Samarium 3 150.36 2173 1345 7.52 8 9 Europium 3 151.964 1802 1099 5.243 9 9 Gadolinium Gadolinium guld 3 157.25 3273 1585 7.895 10 9 Terbium 3 158.92535 3396 1629 8.229 11 9 Dysprosium 3 162.500 2840 1680 8.55 12 9 Holmium 3 164.93033 2873 1734 8.795 13 9 Erbium 3 167.259 3141 1802 9.066 14 9 Thulium Tulium 3 168.93422 2223 1818 9.321 15 9 Ytterbium 3 173.045 1703 1097 6.965 16 9 Lutetium 3 174.9668 3675 1925 9.84 3 6 Hafnium 5 178.49 4876 2506 13.31 4 6 Tantalum Tantale Tantaal Tantal 5 180.94788 5731 3290 16.654 5 6 Tungsten Tungstène Volfram 5 183.84 6203 3695 19.25 6 6 Rhenium Rhénium 5 186.207 5869 3459 21.02 7 6 Osmium 5 190.23 5285 3306 22.61 8 6 Iridium 5 192.217 4403 2719 22.56 9 6 Platinum Platine Platina Platina 5 195.084 4098 2041.4 21.46 10 6 Gold Or Goud Guld 5 196.966569 3129 1337.33 19.282 11 6 !elements!Mercury Mercure Kwik Kvicksilver 5 200.592 629.88 234.32 13.5336 12 6 Thallium Tallium 6 204.38 1746 577 11.85 13 6 Lead Plomb Lood Bly 6 207.2 2022 600.61 11.342 14 6 Bismuth Bismut Vismut 6 208.98040 1837 544.7 9.807 15 6 Polonium 6 [209] 1235 527 9.32 16 6 Astatine Astate Astat 7 [210] 575 7 17 6 Radon 10 [222] 211.5 202 0.00973 18 6 Francium 1 [223] 300 1.87 1 7 Radium 2 [226] 2010 973 5.5 2 7 Actinium Aktinium 4 [227] 3471 1323 10.07 3 10 Thorium Torium 4 232.0377 5061 2115 11.72 4 10 Protactinium Protaktinium 4 231.03588 1841 15.37 5 10 Uranium Uraan Uran 4 238.02891 4404 1405.3 18.95 6 10 Neptunium 4 [237] 4273 917 20.45 7 10 Plutonium 4 [244] 3501 912.5 19.84 8 10 Americium 4 [243] 2880 1449 13.69 9 10 Curium 4 [247] 3383 1613 13.51 10 10 Berkelium Berkélium 4 [247] 1323 14.79 11 10 Californium 4 [251] 1173 15.1 12 10 Einsteinium 4 [252] 1133 8.84 13 10 Fermium 4 [257] 1800 14 10 Mendelevium 4 [258] 1100 15 10 Nobelium 4 [259] 1100 16 10 Lawrencium 4 [266] 1900 3 7 Rutherfordium 5 [267] 4 7 Dubnium 5 [268] 5 7 Seaborgium 5 [269] 6 7 Bohrium 5 [270] 7 7 Hassium 5 [269] 8 7 Meitnerium 11 [278] 9 7 Darmstadtium 11 [281] 10 7 Roentgenium 11 [282] 11 7 Copernicium 5 [285] 12 7 Ununtrium 11 [286] 13 7 Flerovium 6 [289] 14 7 Ununpentium 11 [289] 15 7 Livermorium 11 [293] 16 7 Ununseptium Ununseptium 11 [294] 17 7 Ununoctium Ununoctium 11 [294] 18 7 libqalculate-0.9.10/data/currencies.xml0000644000175000017500000005102612727775144015005 00000000000000 Currency Monnaie Valuta Valuta 货币 European Euros Euros européens Europese euro Euro 欧元 ar:EUR,au:€,euro,p:euros a:EUR,au:€,euro ar:EUR,au:€,欧元 U.S. Dollars Dollar US U.S. dollar Amerikanska dollar 美元 a:$,ar:USD,dollar,p:dollars a:$,a:USD,dollar a:$,ar:USD,美元 Japanese Yen Yen japonais Japanse yen Japanska yen 日元 ar:JPY,au:¥,yen ar:JPY,au:¥,日元 Danish Kroner Couronne danoise Deense kroon Danska kronor 丹麦Kroner ar:DKK British Pounds Livre sterling Britse Pond Brittiska pund 英镑 ar:GBP,au:£ ar:GBP,au:£ Thai Baht Baht thailandais Thailandse bat Thailändska baht 泰国Bat ar:THB Swedish Krona Couronne suédoise Zweedse kroon Svenska kronor 瑞典克郎 ar:SEK a:kr,a:SEK,krona,p:kronor Swiss Francs Franc suisse Zwitserse franc Schweizerfranc 瑞士法郎 ar:CHF Icelandic Krona Couronne islandaise IJslandse kroon Isländska kronor 冰岛克朗 ar:ISK Norwegian Kroner Couronne norvégienne Noorse kroon Norska kronor 挪威Kroner ar:NOK Bulgarian Lev Lev bulgare Bulgaarse Lev Bulgariska lev 保加利亚列弗 lev,ar:BGN Russian Ruble Rouble russe Russische roebel Ryska rubel 俄罗斯卢布 ar:RUB,au:₽,ruble ar:RUB,au:₽,rouble a:RUB,au:₽,roebel a:RUB,au:₽,rubel ar:RUB,au:₽,卢布 Philippine Peso Peso philippin Filippijnse peso Filippinska peso ar:PHP,au:₱ Malaysian Ringgit Ringgit malaisien Maleisische ringgit Malaysiska ringgit 马来西亚林吉特 ar:MYR Croatian Kuna Kuna croate Kroatische kuna Kroatiska kuna 克罗地亚 ar:HRK Yuan Renminbi (PR China) Yuan renminbi (rep. pop. de Chine) 人民币元 ar:CNY Indonesian Rupiah Rouple indonésienne Indonesische roepiah Indonesiska rupiah 印尼卢比 ar:IDR,rupiah a:IDR Czech Koruna Koruna tchèque Tsjechische kroon Tjeckiska koruna 捷克克朗 ar:CZK Hungarian Forint Florin hongrois Hongaarse forint Ungerska forint 匈牙利福林 forint,ar:HUF florint hongrois,ar:HUF Polish Zloty Zloty polonais Poolse zloty Polska zloty 波兰兹罗提 zloty,ar:PLN Romanian New Leu Nouveau Leu roumain Nieuwe Roemeense leu Rumänska nya leu 罗马尼亚新Leu leu,ar:RON Turkish New Lira Nouvelle livre turque Nieuwe Turkse lire Turkiska nya lira 土耳其新里拉 ar:TRY,au:₺ Australian Dollars Dollar australien Australische dollar Australiensiska dollar 澳大利亚元 ar:AUD Canadian Dollars Dollar canadien Canadese dollar Kanadensiska dollar 加拿大元 ar:CAD Hong Kong Dollars Dollar de Hong Kong Hongkong dollar Hong Kong dollar 港币 ar:HKD New Zealand Dollars Dollars néo-zélandais Nieuwzeelandse dollar Nya Zeeländska dollar 新西兰元 ar:NZD Singapore Dollars Dollar de Singapour Singapore dollar Singaporedollar 新加坡元 ar:SGD South Korean Won Won sud corréenne Zuid-Koreaanse won Sydkoreanska won 韩元 ar:KRW,au:₩,won South African Rand Rand sudafricaine Zuid-Afrikaanse rand Sydafrikanska rand 南非兰特 ar:ZAR Indian Rupee Indiska rupier ar:INR,au:₹,rupee a:INR,au:₹,rupie,p:rupier Israeli New Sheqel Israeliska Sheqels ar:ILS,au:₪,sheqel a:ILS,au:₪,sheqel Mexican Peso Mexikanska pesos ar:MXN Brazilian Real Brasilianska real ar:BRL Euro Cent centime d'Euro Eurocent Eurocent 欧元分 r:eurocent,p:eurocents eurocent,p:eurocenten eurocent r:欧元分 EUR 1/100 1 Cent (USD) Cent (USD) Cent (USD) 美分 au:¢,r:cent,p:cents au:¢,cent,p:centen au:¢,cent au:¢,r:美分 USD 1/100 1 Belgian Franc Franc belge Belgische frank Belgiska franc 比利时法郎 ar:BEF EUR 1/40.3399 1 Greek Drachma Drachme grecque Griekse drachme Grekiska drachmer 希腊德拉马克 ar:GRD,au:₯,drachma EUR 1/340.750 1 French Franc Franc français Franse franc Franska franc 法国法郎 ar:FRF,au:₣,franc EUR 1/6.55957 1 Italian Lira Lire italienne Italiaanse lire Italienska lire 意大利里拉 ar:ITL,au:₤,lira ar:ITL,au:₤,lire a:ITL,au:₤,lire a:ITL,au:₤,lire ar:ITL,au:₤,里拉 EUR 1/1936.27 1 Dutch Guilder Florin néerlandais Nederlandse gulden Nederländska gulden 荷兰盾 ar:NLG,guilder ar:NLG,florin a:NLG,gulden a:NLG,gulden EUR 1/2.20371 1 Portuguese Escudo Escudo portugais Portugese escudo Portugisiska escudos 葡萄牙埃斯库多 ar:PTE,escudo EUR 1/200.482 1 Deutsche Mark Duitse mark Tyska mark ar:DEM,mark a:DEM,马克 EUR 1/1.95583 1 Spanish Peseta Peseta espagnole Spaanse peseta Spanska pesetas 西班牙比塞塔 ar:ESP,au:₧,peseta,p:pesetas EUR 1/166.386 1 Irish Pound Livre irlandaise Ierse pond Irländska pund 爱尔兰镑 ar:IEP EUR 1/0.787564 1 Luxembourg Franc Franc luxembourgeois Luxemburgse frank Luxemburgfranc 卢森堡法郎 ar:LUF EUR 1/40.3399 1 Austrian Schilling Shilling autrichien Oostenrijkse schilling Österrikiska schilling 奥地利先令 ar:ATS,schilling a:ATS,先令 EUR 1/13.7603 1 Finnish Markka Markka finnois Finse mark Finska mark 芬兰马克 ar:FIM,markka EUR 1/5.94573 1 Slovenian Tolar Tolar slovène Sloveense tolar Slovenska tolar 斯洛文尼亚Tolar ar:SIT,tolar EUR 1/239.640 1 Cypriot Pound Livre chypriote Cypriotische pond Cypriotiska pund 塞浦路斯镑 ar:CYP EUR 1/0.585274 1 Estonian Kroon Kroon estonienne Estlandse kroon Estoniska kroon 爱沙尼亚克鲁恩 ar:EEK,kroon,p:krooni EUR 1/15.6466 1 Slovak Koruna Couronne slovaque Slowaakse kroon Slovakiska koruna 斯洛伐克Koruna ar:SKK EUR 1/30.1260 1 Maltese Lira Lire maltaise Maltese Lira Maltesiska lire 马耳他里拉 ar:MTL EUR 1/0.429300 1 Latvian Lats Lats letton Letlandse lat Lettiska lats 拉脱维亚 Lats lats,ar:LVL EUR 1/0.702800 1 Lithuanian Litas Litas lituanien Litouwse litas Litauiska litas 立陶宛Litas litas,ar:LTL EUR 1/3.45280 1 libqalculate-0.9.10/data/Makefile.am0000644000175000017500000000052112710464012014124 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.10/data/prefixes.xml0000644000175000017500000000636412727775144014475 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 hecto 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.10/data/variables.xml0000644000175000017500000010467112727775144014620 00000000000000 Small Numbers Kleine getallen Små tal 小数字 Per Mille Per mille Promille 千分之一 r:permille,au:‰ pourmille,au:‰ 1/1000 Per Myriad Per myriad Permyriad 万分之一 r:permyriad,au:‱ 1/10000 Percent Procent Procent 百分位数 a:%,r:percent a:%,pourcent a:%,r:procent 1/100 Large Numbers Grands Nombres Grote getallen Stora tal 大数 Googolplex Googolplex r:googolplex 10^(10^100) Googol Googol 大数 r:googol 10^100 Centillion Quinquagintiljard 百万的一百次方 -r:centillion quinquagintiljard 1E303 Vigintillion Deciljard Deciljard -r:vigintillion deciljard deciljard,p:deciljarder 1E63 Novemdecillion deciljoen Deciljon -r:novemdecillion deciljoen deciljon,p:deciljoner 1E60 Octodecillion Noniljard Noniljard -r:octodecillion noniljard noniljard,p:noniljarder 1E57 Septendecillion Noniljoen Noniljon -r:septendecillion noniljoen noniljon,p:noniljoner 1E54 Sexdecillion Octiljard Oktiljard -r:sexdecillion octiljard oktiljard,p:oktiljarder 1E51 Quindecillion Octiljoen Oktiljon -r:quindecillion octiljoen oktiljon,p:oktiljoner 1E48 Quattuordecillion Septiljard Septiljard -r:quattuordecillion septiljard septiljard,p:septiljarder 1E45 Tredecillion Septiljoen Septiljon -r:tredecillion septiljoen septiljon,p:septiljoner 1E42 Duodecillion Sextiljard Sextiljard -r:duodecillion sextiljard sextiljard,p:sextiljarder 1E39 Undecillion Sextiljoen Sextiljon -r:undecillion sextiljoen sextiljon,p:sextiljoner 1E36 Decillion Quintiljard Kvintiljard -r:decillion quintiljard kvintiljard,p:kvintiljarder 1E33 Nonillion Quintiljoen Kvintiljon -r:nonillion quintiljoen kvintiljon,p:kvintiljoner 1E30 Octillion Quadriljard Kvadriljard -r:octillion quadriljard kvadriljard,p:kvadriljarder 1E27 Septillion Quadriljoen Kvadriljon -r:septillion quadriljoen kvadriljon,p:kvadriljoner 1E24 Sextillion Triljard Triljard -r:sextillion triljard triljard,p:triljarder 1E21 Quintillion Triljoen Triljon -r:quintillion triljoen triljon,p:triljoner 1E18 Quadrillion Biljard Biljard -r:quadrillion biljard biljard,p:biljarder 1E15 Trillion Biljoen Biljon -r:trillion biljoen biljon,p:biljoner 1E12 Billion Milliard Miljard Miljard 十亿 -r:billion miljard miljard,p:miljarder 1E9 Million Million Miljoen Miljon 百万 -r:million miljoen miljon,p:miljoner 1E6 Thousand Duizend Tusen -r:thousand duizend tusen 1E3 Hundred Honderd Hundra -r:hundred honderd hundra 1E2 Physical Constants Constantes Physiques Natuurkundige constanten Fysiska konstanter 物理常数 Universal Constants Constantes Universelles Universele constanten Universala konstanter 普适常数 Speed of Light in Vacuum Vitesse de la Lumière dans le Vide Lichtsnelheid in vacuüm Ljusets hastighet i vakuum 真空中光速 ar:c,speed_of_light a:c,vitesse_de_la_lumière a:c,licht_snelheid a:c,ljusets_hastighet 299792458*m*s^(-1) Planck Time Temps de Planck Plancktijd Planck-tid 普朗克时间 r:planck_time,ais:t_P planck_tijd,ais:t_P 5.39116E-44*s Planck Temperature Température de Planck Plancktemperatuur Planck-temperatur 普朗克温度 r:planck_temperature,ais:T_P température_de_planck,ais:T_P planck_temperatuur,ais:T_P 1.416808E32*K Planck Mass Masse de Planck Planckmassa Planck-massa 普朗克质量 r:planck_mass,ais:m_P masse_de_planck,ais:m_P planck_massa,ais:m_P 2.176470E-5*g Planck Length Longueur de Planck Plancklengte Planck-längd 普朗克长度 r:planck_length,ais:l_P longueur_de_planck,ais:l_P planck_lengte,ais:l_P 1.616229E-35*m Planck Constant Constantes de Planck Planck constante Plancks konstant 普朗克常数 r:planck,au:ℎ 6.626070040E-34*J*s Planck Constant over 2 pi Constante de Planck sur 2 pi Planck constante gedeeld door 2 pi Plancks konstant över 2 pi 普朗克常数每2π r:planck2pi,au:ℏ planck/(2*pi) Newtonian Constant of Gravitation Constante de la Gravitation de Newton Newtons zwaartekrachtconstante Newtonska gravitationskonstanten 牛顿引力常数 r:newtonian_constant,a:G constante_de_newton,a:G newton_constante,a:G 6.67408E-11*m^3*kg^(-1)*s^(-2) Electric Constant (Permittivity of Free Space) Constante Électrique (Permittivité du Vide) Elektrische constante (permittiviteit vrije ruimte) Elektriska konstanten 介电常数(自由空间介电常数) r:electric_constant,aisu:ε_0 elektrische_constante,aisu:ε_0 1/(4E-7*pi*299792458^2)*F*m^(-1) Magnetic Constant (Permeability of Free Space) Constante Magnétique (Perméabilité du Vide) Magnetische constante (permeabiliteit vrije ruimte) Magnetiska konstanten 磁常数(自由空间磁导率) r:magnetic_constant,aisu:μ_0 magnetische_constante,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 impédance_caractéristique,ais:Z_0 karakteristieke_impedantie,ais:Z_0 4E-7*pi*299792458*ohm Electromagnetic Constants Constantes Électromagnétiques Elektromagnetische constanten Elektromagnetiska konstanter 电磁常数 Bohr Magneton Bohrs magneton 玻尔磁子 r:bohr_magneton,aisu:μ_B magnéton_de_bohr,aisu:μ_B 927.4009994E-26*J*T^(-1) Conductance Quantum Geleidingsvermogen kwantum Konduktanskvantum 量子电导 r:conductance_quantum,ais:G_0 geleidings_kwantum,ais:G_0 7.7480917310E-5*S Elementary Charge Charge Élémentaire Elementaire lading Elementarladdning 基本电荷 r:elementary_charge,ais:e_charge charge_élémentaire,ais:e_charge elementaire_lading,ais:e_lading 1.6021766208E-19*C Josephson Constant Josephson constante Josephsons konstant 约瑟夫森常数 r:josephson,ais:K_J 483597.8525E9*Hz*V^(-1) Magnetic Flux Quantum Magnetische flux kwantum Magnetflödeskonstanten 磁通量量子 r:magnetic_flux_quantum,aisu:Φ_0 magnetische_flux_kwantum,aisu:Φ_0 2.067833831E-15*Wb Nuclear Magneton Nucleaire magneton Kärnmagneton 核磁子 r:nuclear_magneton,aisu:μ_N nucleaire_magneton,aisu:μ_N 5.050783699E-27*J*T^(-1) von Klitzing Constant Constante de von Klitzing von Klitzing constante von Klitzing-konstanten 冯·克里青常数 r:klitzing,ais:R_K 25812.8074555*ohm Atomic and Nuclear Constants Constantes Atomiques et Nucléaires Atomaire- en nucleaire constanten Atomära och nukleära konstanter 原子与核物理常数 Alpha Particle Mass Massa alfadeeltje Alfapartikelmassa α粒子质量 r:alpha_particle_mass,aisu:m_α masse_de_particule_alpha,aisu:m_α alfa_deeltje_massa,aisu:m_α 6.644657230E-24*g Bohr Radius Rayon de Bohr Bohr-straal Bohr-radie 玻尔半径 r:bohr_radius,ais:a_0 0.52917721067E-10*m Classical Electron Radius Klassieke straal elektron Klassisk elektron-radie 经典电子半径 r:classical_electron_radius,ais:r_e klassieke_electron_radius,ais:r_e 2.8179403227E-15*m Compton Wavelength Compton golflengte Compton-våglängd 康普顿波长 r:compton_wavelength,aisu:λ_C compton_golflengte,aisu:λ_C 2.4263102367E-12*m Electron Mass Masse de l'Électron Elektronmassa Elektronmassa 电子质量 r:electron_mass,ais:m_e masse_de_l'électron,ais:m_e elektron_massa,ais:m_e 9.10938356E-28*g Helion Mass Helionmassa Helion-massa Helion质量 r:helion_mass,ais:m_h helion_massa,ais:m_h 5.006412700E-24*g Neutron Mass Masse du Neutron Neutronmassa Neutronmassa 中子质量 r:neutron_mass,ais:m_n masse_du_neutron,ais:m_n neutron_massa,ais:m_n 1.674927471E-24*g Proton Mass Masse du Proton Protonmassa Protonmassa 质子质量 r:proton_mass,ais:m_p masse_du_proton,ais:m_p proton_massa,ais:m_p 1.672621898E-24*g Rydberg Constant Rydberg constante Rydbergs konstant 里德伯常数 r:rydberg,aisu:R_∞ 10973731.568508*m^(-1) Tau Mass Tau massa Tau-massa γ质量 r:tau_mass,aisu:m_τ tau_massa,aisu:m_τ 3.16747E-24*g Physico-Chemical Constants Constantes Physico-Chimiques Fysisch-chemische constanten Fysikalisk-kemiska konstanter 物理化学常数 Atomic Mass Constant Constante de Masse Atomique Atomaire massaconstante Atommassenhet 原子质量常数 r:atomic_mass,ais:m_u masse_atomique,ais:m_u atoommassa,ais:m_u atommassa,ais:m_u 1.660539040E-24*g Avogadro Constant Constante d'Avogadro Avogadro's constante Avogadros konstant 阿佛加德罗常数 r:avogadro,ais:N_A 6.022140857E23*mol^(-1) Boltzmann Constant Constante de Boltzmann Constante van Boltzmann Boltzmanns konstant 玻耳兹曼常数 r:boltzmann,ais:k_B 1.38064852E-23*J*K^(-1) Faraday Constant Constante de Faraday Faraday constante Faradays konstant 法拉第常数 r:faraday 96485.33289*C*mol^(-1) First Radiation Constant Eerste stralingsconstante Första strålningskonstanten 第一辐射常数 r:first_radiation,ais:c_1 eerste_straling,ais:c_1 3.741771790E-16*W*m^2 Ideal Gas Constant Constante des Gaz Parfaits Ideale gasconstante Gaskonstant 理想气体常数 r:ideal_gas ideale_gas 8.3144598*J*K^(-1)*mol^(-1) Second Radiation Constant Tweede stralingsconstante Andra strålningskonstanten 第二辐射常数 r:second_radiation,ais:c_2 tweede_straling,aisc_2 1.43877736E-2*m*K Basic Constants Constantes Basiques Basisconstanten Grundläggande konstanter 基本常数 Golden Ratio Le Nombre d'Or Gulden snede Golden ratio 黄金比例 r:golden,au:φ gouden,φ (1+sqrt(5))/2 Omega Constant Omega constante Omegakonstanten Ω常数 r:omega lambertw(1) Pythagoras' Constant (sqrt 2) Constante de Pythagore (sqrt 2) Pythagoras constante (sqrt 2) Pythagoras konstant (sqrt 2) 毕达哥拉斯常数(根号2) r:pythagoras pythagore sqrt(2) Apery's Constant Apery's constante Aperys konstant Apery常数 r:apery zeta(3) Base of Natural Logarithms (e) La Base des Logarithmes Naturels (e) Grondtal natuurlijke logaritmen (e) Basen för naturliga logaritmer (e) 自然对数的底e r:e Archimedes' Constant (pi) Archimede's constante (pi) Archimedes konstant (pi) 圆周率(π) au:π,r:pi Euler's Constant Constante d'Euler Euler's constante Eulers konstant 欧拉常数 au:γ,r:euler Catalan's Constant Catalan's constante Catalans konstant Catalan常数 r:catalan Special Numbers Bijzondere getallen Speciella nummer 特殊数字 Imaginary i (sqrt -1) Nombre Imaginaire i (tel que i^2 = -1) Imaginaire i (sqrt -1) Imaginärt i (sqrt -1) 虚数i(sqrt -1) r:i . Infinity Infini Oneindig Oändlighet 无穷 a:∞,r:infinity a:∞,infini a:∞,oneindig a:∞,r:oändlighet Positive Infinity Infini Positif Positief oneindig Positiv oändlighet 正无穷 r:plus_infinity infini_positif plus_oneindig plus_oändlighet Negative Infinity Infini Négatif Negatief oneindig Negativ oändlighet 负无穷 r:minus_infinity infini_négatif min_oneindig minus_oändlighet Undefined Indéfini Ongedefinieerd Odefinierad 未定义的 r:undefined indéfini ongedefinieerd odefinierad False Faux Onwaar Falskt r:false,r:no faux,non onwaar,nee falskt,nej 0 True Vrai Waar Sant r:true,r:yes vrai,oui waar,ja sant,ja 1 Unknowns Inconnues Onbekenden Okända 未知数 r:x r:y r:z libqalculate-0.9.10/data/datasets.xml.in0000644000175000017500000001260312715132301015031 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 Polyatomic Non-Metal 9 Diatomic Non-Metal 10 Noble Gas 11 Unknown chemical properties number <_names>r:class <_title>Weight number true AMU 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>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.10/data/planets.xml0000644000175000017500000001013512727775144014305 00000000000000 Earth Terre Aarde Jorden 地球 365.25696 29.7859 0.01671022 0.00005 1 5.9737E24 5.515 510.0657E6 9.766 287 Mars 火星 686.9601 24.1309 0.09341233 1.85061 2 6.4191E23 3.94 1.44E8 3.71 210 !planets!Mercury Mercure Mercurius Merkurius 水星 87.96935 47.8725 0.20563069 7.00487 0 3.302E23 5.43 7.5E7 3.70 440 Venus Vénus 金星 224.70096 35.0214 0.00677323 3.39471 0 4.869E24 5.24 4.60E8 8.87 737 Jupiter 木星 4335.3545 13.0697 0.04839266 1.30530 63 1.899E27 1.33 6.41E10 23.12 152 Saturn Saturne 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 Pluton 冥王星 90613.3058 4.7490 0.24880766 17.14175 1 1.290E22 2.05 1.7E7 0.6 44 Uranus 天王星 30708.1600 6.8352 0.04716771 0.76986 27 8.686E25 1.29 8.13E9 8.69 68 libqalculate-0.9.10/data/units.xml0000644000175000017500000037772512744163105014011 00000000000000 !units!Length Longueur Lengte Längd 长度 SI Meter Mètre ar:m,meter,p:meters,metre,p:metres a:m,meter,p:meters a:m,meter Kilometer Kilomètre 千米 r:km_c m 3 1 Decimeter Décimètre 分米 r:dm_c m -1 1 Centimeter Centimètre Centimeter 厘米 r:cm_c m -2 1 Millimeter Millimètre Milimeter 毫米 r:mm_c m -3 1 Nautical Mile Nautische mijl Sjömil 海里 r:nautical_mile,p:nautical_miles nautische_mijl,p:nautische_mijlen sjömil m 1852 1 Ångström Ångström aru:Å,u:ångström,angstrom true m 1E-10 1 U.S. Survey Inch ar:US_in,US_inch,p:US_inches m 100/3937 1 Inch Pouce Tum 英寸 ar:in,inch,p:inches tum,a:in,inch m 0.0254 1 Hand r:hand,p:hands in 4 1 Foot Pied Voet Engelsk Fot 英尺 ar:ft,foot,p:feet hand 3 1 U.S. Survey Foot ar:US_ft,US_foot,p:US_feet US_in 12 1 Link Länk ar:li,link,p:links ft 66/100 1 Yard ar:yd,yard,p:yards ft 3 1 Rod (pole/perch) ar:rd,rod,p:rods US_ft 16.5 1 Fathom Vadem Famn 英寻 r:fathom,p:fathoms vadem,p:vadems yd 2 1 Chain ar:ch,chain,p:chains li 100 1 Furlong 弗隆 ar:fur,furlong,p:furlongs yd 220 1 Mile Mile Mijl 英里 ar:mi,mile,p:miles a:mi,mijl,p:mijlen ch 80 1 U.S. Survey Mile ar:US_mi,US_mile,p:US_miles US_ft 5280 1 Mil (1/1000 in) 毫英寸(1/1000英寸) r:mil,p:mils in 0.001 1 Astronomical Unit Unité Astronomique Astronomische eenheid Astronomisk enhet 天文单位 ar:AU,astronomical_unit,p:astronomical_units unité_astronomique,p:unités_astronomiques a:AU,astronomische_eenheid,p:astronomische_eenheden a:AU,astronomisk_enhet,p:astronomiska_enheter m 149578706600 1 Light Year Année Lumière Lichtjaar Ljusår 光年 ar:ly,lightyear,p:lightyears a:lj,lichtjaar,p:lichtjaren a:ly,ljusår m 9460730472580800 1 Parsec 秒差距 ar:pc,parsec,p:parsecs a:pc,parsek,p:parseks true AU 648000/pi 1 Pied du roi (French Royal Foot) Pied du roi (Franse koninklijke voet) r:pied_du_roi m 9000/27706 1 Pouce (French Royal Inch) Pouce (Franse koninklijke duim) r:pouce pied_du_roi 1/12 1 Ligne Ligne (1/40 inch) r:ligne pouce 1/12 1 Toise r:toise pied_du_roi 6 1 !units!Angle Angle Hoek Vinkel 角度 Plane Angle Angle Plan Vlakke hoek Planvinkel 平面角 true Meter per Meter Mètre par Mètre 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 a:rad,radiaal,p:radialen m_p_m 1 1 Degree Degré Graad Grad ar:deg,au:°,degree,p:degrees a:grd,au:°,graad,p:graden a:deg,au:°,grad,p:grader rad pi/180 1 Gradian (Gon) Grad (Gon) Gradient (Gon) ar:gra,gradian,p:gradians,gon,p:gons a:gra,grad,p:grads,gon,p:gons rad pi/200 1 Arcminute Boogminuut 弧分 r:arcminute,p:arcminutes boogminuut,p:boogminuten deg 1/60 1 Arcsecond Boogseconde 弧秒 r:arcsecond,p:arcseconds boogseconde,p:boogseconden arcminute 1/60 1 Turn Slag r:turn,p:turns slag,p:slagen r:turn,p:turns deg 360 1 Solid Angle Angle Solide Ruimtehoek Rymdvinkel 立体角 true Square Meter per Square Meter Mètre Carré par Mètre Carré 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 a:sr,steradiaal,p:steradialen m_p_m 1 1 Angular Acceleration Accélération Angulaire Hoekversnelling Vinkelacceleration 角加速度 SI Radians per Second Squared Radians par Seconde Carrée 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 Radians par Seconde Radialen per seconde Radianter per sekund 弧度每秒 r:rad_p_s rad 0 1 s 0 -1 !units!Mass Masse Massa Massa 质量 SI Gram Gramme ar:g,gram,p:grams a:g,gram,p:grammen a:g,gram Kilogram Kilogramme 千克 r:kg_c g 3 1 Hectogram Hectogramme Hektogram r:hg_c g 2 1 Metric Ton (Tonne) Tonne Métrique (Tonne) Metrische ton (Ton) Ton 公吨 ar:t,tonne,p:tonnes,ton,p:tons a:t,ton,p:tonnen a:t,ton true g 1000000 1 Grain 格令 ar:gr,grain,p:grains g 0.06479891 1 Pennyweight 本尼威特 ar:pwt,pennyweight,p:pennyweights gr 24 1 Ounce (troy) 金衡制盎司 ar:oz_t,troy_ounce,p:troy_ounces pwt 20 1 Pound (troy) Pund (troy) 金衡制磅 ar:lb_t,troy_pound,p:troy_pounds oz_t 12 1 Dram 英钱 ar:dr,dram,p:drams g 1.7718451953125 1 Ounce 盎司 ar:oz,ounce,p:ounces dr 16 1 Pound Pund ar:lb,pound,p:pounds oz 16 1 Short Hundredweight Short hundredweight 短英担 ar:cwt,hundredweight,p:hundredweights lb 100 1 Long Hundredweight Long hundredweight 长担 ar:l_cwt,long_hundredweight,p:long_hundredweights lb 112 1 Short Ton Short ton 短吨 ar:s_ton,short_ton,p:short_tons lb 2000 1 Long Ton Long ton 长吨 ar:l_ton,long_ton,p:long_tons lb 2240 1 Stone r:stone,p:stones lb 14 1 Cental 百磅 r:cental,p:centals lb 100 1 Carat Karaat Karat 克拉 r:carat,p:carats karaat karat g 0.2 1 Pfund Pond r:pfund g 500 1 Zentner r:zentner r:zentner pfund 100 1 Density Densité Dichtheid Densitet 密度 SI Kilogram per Cubic Meter Kilogramme par Mètre Cube Kilogram per kubieke meter Kilogram per kubikmeter 千克每立方米 r:kg_p_cum g 3 1 m 0 -3 Gram per Cubic Decimeter Gramme par Décimètre Cube Gram per kubieke decimeter Gram per kubikdecimeter 克每立方分米 r:g_p_cudm g 0 1 m -1 -3 Gram per Cubic Centimeter Gramme par Centimètre Cube Gram per kubieke centimeter Gram per kubikcentimeter 克每立方厘米 r:g_p_cucm g 0 1 m -2 -3 Atomic Mass Masse Atomique Atommassa Gram per Mole Gramme par Mole Gram per mol Gram per mol 克每摩尔 r:g_p_mol g 0 1 mol 0 -1 Atomic Mass Unit Unité de Masse Atomique Atomaire massa-eenheid Atommassenhet 原子质量单位 ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units AMU,atomaire_massa_eenheid,atomaire_massa_eenheden a:u,a:AMU,atommassenhet,p:atommassenheter g_p_mol 1 1 Dalton ar:Da,dalton,p:daltons true g_p_mol 1 1 Kilodalton Kilodalton r:kDa_c Da 3 1 Mass Fraction Massafractie Massbråk 质量分数 SI Kilogram per Kilogram Kilogramme par Kilogramme Kilogram per kilogram Kilogram per kilogram 千克每千克 r:kg_p_kg g 3 1 g 3 -1 Time Temps Tijd Tid 时间 SI Second Seconde Seconde Sekund ar:s,second,p:seconds a:s,seconde,p:seconden a:s,sekund,p:sekunder Minute Minuut Minut ar:min,minute,p:minutes a:min,minuut,p:minuten a:min,minut,p:minuter s 60 1 Hour Heure Uur Timme 小时 ar:h,hour,p:hours a:h,uur,p:uren a:h,timme,p:timmar min 60 1 Day Jour Dag Dag ar:d,day,p:days jour,p:jours a:d,dag,p:dagen a:d,dag,p:dagar h 24 1 Week Semaine Vecka r:week,p:weeks week,p:weken vecka,p:veckor day 7 1 Fortnight 两星期 r:fortnight,p:fortnights week 2 1 Julian Year Juliaans jaar Julianskt år 儒略年 r:year,p:years jaar,p:jaren år d 365.25 1 !units!Frequency Fréquence Frequentie Frekvens 频率 SI Hertz 赫兹 ar:Hz,hertz s 1 -1 Electricity Électricité Elektriciteit Elektricitet 电学 Electric Current Courant Électrique Elektrische stroom Elektrisk ström 电流 SI Ampere Ampère Ampere 安培 ar:A,ampere,p:amperes ampère,p:ampères a:A,ampere CGS Abampere Abampere 绝对安培 r:abampere,a:abA,a:aA,p:abamperes A 10 1 Current Density Densité de Courant Stroomdichtheid Strömtäthet 电流密度 SI Ampere per Meter Squared Ampère par mètre Carré Ampere per meter kwadraat Ampere per kvadratmeter 安培每平方米 r:A_p_sqm A 0 1 m 0 -2 Electric Charge Charge Électrique Elektrische lading Elektrisk laddning 电荷 Second Ampere Ampère Seconde Seconde ampere Sekundampere 秒安培 r:s_A s 0 1 A 0 1 SI Coulomb Coulomb 库仑 ar:C,coulomb,p:coulombs a:C,coulomb s_A 1 1 CGS Abcoulomb Abcoulomb 绝对库伦 r:abcoulomb,p:abcoulombs,a:abC,a:aC C 10 1 CGS Statcoloumb (Franklin) r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins C 3.3356410E-10 1 Electric Charge Density Densité de Charge Électrique Elektrische ladingsdichtheid Laddningstäthet 电荷密度 SI Coulomb per Cubic Meter Coulomb par Mètre Cube 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 par Mètre Carré Coulomb per vierkante meter Coulomb per kvadratmeter 库仑每平米 r:C_p_sqm C 0 1 m 0 -2 Electric Potential Potentiel Électrique Elektrische potentiaal Elektrisk potential 电势 Watt per Ampere Watt par Ampère Watt per ampere Watt per ampere 瓦每安培 r:W_p_A W 0 1 A 0 -1 SI Volt 伏特 ar:V,volt,p:volts a:V,volt W_p_A 1 1 CGS Statvolt 静伏特 r:statvolt,p:statvolts,a:statV V 299.792458 1 CGS Abvolt Abvolt 绝对伏特 r:abvolt,p:abvolts,a:abV V 1E-8 1 Capacitance Capaciteit Kapasitans 电容 Coulomb per Volt Coulomb par Volt Coulomb per volt Coloumb per volt 库仑每伏特 r:C_p_V C 0 1 V 0 -1 SI Farad 法拉 ar:F,farad,p:farads a:F,farad C_p_V 1 1 Electric Resistance Résistance Électrique Elektrische weerstand Resistans 电阻 SI Volt per Ampere Volt par Ampère Volt per ampere Volt per ampere 伏特每安培 r:V_p_A V 0 1 A 0 -1 SI Ohm 欧姆 au:Ω,r:ohm,p:ohms au:Ω,ohm au:Ω,ohm V_p_A 1 1 CGS Abohm Abohm 绝对单位欧姆 r:abohm,p:abohms,au:abΩ ohm 1E-9 1 CGS Statohm 静欧姆 r:statohm,p:statohms,au:statΩ ohm 8.9875517874E11 1 Electric Conductance Conductance Électrique Elektrisch geleidingsvermogen Induktion 电导 Ampere per Volt Ampère par Volt Ampere per volt Ampere per volt 安培每伏特 r:A_p_V A 0 1 V 0 -1 SI Siemens ar:S,siemens A_p_V 1 1 Electric Field Strength Elektrische veldsterkte Elektrisk fältstyrka 电场强度 SI Volt per Meter Volt par Mètre Volt per meter Volt per meter 伏特每米 r:V_p_m V 0 1 m 0 -1 Permittivity Permittivité Permittiviteit Permitivitet 电容率 SI Farad per Meter Farad par mètre 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 亨利 ar:H,henry,p:henrys a:H,henry Wb_p_A 1 1 Permeability Permeabiliteit Permeabilitet 磁导率 SI Henry per Meter Henry par Mètre Henry per meter Henry per meter 亨利每米 r:H_p_m H 0 1 m 0 -1 Temperature Température Temperatuur Temperatur 温度 SI Kelvin Kelvin 开尔文 ar:K,kelvin,p:kelvins a:K,kelvin SI Degree Celsius Degré Celsius Graden Celsius Grader Celsius 摄氏度 ar:oC,au:°C,au:℃,r:celsius,p:celsius,centigrade,p:centigrades ar:oC,au:°C,au:℃,r:celsius false Degree Rankine Degrés Rankine Graden Rankine Grader Rankine 华氏度 ar:oR,au:°R,r:rankine K 5/9 1 Degree Fahrenheit Degrés Fahrenheit Graden Fahrenheit Grader Fahrenheit 华氏度 ar:oF,au:°F,au:℉,r:fahrenheit Substance Stofhoeveelheid Substans 物质 SI Mole Mole Mol Mol 摩尔 ar:mol,mole,p:moles a:mol,mol,p:molen mol Einstein 爱因斯坦 r:einstein,p:einsteins einstein Substance Concentration Concentratie van stof Substanskoncentration 物质浓度 SI Mole per Cubic Meter Mole par Mètre Cube Mol per kubieke meter Mol per kubikmeter 摩尔每平米 r:mol_p_cum mol 0 1 m 0 -3 Catalytic Activity Activité Catalytique Katalitische activiteit Katalytisk aktivitet 催化活性 Reciprocal Seconds Mole Omgekeerde seconden mol Reciproka sekundmol r:recs_mol mol 0 1 s 0 -1 SI Katal 卡塔尔 ar:kat,katal,p:katals a:kat,katal recs_mol 1 1 Catalytic Concentration Concentration Catalytique 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 Lumière Licht Ljus 光学 Luminous Intensity Intensité Lumineuse Lichtsterkte Luminansintensitet 发光强度 SI Candela Candela ar:cd,candela,p:candelas a:cd,candela Luminance Luminantie Luminans 亮度 SI Candela per Meter Squared Candela par mètre carré Candela per vierkante meter Candela per kvadratmeter r:cd_p_sqm cd 0 1 m 0 -2 CGS Stilb 熙提 ar:sb,stilb,p:stilbs cd_p_sqm 10000 1 Luminous Flux Flux Lumineux Lichtstroom Luminansflöde 光通量 Candela Steradian Candela-steradiaal Candelasteradian r:cd_sr cd 0 1 sr 0 1 SI Lumen 流明 ar:lm,lumen,p:lumens a:lm,lumen a:lm,lumen 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 勒克斯 ar:lx,lux lm_p_sqm 1 1 Foot-Candle ar:fc,footcandle,p:footcandles lm_p_sqft 1 1 CGS Phot 幅透 ar:ph,phot,p:phots lx 10000 1 Radiant Intensity Stralingsintensiteit Strålningsstyrka 辐射强度 Watt per Steradian Watt par Stéradian 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 par Mètre Carré Watt per meter kwadraat Watt per kvadratmeter 瓦每平米 r:W_p_sqm W 0 1 m 0 -2 Einstein per Meter Squared per Second Einstein par Mètre Carré par Seconde 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 Microeinstein par Mètre Carré par Seconde 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 par Mètre Carré Stéradian Watt per vierkante meter per steradiaal Watt per steradiankvadratmeter 瓦每平米球面度 r:W_p_sqm_sr W 0 1 sr 0 -1 m 0 -2 Area Aire Oppervlak 面积 SI Square Meter Mètre Carré Vierkante meter Kvadratmeter 平方米 r:sqm m 0 2 Square Kilometer Kilomètre Carré Vierkante kilometer Kvadratkilometer 平方千米 r:sqkm m 3 2 Are ar:a,are,p:ares m 100 2 Hectare Hektar 公顷 r:ha a 2 1 Barn ar:b,barn,p:barns m 1E-28 2 Rood r:rood,p:roods yd 1210 2 Acre 英亩 r:acre,p:acres ch 10 2 Section Sectie r:section,p:sections sectie,p:secties mi 1 2 Township r:township,p:townships section 36 1 Square Foot Pied Carré Vierkante voet Kvadratfot 平方英尺 r:sqft ft 0 2 Square Inch Pouce Carré Vierkante inch Kvadrattum 平方英寸 r:sqin in 0 2 Square Mile Mile Carrée Vierkante mijl Kvadratmile 平方英里 r:sqmi mi 0 2 Volume Volym 体积 SI Cubic Meter Mètre Cube Kubieke meter Kubikmeter 立方米 r:cum m 0 3 Liter Litre ar:L,a:l,liter,p:liters,litre,p:litres litre,p:litres a:L,a:l,liter,p:liters a:L,a:l,liter m 0.001 3 Milliliter Millilitre Mililiter 毫升 r:ml_c l -3 1 Centiliter Centilitre Centiliter 厘升 r:cl_c l -2 1 Deciliter Décilitre 分升 r:dl_c l -1 1 Cubic Inch Pouce Cube Kubieke inch Kubiktum 立方英寸 r:cuin in 0 3 Fuel Economy Brandstofgebruik Bränsleförbrukning 燃料经济 Liter per Kilometer Litre par Kilomètre Liter per kilometer Liter per kilometer 升每千米 r:l_p_km l 0 1 m 3 -1 Kilometer per Liter Kilomètre par Litre Kilometer per liter Kilometer per liter 千米每升 r:km_p_l m 3 1 l 0 -1 true Miles per Gallon Miles par Gallon 英里每加仑 r:mile_p_gal mi 0 1 gal 0 -1 Miles per Gallon Miles par Gallon 英里每加仑 a-cr:mpg a-cr:mpg mile_p_gal 1 1 Cooking Cuisine Koken Matlagning 烹饪 Teaspoon Theelepel Tesked 茶匙 r:teaspoon,p:teaspoons theelepel,p:theelepels tesked,p:teskedar L 0.005 1 Dessertspoon Cuillère à Dessert Dessertlepel Dessertsked 点心匙 r:dessertspoon,p:dessertspoons dessertlepel,p:dessertlepels dessertsked,p:dessertskedar teaspoon 2 1 Tablespoon Eetlepel Matsked 汤匙 r:tablespoon,p:tablespoons eetlepel,p:eetlepels matsked,p:matskedar teaspoon 3 1 Cup Tasse Kop r:cup,p:cups kop,p:koppen kopp,p:koppar L 0.250 1 Imperial Capacity Imperial Fluid Ounce ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces L 0.0284130625 1 Imperial Gill ar:UK_gi,imperial_gill,p:imperial_gills UK_fl_oz 5 1 Imperial Pint ar:UK_pt,imperial_pint,p:imperial_pints UK_gi 4 1 Imperial Quart ar:UK_qt,imperial_quart,p:imperial_quarts UK_pt 2 1 Imperial Gallon ar:UK_gal,imperial_gallon,p:imperial_gallons UK_qt 4 1 Imperial Minim r:imperial_minim,p:imperial_minims UK_fl_oz 1/480 1 Imperial Fluid Scuple r:imperial_fluid_scuple,p:imperial_fluid_scuples imperial_minim 20 1 Imperial Fluid Drachm ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms imperial_fluid_scuple 3 1 Imperial Bushel ar:UK_bu,imperial_bushel,p:imperial_bushels UK_gal 8 1 U.S. Capacity U.S. Fluid Ounce ar:fl_oz,fluid_ounce,p:fluid_ounces in 231/128 3 U.S. Gill ar:gi,gill,p:gills fl_oz 4 1 U.S. Liquid Pints ar:liq_pt,liquid_pint,p:liquid_pints gi 4 1 U.S. Liquid Quarts ar:liq_qt,liquid_quart,p:liquid_quarts liq_pt 2 1 U.S. Minim r:minim,p:minims fl_oz 1/480 1 U.S. Fluid Drachm ar:fl_dr,fluid_drachm,p:fluid_drachms minim 60 1 U.S. Dry Pint ar:dry_pt,dry_pint,p:dry_pints in 33.6003125 3 U.S. Dry Quart ar:dry_qt,dry_quart,p:dry_quarts dry_pt 2 1 U.S. Peck ar:pk,peck,p:pecks dry_qt 8 1 U.S. Bushel ar:bu,bushel,p:bushels pk 4 1 U.S. Gallon ar:gal,gallon,p:gallons liq_qt 4 1 U.S. Barrel (oil) ar:bbl,barrel,p:barrels gal 42 1 Specific Volume Soortelijk volume Specifik volym SI Cubic Meter per Kilogram Mètre Cube par Kilogramme Kubieke meter per kilogram Kubikmeter per kilogram 立方米每公斤 r:cum_p_kg m 0 3 g 3 -1 Speed Vitesse Snelheid Hastighet 速度 SI Meter per Second Mètre par Seconde Meter per seconde Meter per sekund 米每秒 r:m_p_s m 0 1 s 0 -1 Kilometer per Hour Kilomètre par Heure 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 Noeud Knoop Knop r:knot,p:knots knoop,p:knopen knop nautical_mile_p_h 1 1 true Miles per Hour Miles par Heure Miles per Hour 英里每小时 r:mile_p_h mi 0 1 h 0 -1 Miles per Hour Miles par Heure Miles per Hour 英里每小时 a-cr:mph mile_p_h 1 1 Acceleration Accélération Versnelling Acceleration 加速度 SI Meter per Second Squared Mètre par Seconde Carrée Meter per seconde kwadraat Meter per kvadratsekund 米每平方秒 r:m_p_sqs m 0 1 s 0 -2 Galileo 伽利略 ar:Gal,galileo,p:galileos a:Gal,galileo m_p_sqs 1/100 1 Gee r:gee,p:gees m_p_sqs 9.80665 1 Magnetism Magnétisme 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 Ampère par mètre Ampere per meter Ampere per meter 安培每米 r:A_p_m A 0 1 m 0 -1 CGS Oersted 奥斯特 ar:Oe,oersted,p:oersteds Oe,oersted,oersteds a:Oe,oersted A_p_m 1000/(4*pi) 1 Magnetic Flux Flux Magnétique Magnetische flux Magnetiskt flöde 磁通量 Volt Seconds Volt Seconde Volt seconden Voltsekund 伏特秒 r:V_s V 0 1 s 0 1 SI Weber 韦伯 ar:Wb,weber,p:webers a:Wb,weber V_s 1 1 CGS Maxwell 麦克斯韦 ar:Mx,maxwell,p:maxwells a:Mx,maxwell Wb 1E-8 1 Magnetic Flux Density Densité de Flux Magnétique 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 特斯拉 ar:T,tesla,p:teslas a:T,tesla Wb_p_sqm 1 1 CGS Gauss 高斯 r:gauss T 0.0001 1 Force Kracht Kraft 力学 Meter Kilogram per Second Squared Mètre Kilogramme par Seconde Carrée Meter kilogram per seconde kwadraat Meterkilogram per kvadratsekund 米千克每平方秒 r:m_kg_p_sqs m 0 1 g 3 1 s 0 -2 SI Newton 牛顿 ar:N,newton,p:newtons a:N,newton m_kg_p_sqs 1 1 CGS Dyne 达因 ar:dyn,dyne,p:dynes N 1E-5 1 Imperial 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 磅达 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,p:ponden,a:gf true N 0.00980665 1 Kilopond (Kilogram-Force) Kilopond (Kilogram-kracht) 千克力 r:kpond_c pond 3 1 Moment of Force Moment de Force Krachtmoment Kraftmoment 力矩 SI Newton Meter Newton Mètre Newtonmeter Newtonmeter 牛顿米 r:N_m N 0 1 m 0 1 Pressure Pression Druk Tryck 压强 Newton per Meter Squared Newton par Mètre Carré 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 帕斯卡 ar:Pa,pascal,p:pascals a:Pa,pascal 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 lbf_p_sqin 1 1 Bar Bar r:bar,p:bars bar true Pa 100000 1 Atmosphere Atmosphère Atmosfeer Atmosfär 大气压 ar:atm,atmosphere,p:atmospheres atmosphère,p:atmosphères a:atm,atmosfeer a:atm,atmosfär,p:atmosfärer Pa 101325 1 Torr r:torr,p:torrs atm 1/760 1 Millimeter of Mercury Millimètre de Mercure Milimeter kwik Millimeter kvicksilver 毫米汞柱 ar:mmHg atm 1/760 1 Inch of Mercury Inches kwik Fot kvicksilver 英寸汞柱 ar:inHg mmHg 25.4 1 Dynamic Viscosity Viscosité Dynamique Dynamische viscositeit Dynamisk viskositet 动态粘度 SI Pascal Second Pascal Seconde Pascal seconde Pascalsekund 帕斯卡秒 r:Pa_s Pa 0 1 s 0 1 CGS Poise ar:P,poise,p:poises a:P,poise Pa_s 0.1 1 Kinematic Viscosity Kinematische viscositeit Kinematisk viskositet 运动粘度 Square Meter per Second Mètre Carré par Seconde Vierkante meter per seconde Kvadratmeter per sekund 平方米每秒 r:sqm_p_s m 0 2 s 0 -1 CGS Stokes ar:St,stokes sqm_p_s 0.0001 1 Surface Tension Oppervlaktespanning Ytspänning 表面张力 SI Newton per Meter Newton par Mètre Newton per meter Newton per meter 牛顿每米 r:N_p_m N 0 1 m 0 -1 Energy Énergie Energie Energi 能量 SI Joule 焦耳 ar:J,joule,p:joules a:J,joule N_m 1 1 Watt Hour Watt Heure Wattuur Watttimme 瓦小时 r:W_h W 0 1 h 0 1 Kilowatt Hour Kilowatt Heure 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 ais:cal_IT,a:cal,c:calorie,cp:calorieën ais:cal_IT,a:cal,c:kalori,cp:kalorier J 4.1868 1 Calorie (capital C) Calorie (hoofdletter C) Kalorier (med stort K) cr:Calorie,cp:Calories c:Calorie,cp:Calorieën cal 1000 1 Calorie (thermochemical) Calorie (thermochemisch) Kalorier (termokemiska) ars:cal_th as:cal_th J 4.184 1 Gram of TNT Gram TNT Gram TNT 克TNT当量 a-cr:gTNT,gramTNT cal_th 1000 1 Ton of TNT Ton TNT Ton TNT 吨TNT当量 a-cr:tTNT,tonTNT gTNT 1000000 1 Calorie (15 degrees Celsius) Calorie (15°C) Calorie (15 graden Celcius) Kalorier (15 grader Celsius) Calorie(15摄氏度) ars:cal_fifteen as:cal_fifteen as:cal_femton J 4.185880 1 Calorie (mean) Calorie (moyenne) Calorie (gemiddeld) Kalorier (medel) ars:cal_mean as:cal_gemiddeld as:cal_medel J 4.19002 1 British Thermal Unit (IT) 英制热量单位(IT) ar:Btu J 1055.056 1 Electron Volt Électron Volt Elektronvolt Elektronvolt 电子伏特 ar:eV,electron_volt,p:electron_volts a:eV,elektronvolt J 1.602176620770032661E-19 1 CGS Erg r:erg,p:ergs J 1E-7 1 Foe r:foe,p:foes erg 1E51 1 Imperial Foot-Pound Force r:ft_lbf ft 0 1 lbf 0 1 Hartree ar:Ha,as:E_h,hartree J 4.359744650E-18 1 Rydberg Rydberg ar:Ry,s:rydberg_unit ar:Ry,s:rydberg_enhet Ha 0.5 1 Specific Energy Soortelijke energie Specifik energi SI Joule per Kilogram Joule par Kilogramme Joule per kilogram Joule per kilogram 焦耳每千克 r:J_p_kg J 0 1 g 3 -1 Power Puissance Vermogen Effekt 功率 Joule per Second Joule par Seconde 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 J_p_s 1 1 Horse Power Paardekracht (Engels) Hästkraft ar:hp,horsepower,p:horsepowers a:hp,hästkraft,p:hästkrafter W 745.699987158227022 1 Pferdestärke Paardekracht (metrisch) ar:PS,u:pferdestärke pk,paardekracht,paardekrachten W 735.49875 1 Entropy Entropie Entropie Entropi SI Joule per Kelvin Joule par 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 par Kilogramme 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 Conductivité Thermique Thermisch geleidingsvermogen Termisk konduktivitet 导热系数 SI Watt per Meter Kelvin Watt par Mètre 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 Densité d'Énergie Energiedichtheid Energitäthet 能量密度 SI Joule per Cubic Meter Joule par Mètre Cube Joule per kubieke meter Joule per kubikmeter 焦耳每立方米 r:J_p_cum J 0 1 m 0 -3 Molar Energy Énergie Molaire Molaire energie Molarenergi SI Joule per Mole Joule par Mole Joule per mol Joule per mol 焦耳每摩尔 r:J_p_mol J 0 1 mol 0 -1 Molar Entropy Entropie Molaire Molaire entropy Molarentropi 摩尔熵 SI Joule per Mole Kelvin Joule par 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 Radioactivité Radioactiviteit Radioaktivitet 放射性 SI Becquerel Becquerel 贝可 ar:Bq,becquerel,p:becquerels a:Bq,becquerel s 1 -1 Curie 居里 ar:Ci,curie,p:curies a:Ci,curie Bq 3.7E10 1 Absorbed Dose Dose Absorbée Absorptiedosis Absorberad dos 吸收剂量 SI Gray 戈瑞 ar:Gy,gray,p:grays a:Gy,gray J_p_kg 1 1 Rad Rad r:rad_radioactivity rad_radioaktivitet Gy 1/100 1 Dose Equivalent Dosisequivalent Dosekvivalent 剂量当量 SI Sievert ar:Sv,sievert,p:sieverts a:Sv,sievert J_p_kg 1 1 Rem 人体伦琴当量 r:rem_radioactivity rem_radioaktivitet Sv 1/100 1 Exposure Belichting Exponering 照射量 SI Coulomb per Kilogram Coulomb par Kilogramme Coulomb per kilogram Coloumb per kilogram 库仑每千克 r:C_p_kg C 0 1 g 3 -1 Roentgen Röntgen 伦琴 ar:R,roentgen,p:roentgens a:R,roentgen C_p_kg 0.000258 1 Absorbed Dose Rate Absorptiesnelheid Absorberad dosrat 剂量吸收率 SI Gray per Second Gray par Seconde Gray per seconde Gray per sekund 戈瑞每秒 r:Gy_p_s Gy 0 1 s 0 -1 Ratio Verhouding 比值 Neper 奈培 ar:Np,neper,p:nepers a:Np,neper Bel ar:B,bel,p:bels a:B,bel Np 0.5*ln(10) 1 Decibel Décibel 分贝 r:dB_c B -1 1 Information Informatie 信息 Bit Bit 比特 r:bit,p:bits bit,p:bitar true Byte (8-bit) Octet (8 bits) Byte (8-bit) 字节(8比特) r:byte,p:bytes,octet,p:octets byte,oktet true bit 8 1 Nibble Nibble 半字节 r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets bit 4 1 Tribble r:tribble,p:tribbles nibble 3 1 Word (16-bit) Mot (16 bits) 字(16比特) r:word,p:words woord,p:woorden bit 16 1 Kilobyte Kiloctet 千字节 r:kbyte_c byte 3 1 Kibibyte Kibioctet r:Kibyte_c byte 10 1 Mebibyte Mébioctet r:Mibyte_c byte 20 1 Gibibyte Gibioctet r:Gibyte_c byte 30 1 Megabyte Mégaoctet 兆字节 r:Mbyte_c byte 6 1 Gigabyte Gigaoctet 千兆比特 r:Gbyte_c byte 9 1 Terabyte Téraoctet 万亿字节 r:Tbyte_c byte 12 1 Kilobit 千比特 r:kbit_c bit 3 1 Kibibit r:Kibit_c bit 10 1 Mebibit Mébibit r:Mibit_c bit 20 1 Gibibit r:Gibit_c bit 30 1 Megabit Mégabit 兆比特 r:Mbit_c bit 6 1 Gigabit 千兆比特 r:Gbit_c bit 9 1 Terabit Térabit 万亿比特 r:Tbit_c bit 12 1 Typography Typografie Typografi 印刷 PostScript Point PostScipt-punkt ar:pt,a:pts,point,p:points punkt,point,p:punkter,p:points in 1/72 1 PostScript Pica PostScript-pica r:pica,p:picas pt 12 1 ATA Pica ATA-pica r:ata_pica,p:ata_picas in 0.166 1 ATA Point ATA-punkt r:ata_point,a:ata_pt,p:ata_points ata_pica 1/12 1 New Didot Point Nieuwe Didot Point Ny Didotpunkt r:new_didot nieuwe_didot m 0.000375 1 Didot Point Didotpunkt r:didot,a:dd pouce 1/72 1 Cicero r:cicero didot 12 1 libqalculate-0.9.10/data/variables.xml.in0000644000175000017500000003377612725602660015222 00000000000000 <_title>Small Numbers <_title>Per Mille <_names>r:permille,au:‰ 1/1000 <_title>Per Myriad <_names>r:permyriad,au:‱ 1/10000 <_title>Percent <_names>a:%,r:percent 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.39116E-44*s <_title>Planck Temperature <_names>r:planck_temperature,ais:T_P 1.416808E32*K <_title>Planck Mass <_names>r:planck_mass,ais:m_P 2.176470E-5*g <_title>Planck Length <_names>r:planck_length,ais:l_P 1.616229E-35*m <_title>Planck Constant <_names>r:planck,au:ℎ 6.626070040E-34*J*s <_title>Planck Constant over 2 pi <_names>r:planck2pi,au:ℏ planck/(2*pi) <_title>Newtonian Constant of Gravitation <_names>r:newtonian_constant,a:G 6.67408E-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>Bohr Magneton <_names>r:bohr_magneton,aisu:μ_B 927.4009994E-26*J*T^(-1) <_title>Conductance Quantum <_names>r:conductance_quantum,ais:G_0 7.7480917310E-5*S <_title>Elementary Charge <_names>r:elementary_charge,ais:e_charge 1.6021766208E-19*C <_title>Josephson Constant <_names>r:josephson,ais:K_J 483597.8525E9*Hz*V^(-1) <_title>Magnetic Flux Quantum <_names>r:magnetic_flux_quantum,aisu:Φ_0 2.067833831E-15*Wb <_title>Nuclear Magneton <_names>r:nuclear_magneton,aisu:μ_N 5.050783699E-27*J*T^(-1) <_title>von Klitzing Constant <_names>r:klitzing,ais:R_K 25812.8074555*ohm <_title>Atomic and Nuclear Constants <_title>Alpha Particle Mass <_names>r:alpha_particle_mass,aisu:m_α 6.644657230E-24*g <_title>Bohr Radius <_names>r:bohr_radius,ais:a_0 0.52917721067E-10*m <_title>Classical Electron Radius <_names>r:classical_electron_radius,ais:r_e 2.8179403227E-15*m <_title>Compton Wavelength <_names>r:compton_wavelength,aisu:λ_C 2.4263102367E-12*m <_title>Electron Mass <_names>r:electron_mass,ais:m_e 9.10938356E-28*g <_title>Helion Mass <_names>r:helion_mass,ais:m_h 5.006412700E-24*g <_title>Neutron Mass <_names>r:neutron_mass,ais:m_n 1.674927471E-24*g <_title>Proton Mass <_names>r:proton_mass,ais:m_p 1.672621898E-24*g <_title>Rydberg Constant <_names>r:rydberg,aisu:R_∞ 10973731.568508*m^(-1) <_title>Tau Mass <_names>r:tau_mass,aisu:m_τ 3.16747E-24*g <_title>Physico-Chemical Constants <_title>Atomic Mass Constant <_names>r:atomic_mass,ais:m_u 1.660539040E-24*g <_title>Avogadro Constant <_names>r:avogadro,ais:N_A 6.022140857E23*mol^(-1) <_title>Boltzmann Constant <_names>r:boltzmann,ais:k_B 1.38064852E-23*J*K^(-1) <_title>Faraday Constant <_names>r:faraday 96485.33289*C*mol^(-1) <_title>First Radiation Constant <_names>r:first_radiation,ais:c_1 3.741771790E-16*W*m^2 <_title>Ideal Gas Constant <_names>r:ideal_gas 8.3144598*J*K^(-1)*mol^(-1) <_title>Second Radiation Constant <_names>r:second_radiation,ais:c_2 1.43877736E-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>Pythagoras' 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>Archimedes' 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>a:∞,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.10/data/elements.xml.in0000644000175000017500000006705612715141057015061 00000000000000 <_name>Hydrogen 9 1.008 20.271 13.99 0.00008988 1 1 <_name>Helium 10 4.002602 4.222 0.0001785 18 1 <_name>Lithium 1 6.94 1603 453.65 0.533 1 2 <_name>Beryllium 2 9.0121831 2742 1560 1.85 2 2 <_name>Boron 7 10.81 4200 2349 2.34 13 2 <_name>Carbon 8 12.011 2.267 14 2 <_name>Nitrogen 9 14.007 77.355 63.15 0.0012506 15 2 <_name>Oxygen 9 15.999 90.188 54.36 0.001429 16 2 <_name>Fluorine 9 18.998403163 85.04 53.48 0.001696 17 2 <_name>Neon 10 20.1797 27.104 24.56 0.0008999 18 2 <_name>Sodium 1 22.98976928 1156.090 370.944 0.971 1 3 <_name>Magnesium 2 24.305 1363 923 1.738 2 3 <_name>Aluminum 6 26.9815385 2743 933.47 2.698 13 3 <_name>Silicon 7 28.085 3538 1687 2.3296 14 3 <_name>Phosphorus 8 30.973761998 550 317.30 1.82 15 3 <_name>Sulfur 8 32.06 717.8 388.36 2.067 16 3 <_name>Chlorine 9 35.45 239.11 171.6 0.003214 17 3 <_name>Argon 10 39.948 87.302 83.81 0.0017837 18 3 <_name>Potassium 1 39.0983 1032 336.7 0.862 1 4 <_name>Calcium 2 40.078 1757 1115 1.54 2 4 <_name>Scandium 5 44.955908 3109 1814 2.989 3 4 <_name>Titanium 5 47.867 3560 1941 4.54 4 4 <_name>Vanadium 5 50.9415 3680 2183 6.11 5 4 <_name>Chromium 5 51.9961 2755 2180 7.15 6 4 <_name>Manganese 5 54.938044 2334 1519 7.44 7 4 <_name>Iron 5 55.845 3143 1811 7.874 8 4 <_name>Cobalt 5 58.933194 3200 1768 8.86 9 4 <_name>Nickel 5 58.6934 3002 1728 8.912 10 4 <_name>Copper 5 63.546 2835 1357.77 8.96 11 4 <_name>Zinc 5 65.38 1180 692.68 7.134 12 4 <_name>Gallium 6 69.723 2673 302.9146 5.907 13 4 <_name>Germanium 7 72.630 3106 1211.40 5.323 14 4 <_name>Arsenic 7 74.921595 887 1090 5.776 15 4 <_name>Selenium 8 78.971 958 494 4.809 16 4 <_name>Bromine 9 79.904 332.0 265.8 3.122 17 4 <_name>Krypton 10 83.798 119.735 115.78 0.003733 18 4 <_name>Rubidium 1 85.4678 961 312.45 1.532 1 5 <_name>Strontium 2 87.62 1650 1050 2.64 2 5 <_name>Yttrium 5 88.90584 3203 1799 4.469 3 5 <_name>Zirconium 5 91.224 4650 2128 6.506 4 5 <_name>Niobium 5 92.90637 5017 2750 8.57 5 5 <_name>Molybdenum 5 95.95 4912 2896 10.22 6 5 <_name>Technetium 5 [98] 4538 2430 11.5 7 5 <_name>Ruthenium 5 101.07 4423 2607 12.37 8 5 <_name>Rhodium 5 102.90550 3968 2237 12.41 9 5 <_name>Palladium 5 106.42 3236 1828.05 12.02 10 5 <_name>Silver 5 107.8682 2483 1234.93 10.501 11 5 <_name>Cadmium 5 112.414 1040 594.22 8.69 12 5 <_name>Indium 6 114.818 2345 429.75 7.31 13 5 <_name>Tin 6 118.710 2875 505.08 7.287 14 5 <_name>Antimony 7 121.760 1908 903.78 6.685 15 5 <_name>Tellurium 7 127.60 1261 722.66 6.232 16 5 <_name>Iodine 9 126.90447 457.4 386.85 4.93 17 5 <_name>Xenon 10 131.293 165.051 161.40 0.005887 18 5 <_name>Cesium 1 132.90545196 944 301.7 1.873 1 6 <_name>Barium 2 137.327 1910 1000 3.596 2 6 <_name>Lanthanum 3 138.9054 3737 1193 6.145 3 9 <_name>Cerium 3 140.116 3716 1068 6.77 4 9 <_name>Praseodymium 3 140.90766 3403 1208 6.773 5 9 <_name>Neodymium 3 144.242 3347 1297 7.007 6 9 <_name>Promethium 3 [145] 3273 1315 7.26 7 9 <_name>Samarium 3 150.36 2173 1345 7.52 8 9 <_name>Europium 3 151.964 1802 1099 5.243 9 9 <_name>Gadolinium 3 157.25 3273 1585 7.895 10 9 <_name>Terbium 3 158.92535 3396 1629 8.229 11 9 <_name>Dysprosium 3 162.500 2840 1680 8.55 12 9 <_name>Holmium 3 164.93033 2873 1734 8.795 13 9 <_name>Erbium 3 167.259 3141 1802 9.066 14 9 <_name>Thulium 3 168.93422 2223 1818 9.321 15 9 <_name>Ytterbium 3 173.045 1703 1097 6.965 16 9 <_name>Lutetium 3 174.9668 3675 1925 9.84 3 6 <_name>Hafnium 5 178.49 4876 2506 13.31 4 6 <_name>Tantalum 5 180.94788 5731 3290 16.654 5 6 <_name>Tungsten 5 183.84 6203 3695 19.25 6 6 <_name>Rhenium 5 186.207 5869 3459 21.02 7 6 <_name>Osmium 5 190.23 5285 3306 22.61 8 6 <_name>Iridium 5 192.217 4403 2719 22.56 9 6 <_name>Platinum 5 195.084 4098 2041.4 21.46 10 6 <_name>Gold 5 196.966569 3129 1337.33 19.282 11 6 <_name>!elements!Mercury 5 200.592 629.88 234.32 13.5336 12 6 <_name>Thallium 6 204.38 1746 577 11.85 13 6 <_name>Lead 6 207.2 2022 600.61 11.342 14 6 <_name>Bismuth 6 208.98040 1837 544.7 9.807 15 6 <_name>Polonium 6 [209] 1235 527 9.32 16 6 <_name>Astatine 7 [210] 575 7 17 6 <_name>Radon 10 [222] 211.5 202 0.00973 18 6 <_name>Francium 1 [223] 300 1.87 1 7 <_name>Radium 2 [226] 2010 973 5.5 2 7 <_name>Actinium 4 [227] 3471 1323 10.07 3 10 <_name>Thorium 4 232.0377 5061 2115 11.72 4 10 <_name>Protactinium 4 231.03588 1841 15.37 5 10 <_name>Uranium 4 238.02891 4404 1405.3 18.95 6 10 <_name>Neptunium 4 [237] 4273 917 20.45 7 10 <_name>Plutonium 4 [244] 3501 912.5 19.84 8 10 <_name>Americium 4 [243] 2880 1449 13.69 9 10 <_name>Curium 4 [247] 3383 1613 13.51 10 10 <_name>Berkelium 4 [247] 1323 14.79 11 10 <_name>Californium 4 [251] 1173 15.1 12 10 <_name>Einsteinium 4 [252] 1133 8.84 13 10 <_name>Fermium 4 [257] 1800 14 10 <_name>Mendelevium 4 [258] 1100 15 10 <_name>Nobelium 4 [259] 1100 16 10 <_name>Lawrencium 4 [266] 1900 3 7 <_name>Rutherfordium 5 [267] 4 7 <_name>Dubnium 5 [268] 5 7 <_name>Seaborgium 5 [269] 6 7 <_name>Bohrium 5 [270] 7 7 <_name>Hassium 5 [269] 8 7 <_name>Meitnerium 11 [278] 9 7 <_name>Darmstadtium 11 [281] 10 7 <_name>Roentgenium 11 [282] 11 7 <_name>Copernicium 5 [285] 12 7 <_name>Ununtrium 11 [286] 13 7 <_name>Flerovium 6 [289] 14 7 <_name>Ununpentium 11 [289] 15 7 <_name>Livermorium 11 [293] 16 7 <_name>Ununseptium 11 [294] 17 7 <_name>Ununoctium 11 [294] 18 7 libqalculate-0.9.10/data/functions.xml.in0000644000175000017500000034266312747054302015256 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. Multiplies 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 double factorial of an integer. Multiplies 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. Multiplies 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. Multiplies 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. Multiplies 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 Multiple <_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 Logarithm <_names>rs:log2 <_description>Returns the base n logarithm. log(\x,2) <_title>Value false 0 <_title>Base-10 Logarithm <_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>au:∛,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>Fibonacci Number <_names>r:fibonacci <_description>Returns the n-th term of the Fibonacci sequence. (golden^\x−(1−golden)^\x)/sqrt(5) <_title>Index (n) 0 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 occurring 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/d)) <_title>Date <_title>Time isNumber(\x/d) <_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>Differentiate <_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. Note that the interest rate here refers to the rate for each period and if you calculate with an annual rate, each period will be interpreted as a whole year (to get monthly payments, divide the result by 12). (-\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 discounted security <_names>r:pricedisc <_description>Calculates and returns the price per $100 face value of a discounted security. 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.10/data/currencies.xml.in0000644000175000017500000002170012710603504015364 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 Baht <_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,au:₽,ruble <_title>Philippine Peso <_names>ar:PHP,au:₱ <_title>Malaysian Ringgit <_names>ar:MYR <_title>Croatian Kuna <_names>ar:HRK <_title>Yuan Renminbi (PR China) <_names>ar:CNY <_title>Indonesian Rupiah <_names>ar:IDR,rupiah <_title>Czech Koruna <_names>ar:CZK <_title>Hungarian Forint <_names>forint,ar:HUF <_title>Polish Zloty <_names>zloty,ar:PLN <_title>Romanian New Leu <_names>leu,ar:RON <_title>Turkish New Lira <_names>ar:TRY,au:₺ <_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,au:₩,won <_title>South African Rand <_names>ar:ZAR <_title>Indian Rupee <_names>ar:INR,au:₹,rupee <_title>Israeli New Sheqel <_names>ar:ILS,au:₪,sheqel <_title>Mexican Peso <_names>ar:MXN <_title>Brazilian Real <_names>ar:BRL <_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,au:₯,drachma EUR 1/340.750 1 <_title>French Franc <_names>ar:FRF,au:₣,franc EUR 1/6.55957 1 <_title>Italian Lira <_names>ar:ITL,au:₤,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>Deutsche Mark <_names>ar:DEM,mark EUR 1/1.95583 1 <_title>Spanish Peseta <_names>ar:ESP,au:₧,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 <_title>Slovenian Tolar <_names>ar:SIT,tolar EUR 1/239.640 1 <_title>Cypriot Pound <_names>ar:CYP EUR 1/0.585274 1 <_title>Estonian Kroon <_names>ar:EEK,kroon,p:krooni EUR 1/15.6466 1 <_title>Slovak Koruna <_names>ar:SKK EUR 1/30.1260 1 <_title>Maltese Lira <_names>ar:MTL EUR 1/0.429300 1 <_title>Latvian Lats <_names>lats,ar:LVL EUR 1/0.702800 1 <_title>Lithuanian Litas <_names>litas,ar:LTL EUR 1/3.45280 1 libqalculate-0.9.10/README.translate0000644000175000017500000001500612723621613014045 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 GUI packages (currently only qalculate-gtk). 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 source packages for libqalculate and qalculate-gtk 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 distributed with intltool. 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.10/libqalculate.pc.in0000644000175000017500000000034612711073512014561 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} -lqalculate Cflags: -I${includedir}libqalculate-0.9.10/Makefile.in0000644000175000017500000007133312757636731013261 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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 = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = libqalculate.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/libqalculate.pc.in AUTHORS COPYING ChangeLog INSTALL \ NEWS README TODO compile config.guess config.sub install-sh \ ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 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_CLAGS = @CLN_CLAGS@ 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@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ 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_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = libqalculate src data po po-defs docs EXTRA_DIST = \ autogen.sh \ README.translate \ libqalculate.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libqalculate.pc all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(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'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu 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) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 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) ($(am__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 config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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; \ ($(am__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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ 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 || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -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__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(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 \ && cd "$$am__cwd" \ || exit 1 $(am__post_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: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: 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: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz 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-am uninstall \ uninstall-am uninstall-pkgconfigDATA .PRECIOUS: Makefile # 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.10/aclocal.m40000644000175000017500000144174212757636731013062 00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 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_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. 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]) ;; *-*-openbsd*) CATOBJEXT=.mo DATADIRNAME=share ;; *) 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.ac. 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 AU_DEFUN([GLIB_GNU_GETTEXT], [AC_REQUIRE([AC_PROG_CC])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 ], [[$0: This macro is deprecated. You should use upstream gettext instead.]]) # 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_ac,[],[ 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 42 IT_PROG_INTLTOOL AC_DEFUN([IT_PROG_INTLTOOL], [ AC_PREREQ([2.50])dnl AC_REQUIRE([AM_NLS])dnl case "$am__api_version" in 1.[01234]) AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) ;; *) ;; esac INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` if test -n "$1"; then AC_MSG_CHECKING([for intltool >= $1]) 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 AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.]) fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi AC_SUBST([AM_DEFAULT_VERBOSITY]) INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' INTLTOOL__v_MERGE_0='@echo " ITMRG " [$]@;' AC_SUBST(INTLTOOL_V_MERGE) AC_SUBST(INTLTOOL__v_MERGE_) AC_SUBST(INTLTOOL__v_MERGE_0) INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' intltool__v_merge_options_0='-q' AC_SUBST(INTLTOOL_V_MERGE_OPTIONS) AC_SUBST(intltool__v_merge_options_) AC_SUBST(intltool__v_merge_options_0) INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< [$]@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< [$]@' else INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.[$][$]RANDOM && mkdir [$][$]_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u [$][$]_it_tmp_dir $< [$]@ && rmdir [$][$]_it_tmp_dir' fi INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' _IT_SUBST(INTLTOOL_DESKTOP_RULE) _IT_SUBST(INTLTOOL_DIRECTORY_RULE) _IT_SUBST(INTLTOOL_KEYS_RULE) _IT_SUBST(INTLTOOL_PROP_RULE) _IT_SUBST(INTLTOOL_OAF_RULE) _IT_SUBST(INTLTOOL_PONG_RULE) _IT_SUBST(INTLTOOL_SERVER_RULE) _IT_SUBST(INTLTOOL_SHEET_RULE) _IT_SUBST(INTLTOOL_SOUNDLIST_RULE) _IT_SUBST(INTLTOOL_UI_RULE) _IT_SUBST(INTLTOOL_XAM_RULE) _IT_SUBST(INTLTOOL_KBD_RULE) _IT_SUBST(INTLTOOL_XML_RULE) _IT_SUBST(INTLTOOL_XML_NOMERGE_RULE) _IT_SUBST(INTLTOOL_CAVES_RULE) _IT_SUBST(INTLTOOL_SCHEMAS_RULE) _IT_SUBST(INTLTOOL_THEME_RULE) _IT_SUBST(INTLTOOL_SERVICE_RULE) _IT_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) AC_PATH_PROG(GMSGFMT, gmsgfmt, $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 AC_PATH_PROG(INTLTOOL_PERL, perl) if test -z "$INTLTOOL_PERL"; then AC_MSG_ERROR([perl not found]) fi AC_MSG_CHECKING([for perl >= 5.8.1]) $INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 if test $? -ne 0; then AC_MSG_ERROR([perl 5.8.1 is required for intltool]) else IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` AC_MSG_RESULT([$IT_PERL_VERSION]) 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) IT_PO_SUBDIR([po]) ]) # 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 executed at the very end dnl of config.status. AC_CONFIG_COMMANDS_PRE([ AC_CONFIG_COMMANDS([$1/stamp-it], [ if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.]) fi 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" ] [sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r $1/POTFILES } ' "$1/Makefile.in" >"$1/Makefile"] rm -f "$1/Makefile.tmp" mv "$1/stamp-it.tmp" "$1/stamp-it" ]) ])dnl ]) # _IT_SUBST(VARIABLE) # ------------------- # Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST # AC_DEFUN([_IT_SUBST], [ AC_SUBST([$1]) m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) ] ) # 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-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 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. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl 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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. 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 delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # 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 sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, 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 TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # 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" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])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_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_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. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_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 # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) 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. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* 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 ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # 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 yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_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_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_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_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" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_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_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 _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # 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. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`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 "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. 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 what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) 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_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. 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*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) 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 ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # 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 bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_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 "$_lt_linker_boilerplate" | $SED '/^$/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 yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # 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* | cegcc*) # 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; ;; mint*) # On MiNT this can take a long time and run out of memory. 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; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # 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 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; 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" && \ test undefined != "$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 # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` 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 max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #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 /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_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_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; 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* | cegcc*) 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 ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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_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 yes = "$lt_cv_dlopen_self"; 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_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 _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_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:$LINENO: $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:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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_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 .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; 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 no = "$hard_links"; 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 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_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 _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) 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 _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then 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; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) 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 AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) 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=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $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' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor 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* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc 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~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' 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' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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$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 # correct to gnu/linux during the next big refactor 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 ;; 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[[23]].*) 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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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;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' ;; 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 # correct to gnu/linux during the next big refactor 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=qnx 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='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; 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 # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 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 # correct to gnu/linux during the next big refactor 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=sco 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 shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor 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 no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[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]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_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="m4_if([$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 <<_LT_EOF 1>&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 _LT_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 _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_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 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [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 # that 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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; 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 ;; haiku*) 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])(-bit)?( [LM]SB)? 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) 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 ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi 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 _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (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 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) 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 : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-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_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # 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]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' 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 # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # 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 # Try without a prefix underscore, 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. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $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 <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_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_globsym_save_LIBS CFLAGS=$lt_globsym_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 yes = "$pipe_works"; 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 # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # 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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # 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_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $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_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_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 ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # 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_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_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_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_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_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_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_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # 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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; 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_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_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_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_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_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= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # 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 yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; 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_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_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_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[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 ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, 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 install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_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, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_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_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_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* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$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' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_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; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_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 case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_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~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&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. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_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_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** 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 ;; *) # 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. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_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_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_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_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_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_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; 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_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_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_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_SYS_MODULE_PATH_AIX([$1]) _LT_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_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # 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. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_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_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $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_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_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 no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_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' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_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 -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_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 yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_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 CANNOT 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_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_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_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$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_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl 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_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_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # 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_TAG_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_CFLAGS=$CFLAGS 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++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_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 yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_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_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_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_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 -v "^Configured with:" | $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_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive 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 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; 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_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_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_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_SYS_MODULE_PATH_AIX([$1]) _LT_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_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_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, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_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_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_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 "x$output_objdir/$soname" = "x$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) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_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; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $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_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_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_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_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_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-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_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | 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_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_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; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_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_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # 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_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_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_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_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_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_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' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_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=`func_echo_all "$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; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_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 -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_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; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_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::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_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_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | 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_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_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_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=`func_echo_all "$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; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_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" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_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 -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_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_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_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_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -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 -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_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 $wl-h $wl$soname -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 -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_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_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_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 CANNOT 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_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$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_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC 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 fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([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. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= 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... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); 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 for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev 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 "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $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 "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$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 no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [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. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_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_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # 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_TAG_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_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # 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_TAG_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_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_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_TAG_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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_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_TAG_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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # 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. # m4_defun([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 10 -lt "$lt_ac_count" && 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]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # 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 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_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=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_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=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_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=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # 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 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # 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. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # 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 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # nls.m4 serial 5 (gettext-0.18) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29.1) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 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 ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have 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_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. 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 ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl 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 AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [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])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [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 .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR # Copyright (C) 2002-2014 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.15' 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.15], [], [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 AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 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], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2014 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_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$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 m4_define([_AM_COND_VALUE_$1], [$2])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-2014 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. # 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", "OBJC", "OBJCXX", "UPC", or "GJC". # 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 m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" 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". rm -rf conftest.dir 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 am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) 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 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2014 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_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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"` # 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'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2014 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 macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # 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.65])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], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) 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], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [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]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). 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])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # 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-2014 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 if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2014 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. # 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-2014 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_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2014 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_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .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 # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac 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-2014 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_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 is modern enough. # If it is, 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 if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # -*- Autoconf -*- # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # # Copyright (C) 1996-2014 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. AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl AC_CONFIG_HEADERS($@)]) AC_DEFUN([AM_PROG_CC_STDC], [AC_PROG_CC am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should simply use the 'AC][_PROG_CC' macro instead. Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', but upon 'ac_cv_prog_cc_stdc'.])]) AC_DEFUN([AM_C_PROTOTYPES], [AC_FATAL([automatic de-ANSI-fication support has been removed])]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2014 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_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], [m4_foreach_w([_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])]) # Copyright (C) 1999-2014 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_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2014 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_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2014 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_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # 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 ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file 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 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 if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done 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]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2014 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_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2014 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-2014 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]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2014 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_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. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} 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.10/missing0000755000175000017500000001533012461125176012572 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written 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, see . # 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 case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. 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 # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libqalculate-0.9.10/Makefile.am0000644000175000017500000000036612723625206013232 00000000000000## Process this file with automake to produce Makefile.in SUBDIRS = libqalculate src data po po-defs docs EXTRA_DIST = \ autogen.sh \ README.translate \ libqalculate.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libqalculate.pc libqalculate-0.9.10/compile0000755000175000017500000001624512461125176012557 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libqalculate-0.9.10/TODO0000644000175000017500000000120612720610364011654 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 functions * Keep track of if user has changed definitions since load * Better handling of exchange rates fetching * Timeout for plot data calculation * Uncertainty propagation * Load data set from csv filelibqalculate-0.9.10/ChangeLog0000644000175000017500000025120112757635723012760 000000000000002016-08-23 Hanna Knutsson * Fix unit conversion (e.g. 1/s to ms) * Fix unit conversion (e.g. 1/ns to GHz) 2016-08-08 Hanna Knutsson * Fix degree sign 2016-08-05 Hanna Knutsson * Fix compilation without readline 2016-07-21 Hanna Knutsson * Do not use unicode signs in definitions list and show both abbreviated and long name 2016-07-20 Hanna Knutsson * 'delete' command, for removal of user-defined variables, in qalc 2016-07-18 Hanna Knutsson * Option to list all functions, variables or units in qalc 2016-07-17 Hanna Knutsson * 'list' command, which displays a list of user defined variables, functions and units, in qalc 2016-07-12 Hanna Knutsson * Avoid warning message if exchange rates file does not exist 2016-07-08 Hanna Knutsson * Fix errors and warnings when compiling with clang, and fix unordered_map/hash_map issues 2016-07-06 Hanna Knutsson * Fix crash when using locale missing on system 2016-06-29 Hanna Knutsson * Fix parsing of "today" and add "tomorrow" and "yesterday" 2016-06-11 Hanna Knutsson * Show actual number of days since last exchange rates update 2016-06-10 Hanna Knutsson * Fix localization of command line arguments 2016-06-09 Hanna Knutsson * Improve exchange rates handling * Add interactive command line option to qalc. Exit after commands from file have been executed unless interactive mode has been explicitly selected. 2016-06-07 Hanna Knutsson * Do not check if exchange rates is up to date when using currencies with fixed exchange rate (currencies replaced by euro) * Warn about old exchange rates again after one week if the application has not been restarted (Calculator object not recreated) * Make sure precision and if approximate is not lost from units, functions and variables * Update physical constants from CODATA Recommended Values 2014 * Fix unit precision from definitions 2016-06-03 Hanna Knutsson * sqrt(7/4) = sqrt(7)/2, sqrt(2)/2−(1/sqrt(2)) equals exactly zero 2016-05-27 Hanna Knutsson * Allow special "to" commands directly in expression * New "to" commands: factors and fraction * Fix segmentation fault when aborting non-interactive qalc (do not use readline) 2016-05-26 Hanna Knutsson * to bin, oct, hex, bases commands in qalc 2016-05-25 Hanna Knutsson * Use ? or 0 in front of unit expression to control if missing prefix should be set 2016-05-24 Hanna Knutsson * Use MULTIPLICATION_SIGN_X by default * Use prefix for more units, add centigrades name for celsius, add Dalton unit and move units to new Atomic Mass category 2016-05-23 Hanna Knutsson * Add unicode signs for powers 0 and 4-9, and cube root 2016-05-20 Hanna Knutsson * Redesigned parsing of spaces in multiplication and division and new parse options to ignore whitespace or not treat implicit multiplication differently from explicit 2016-05-19 Hanna Knutsson * Fix stack editing 2016-05-17 Hanna Knutsson * New print safer abort/timeout system 2016-05-15 Hanna Knutsson * Add thread cancellation point in factorize number function to make crash less likely * Attempt to make print thread cancellation less crash prone 2016-05-11 Hanna Knutsson * Do not add default angle unit if one is already present * Disable inclomplete uncertainty propagation support for now 2016-05-10 Hanna Knutsson * Do not keep zero radians * Always simplify before integration 2016-05-08 Hanna Knutsson * Fix bug #108 by not checking for x in function arguments when isolating x, thus stopping infinite loop * Fix sqrt(x)*sqrt(x) 2016-05-05 Hanna Knutsson * Fix endless loops in gcd functions (solves bug #64) 2016-05-03 Hanna Knutsson * Use standard location for data and configuration (~/.local and ~/.conf) 2016-05-02 Hanna Knutsson * An attempt to solve the convert to unit issues: - Transform Kelvin, Celsius, Farenheit to builtin units. - Convert to kelvin when parsing, to make the conversion visible to the user, after implicit multiplication. - Fix s/g to kg = s*kg/g^2. - Do not set new prefix when converting to unit expression without prefix. * Add Hartree and Rydberg units 2016-04-30 Hanna Knutsson * Update build files and increment version number 2016-04-29 Hanna Knutsson * Update currencies (fix currencies recently recplaced by euro, add new currencies and add additional unicode signs) * Allow decimals in sexagesimal numbers (request #26) 2016-04-28 Hanna Knutsson * Catch CLN exceptions (fixes various bugs) * Fix bug #79 and #127 * Option to ignore commas * Apply most of the portability patch in bug #124 2016-04-26 Hanna Knutsson * Fix preservation of case sensitivity in translated names * Do not append zeroes to decimals if number is approximate or is shown approximately 2016-04-25 Hanna Knutsson * Clarify how "Payment for a loan" works * Fix "function" function when argument vector is too small * Fix result for unsuccessful integration with limits * Fix self-referencing in save function 2016-04-24 Hanna Knutsson * Fix fibonacci function. Remove from program code and use the golden ratio. 2016-04-21 Hanna Knutsson * Fix conversion to unit with prefix (bug #150) * Fix conversion from unit with prefix (bug #97 and #104) 2016-04-19 Hanna Knutsson * Introduce use_with_prefix property for units, to not use prefixes by defaults for units outside SI and CGS systems (solves bug #66) * Partially revert commit [83fe08] * Warn about bad integrate function * Fix abbreviation for Rydberg constant (bug #140) 2016-04-18 Hanna Knutsson * Include for std::sort() * Use unordered_map instead of hash_map for new gcc versions * Fix warnings (including bug #143) * Provide a proper fix for bug 3020050 / #121 (without removing valid warning messages) * Fix parsing of (0xff) (bug #102) * Warn when raising zero by imaginary power (bug #141) * Fix incorrect factorization (bug #130) 2009-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 Hanna Knutsson * Fix reduction of vector size. Fixes bug 1913388. 2007-08-27 Hanna Knutsson * Begin work on propagation of uncertainties * Allow parentheses for vectors (a bit stricter parsing) * brackets_as_parentheses parse option 2007-08-23 Hanna Knutsson * 2/5m = 2/(5m); 2/5 m = (2/5)*m 2007-08-22 Hanna Knutsson * Make DataSet::calculate virtual * dataset.object.property and object.property (with parse_options.default_dataset set) syntax 2007-08-21 Hanna Knutsson * Fix crash with unsupported operator in RPN syntax (bug 1778267) 2007-08-07 Hanna Knutsson * New Simplified Chinese translation (Roy Qu ) 2007-06-17 Hanna Knutsson * Miscellaneous fixes before release 2007-04-27 Hanna Knutsson * New functions: addTime(), isNumber(), isReal(), isRational(), isInteger(), representsNumber(), representsReal(), representsRational(), representsInteger() * Show argument name instead of \x in argument condition 2007-04-26 Hanna Knutsson * Use Lambert W to solve equations * Fix infinite loop when solving some equations * New functions: addDays(), addMonths(), addYear() 2007-04-19 Hanna Knutsson * Enhance lambertw() * Add the Omega constant 2007-04-18 Hanna Knutsson * Implement the Lambert W function 2007-04-17 Hanna 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 Hanna Knutsson * Fix simplification of (1-1/x)^3 and similar 2007-03-31 Hanna Knutsson * Add grams of TNT (gTNT/gramTNT) and tons of TNT (tTNT/tonTNT) units 2007-03-29 Hanna Knutsson * Fix parsing of unit expressions (when converting) such as W/(m K) * Expand data on elements 2007-03-20 Hanna 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 Hanna Knutsson * New French translation (Nicolas Laug ) 2006-11-18 Hanna Knutsson * Update Swedish translation 2006-11-07 Hanna Knutsson * Update Dutch translation (Jaap Woldringh ) 2006-11-02 Hanna Knutsson * Use "name := value" as shortcut for save(value; name) * Return value in save() 2006-09-10 Hanna Knutsson * Group integer factors in powers 2006-09-05 Hanna Knutsson * Integer factorization * Heaviside Step Function, Rectangular Function, Triangular Function, and Ramp Function * Kronecker Delta, Sigmoid, and Logit Transformation 2006-08-18 Hanna Knutsson * Generate API docs from autogen.sh * Radius instead of diameter as argument for circumference() 2006-07-21 Hanna Knutsson * Interpret 0x[0-9,a-f] as hexadecimal number (do not require first digit to be 0-9) 2006-07-03 Hanna 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 Hanna Knutsson * Fix parsing of "x!)!" * Use Julian year for light-year value 2006-06-20 Hanna Knutsson * Use "Display units separately" also for quantities with multiple terms 2006-06-10 Hanna Knutsson * Add base 3 exponent mode * Add "Engineering" display mode 2006-06-06 Hanna 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 Hanna Knutsson * Polishing before 0.9.4 release 2006-05-18 Hanna Knutsson * Fix libqalculate.so unresolved symbols with patch from Thomas de Grenier de Latour, add GLIB_LIBS to LIBADD 2006-05-09 Hanna Knutsson * Add additional localization options for use in KDE GUI 2006-05-03 Hanna 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 Hanna Knutsson * Update API documentation * equation => formula in MathFunction * Do less in setFormula() if formula is empty 2006-04-27 Hanna Knutsson * Fix parsed expression for RPN operation * Remove capitalization from argument titles 2006-04-24 Hanna Knutsson * Fix bug #1475373 ("1 kg m/s" was simplified to "1000 m/s") 2006-04-23 Hanna Knutsson * README.translate with information for translators * Update Swedish translation 2006-04-22 Hanna Knutsson * Prepend !category! to strings, which might have different translations in different contexts, in data files 2006-04-21 Hanna Knutsson * Add the completed Dutch translation * New name format in data files * Update Dutch translation to new name format 2006-04-13 Hanna Knutsson * Fix horrible, horrible bug that caused all number arguments to require numbers to be rational 2006-04-09 Hanna 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 Hanna 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 Hanna Knutsson * Update RPN functions * Update API documentation * Change usecs argument to msecs 2006-04-04 Hanna Knutsson * Plugins * True RPN mode 2006-04-03 Hanna 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 Hanna Knutsson * Symmetric matrix => Square matrix * Some text string changes * Accept vectors in elements function 2006-04-01 Hanna Knutsson * Interpret 0x..., 0o... and 0b... as hexadecimal, octal and binary numbers, respectively, when base is decimal 2006-03-29 Hanna 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 Hanna Knutsson * Fix contains... functions (and thereby integration) 2006-03-25 Hanna Knutsson * Ignore commas in numbers * Start API documentation 2006-03-13 Hanna 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 Hanna 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 Hanna Knutsson * Fix show ending zeroes when max decimals is set to off by a max value below zero 2006-02-11 Hanna Knutsson * Do not use "Read Precision" in plot 2005-01-30 Hanna Knutsson * isodate(), localdate(), timestamp(), stamptodate() functions 2005-01-27 Hanna Knutsson * cos(x*pi*rad) equals 1 if x is even, not -1 2005-12-20 Hanna Knutsson * Warn about denominators assumed non-zero option 2005-12-19 Hanna Knutsson * Various fixes and enhancements * Update Swedish translation 2005-12-14 Hanna 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 Hanna Knutsson * Isolate x fixes * Fix merging of common factor with multiplication 2005-12-12 Hanna Knutsson * Assume that simple unit relations do not negate * Fix ?+(+infinity) 2005-12-11 Hanna Knutsson * Fix non-commutative multiplication (multiplication with possible matrices) 2005-12-09 Hanna 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 Hanna Knutsson * New assumption type "non-matrix" for unknowns with commutative multiplication * Finish isolate x / solve changes 2005-12-06 Hanna Knutsson * Isolate x and solve fixes * Fix matrix multiplication 2005-12-04 Hanna Knutsson * Isolate x updates * Put AND within OR (to get nicer inequalities) 2005-12-03 Hanna 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 Hanna Knutsson * Incorporate ginac sqrfree updates between version 1.2.3 and 1.3.3 * Assorted fixes 2005-11-30 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Be more restrictive with unknown variables/symbols with unknown type (might be unit or vector) 2005-11-25 Hanna 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 Hanna Knutsson * Sort out some power transformations 2005-11-23 Hanna Knutsson * More fixes (I'm not very good at keeping track of them) 2005-11-22 Hanna Knutsson * Preserve factorization print option (for (3/4*(x+1))/(y+1)) 2005-11-21 Hanna 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 Hanna 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 Hanna Knutsson * Fixes * Determinant from GiNaC * Only use the new inverse function for numeric matrices 2005-11-17 Hanna Knutsson * "borrow" sqrfree factorization and related functions from GiNaC * Make evaluation more efficient (avoid recalculations) 2005-11-10 Hanna Knutsson * MathStructure gcd() and lcm() * New simplification using factorization and factorization combing denominators * Increment library soname number (QALCULATE_CURRENT) 2005-11-07 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Compile without warnings with -pedantic and -Wextra 2005-11-03 Hanna 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 Hanna 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 Hanna Knutsson * Cleaner parsing (same result but looks nicer) 2005-10-30 Hanna Knutsson * Add metre/metres for meter/meters * nounit() function 2005-10-29 Hanna 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 Hanna 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 Hanna Knutsson * Update Swedish translation * light_year => lightyear * Fix unended function information when optional arguments 2005-10-22 Hanna Knutsson * Add SIGN_SMALLCIRCLE and SIGN_MULTIBULLET to utf8_pos_is_valid_in_name to fix completion 2005-10-21 Hanna Knutsson * Lots of new units 2005-10-20 Hanna 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 Hanna Knutsson * Add arguments past max arguments to unended_function 2005-10-18 Hanna Knutsson * Put seperation of unit expression to string in calculate function in a separate function * Add stopped warnings count 2005-10-17 Hanna Knutsson * Print option to hide underscores (if not for suffix) in names * Adjust precision of constants 2005-10-16 Hanna Knutsson * Add unended_function to parse_options and put unended function there when parsing 2005-10-15 Hanna Knutsson * mmHg unit * Ideal Gas Constant 2005-10-13 Hanna Knutsson * Fortnight unit * More composite units for convenience * Foot-Candle unit * Fix conversion footcandle <-> lux * Einstein unit 2005-10-11 Hanna Knutsson * More composite units for convenience (km, mm, ml, km/h, etc.) 2005-10-08 Hanna 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 Hanna 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 Hanna Knutsson * mph and mpg units 2005-08-21 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Support for "e" instead of "E" in result 2005-06-07 Hanna Knutsson * SIGN_POWER_1, ... => "^(1)", ... instead of "^1", ... 2005-06-06 Hanna Knutsson * Update Swedish translation 2005-06-05 Hanna 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 Hanna Knutsson * Bitwise AND (&), OR (|), XOR * Remove old giac stuff 2005-06-01 Hanna Knutsson * Non-static getElement() function * Initialize saved_locale before use 2005-05-15 Hanna Knutsson * Max values seem to have been lost a long time ago -- add them again 2005-05-07 Hanna Knutsson * Initialize ids_i * Fix documentation typos * Fix includes.h for gcc-4.0 2005-03-06 Hanna Knutsson * 5e2 = 5E2 = 500 and 5e = 5*e 2005-02-08 Hanna Knutsson * Update solve2() 2005-02-06 Hanna Knutsson * Dialog with buttons works in gtk+-2.6.2 * Do not look at function arguments in contains... functions 2005-02-02 Hanna Knutsson * Update integration and differentiation (sin(x) != sin(x)*rad) after change in sin() and cos() behaviour 2005-01-25 Hanna Knutsson * Fix RPN crash and don't add lonely stack value to itself * Workaround freeze with message dialog without buttons 2005-01-24 Hanna Knutsson * Use the last operator for leftover stack values 2004-11-30 Hanna Knutsson * Show base (if not decimal, hexadecimal or non-standard) as subscript 2004-11-26 Hanna Knutsson * Fix "Convert result" button * Use singular instead of abbreviated name for completion 2004-11-21 Hanna Knutsson * Fix draw unit * Add alternative multiplication dot signs * Enhance preferences safety 2004-11-16 Hanna Knutsson * Check if unicode characters can be displayed 2004-11-10 Hanna Knutsson * Revert back somewhat to the old behaviour of not rounding exact numbers not in exponential format 2004-10-25 Hanna Knutsson * Generate vector function 2004-10-24 Hanna Knutsson * Rearrange plot dialog * Do not update plot data when not changed * Make x variable separate for each plot function 2004-10-22 Hanna 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 Hanna Knutsson * Fix 0.5! 2004-10-20 Hanna Knutsson * Fix comparison of unit with unknown * Try with assumptions set to unknown in solve function if not successful 2004-10-19 Hanna Knutsson * Fix when size_t not is unsigned int 2004-10-17 Hanna 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 Hanna 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 Hanna Knutsson * More speed-ups 2004-10-12 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Change n for micro to u * Command line program "qalc" * Get rid of traces of separate angle unit variable 2004-10-01 Hanna Knutsson * Add filter to save result to image file dialog * Install libqalculate as a shared library 2004-09-30 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Rational factorization of higher degree polynomials 2004-09-20 Hanna 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 Hanna 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 Hanna Knutsson * Updated result sorting * (-x-y)/z --> -(x+y)/z 2004-09-17 Hanna Knutsson * Set unknowns dialog * More refined selection of popup menu items to show * Polynomial division * More reliable internal sorting 2004-09-16 Hanna Knutsson * Extensive enhancements of symbolic division * Alternative to assume that unknown denominators are non-zero 2004-09-12 Hanna Knutsson * Ex. 1/(x+10)=5, test if x+10 is zero after solve 2004-09-11 Hanna Knutsson * Evaluation options was not always preserved when converting to best units * Display x^(5/2) as x^2*sqrt(x) 2004-09-10 Hanna Knutsson * Internal sorting fixes * Update documentation * Update Swedish translation * Use displayed name when sorting 2004-09-09 Hanna Knutsson * Make factorization more functional 2004-09-08 Hanna Knutsson * Integration fixes * Use representsNonZero() for arguments that must be non-zero 2004-09-07 Hanna Knutsson * "times", "plus", "minus", "per", "AND", "OR" 2004-09-06 Hanna Knutsson * Finish GUI and user modifications for data sets 2004-09-01 Hanna Knutsson * rm -f qalculate; $(LN_S) qalculate-gtk qalculate 2004-08-28 Hanna 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 Hanna 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 Hanna Knutsson * data collection -> data set * Complete data set GUI 2004-08-24 Hanna Knutsson * Complete most of the data collection stuff * Move elements to data collection format 2004-08-23 Hanna Knutsson * Fix diff() with variables and functions that contains x * Simple integration 2004-08-22 Hanna 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 Hanna Knutsson * Fix RPN mode * include errno.h 2004-08-16 Hanna Knutsson * Remove giac arguments * Update documentation 2004-08-15 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Reduce number of element properties for now and verify * Periodic table * Update Swedish translation 2004-08-09 Hanna 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 Hanna 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 Hanna Knutsson * Initial work on GUI for new name system * Treat whole ending number as suffix (for log10) 2004-08-06 Hanna Knutsson * More work on name system * Remove quarter unit * Regenerate definition files * Remove duplicate names 2004-08-05 Hanna Knutsson * Do not prefix currencies in all locales 2004-08-04 Hanna Knutsson * New system for variable, unit and function names * Solve quadratic equations 2004-07-31 Hanna 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 Hanna 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 Hanna Knutsson * Electron Volt is approximate 2004-07-21 Hanna Knutsson * Fix arg() * ...and disable it as it does not work correctly * Fix i being display multiple times 2004-07-20 Hanna Knutsson * Focus tweaks 2004-07-19 Hanna Knutsson * -5^2 = (-5)^2 -> = -(5^2) * Beautify 2 * -1 * Fix not 2004-07-18 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * More work on base in parse options * Fix E in rpn mode * Parsing tweaking * GUI for number base in expression 2004-07-14 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Do not segfault on exit * Fix compilation warnings 2004-07-10 Hanna 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 Hanna Knutsson * Follow ISO 8601 standard for week numbers (glib doesn't) * Sort out approximation with rounding 2004-07-03 Hanna 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 Hanna 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 Hanna Knutsson * Release v. 0.6 * Do not create a new thread for every calculation and printing 2004-06-21 Hanna Knutsson * ... 2004-06-18 Hanna Knutsson * Continue converting to new internal structures 2004-06-14 Hanna Knutsson * Continue converting to new internal structures 2004-05-25 Hanna Knutsson * Converting to new internal structures 2004-05-12 Hanna Knutsson * New internal structures (Manager -> MathStructure) 2004-04-05 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Remove integrate parts that does not work * Do not crash on i^4 * Disable broken multiple roots 2004-04-01 Hanna Knutsson * Hyperbolic and inverse does not take angle arguments * Fix raise by matrix * Fix raise by alternatives * Fix drawing of function 2004-03-31 Hanna 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 Hanna 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 Hanna Knutsson * Release v. 0.5 * More extensive, verbose and fault-tolerant roman input 2004-03-28 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Roman numerals * Polynomial division 2004-03-24 Hanna 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 Hanna Knutsson * Symbols for sum, product and ohm * derangements() * sum() and product() corresponding to the signs * sum() -> total() * Reorganisation of function categories 2004-03-22 Hanna Knutsson * Complete convert to best unit 2004-03-21 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Handle CLN errors better * Font selection for expression entry * Replace Fraction and Integer with new Number class 2004-03-12 Hanna 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 Hanna Knutsson * Advanced completion in expression * Popup menu for resultview 2004-03-10 Hanna 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 Hanna 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 Hanna Knutsson * Update Swedish translation * First manual draft finished * Remove compiler warnings 2004-03-06 Hanna Knutsson * Gnuplot does not like quotation signs * Do not abort when locale not supported by C library 2004-03-05 Hanna Knutsson * Fix unit conversion of ex. ch^2 to acre * Some menu fixes * More user documentation 2004-03-04 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Calculate command line expression 2004-02-26 Hanna Knutsson * Release 0.4.1 * Fix parsing of text arguments * Replace strptime with g_date_set_parse 2004-02-24 Hanna Knutsson * Destroy widgets after autoconnect 2004-02-19 Hanna Knutsson * Use the new file chooser * "Select file to import" --> "Select file to export" 2004-02-18 Hanna Knutsson * Release 0.4 * Fix tanh 2004-02-15 Hanna Knutsson * Reenable checks for arguments that results in infinity * Fix comparison with complex numbers (not solvable) 2004-02-12 Hanna Knutsson * Add giac functions in functions.xml 2004-02-11 Hanna Knutsson * Fix binomial arguments * Update Swedish translation 2004-02-10 Hanna Knutsson * Remove PACKAGE and VERSION warnings with giac * Permutations and combinations 2004-02-09 Hanna Knutsson * Start even if gnuplot is not present 2004-02-08 Hanna Knutsson * Complex numbers: log, pow, root 2004-02-07 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Change behavior of decimals settings * CLN support (requirement for now, in place of GMP) * Disable gnome support in glade file 2003-09-09 Hanna 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 Hanna 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 Hanna Knutsson * Use GtkDrawingArea to make result display nicer * More matrix functions: cofactor, adjoint, inverse 2003-09-03 Hanna 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 Hanna Knutsson * Beginning of matrix support * Fix zero division 2003-09-01 Hanna Knutsson * factorial function and ! * frac and int functions * Menu items for fractional representation * Turn "use prefixes" into check menu item 2003-08-31 Hanna 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 Hanna Knutsson * Show if result is exact or not * Arbitrary precision * Move from long double to Fraction 2003-08-24 Hanna Knutsson * Decimal string to fraction * Date functions (for financial functions) * Fixes 2003-08-23 Hanna Knutsson * Localized dot and more 2003-08-22 Hanna Knutsson * Fractions and restructuring 2003-08-20 Hanna 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 Hanna Knutsson * Fraction button * Fraction Manager * New Fraction class 2003-08-19 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Fix bracket madness breaking unbrackened division (!) * About dialog 2003-08-14 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna 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 Hanna Knutsson * Move generated menus one step up * Add finalize() after conversion in callbacks.cc 2003-08-08 Hanna 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 Hanna 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 Hanna 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.10/autogen.sh0000755000175000017500000000752212711115210013162 00000000000000#!/bin/sh # Run this to generate all the initial makefiles, etc. srcdir=`dirname $0` test -z "$srcdir" && srcdir=. DIE=0 (test -f $srcdir/configure.ac) || { 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.ac >/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.ac >/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.ac >/dev/null && { grep "sed.*POTFILES" $srcdir/configure.ac >/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.ac -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.ac >/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.ac >/dev/null; then echo "Running intltoolize..." intltoolize --copy --force --automake fi if grep "^AM_PROG_LIBTOOL" configure.ac >/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.ac >/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.10/install-sh0000755000175000017500000003452312461125176013204 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2013-12-25.23; # UTC # 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. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # 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_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 is_target_a_directory=possibly 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 *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi 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 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac 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 if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 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 problematic for 'test' and other utilities. 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 # 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 "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` 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-writable 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 oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && 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` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libqalculate-0.9.10/depcomp0000755000175000017500000005601612461125176012556 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2014 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, see . # 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 outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} 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" # Avoid interferences from the environment. gccflag= dashmflag= # 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 cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc 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 -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## 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). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - 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 -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # 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. ## 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. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -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 -ne 0; then 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 ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # 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 ;; 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. set_dir_from "$object" set_base_from "$object" 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 -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then 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. set_dir_from "$object" set_base_from "$object" 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 -ne 0; then 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,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_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. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool 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$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # 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 ;; #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 "X$1" != 'X--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|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | 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 "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi 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. -arch) eat=yes ;; -*|$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" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | 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 "X$1" != 'X--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. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # 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 ;; 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libqalculate-0.9.10/configure0000755000175000017500000247575612757636732013147 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libqalculate 0.9.10. # # # Copyright (C) 1992-1996, 1998-2012 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=: # Pre-4.2 versions of Zsh do 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_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } 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.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do 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_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_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 || $as_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" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # 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" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # 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 } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac 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 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' 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='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # 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'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/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= # Identity of this package. PACKAGE_NAME='libqalculate' PACKAGE_TARNAME='libqalculate' PACKAGE_VERSION='0.9.10' PACKAGE_STRING='libqalculate 0.9.10' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="libqalculate/Calculator.cc" # 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='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS INTLTOOL_QALCULATE_DEFINITIONS_RULE MKINSTALLDIRS POSUB POFILES PO_IN_DATADIR_FALSE PO_IN_DATADIR_TRUE INTLLIBS INSTOBJEXT GMOFILES DATADIRNAME CATOBJEXT CATALOGS MSGFMT_OPTS GETTEXT_PACKAGE QALCULATE_DEFS2DOC LN_QALCULATE QALCULATE_TEXT READLINE_LIBS CLN_CLAGS CLN_LIBS CLN_CFLAGS GLIB_LIBS GLIB_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG QALCULATE_AGE QALCULATE_REVISION QALCULATE_CURRENT CXXCPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL ALL_LINGUAS INTLTOOL_PERL GMSGFMT MSGFMT MSGMERGE XGETTEXT INTLTOOL_POLICY_RULE INTLTOOL_SERVICE_RULE INTLTOOL_THEME_RULE INTLTOOL_SCHEMAS_RULE INTLTOOL_CAVES_RULE INTLTOOL_XML_NOMERGE_RULE INTLTOOL_XML_RULE INTLTOOL_KBD_RULE INTLTOOL_XAM_RULE INTLTOOL_UI_RULE INTLTOOL_SOUNDLIST_RULE INTLTOOL_SHEET_RULE INTLTOOL_SERVER_RULE INTLTOOL_PONG_RULE INTLTOOL_OAF_RULE INTLTOOL_PROP_RULE INTLTOOL_KEYS_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_DESKTOP_RULE intltool__v_merge_options_0 intltool__v_merge_options_ INTLTOOL_V_MERGE_OPTIONS INTLTOOL__v_MERGE_0 INTLTOOL__v_MERGE_ INTLTOOL_V_MERGE INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE USE_NLS EGREP GREP CPP LN_S am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_textport enable_defs2doc enable_dependency_tracking enable_nls enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_readline ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP LT_SYS_LIBRARY_PATH CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR GLIB_CFLAGS GLIB_LIBS CLN_CFLAGS CLN_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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_TARNAME}' 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= ;; *) 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_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=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_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. 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 # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 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 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 .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | 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 .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" 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 libqalculate 0.9.10 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/libqalculate] --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 case $ac_init_help in short | recursive ) echo "Configuration of libqalculate 0.9.10:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --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 --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-nls do not use Native Language Support --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-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --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 (Objective) C/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 LT_SYS_LIBRARY_PATH User-defined run-time library search path. CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path 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. Report bugs to the package provider. _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" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_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 $as_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 libqalculate configure 0.9.10 generated by GNU Autoconf 2.69 Copyright (C) 2012 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 ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* 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 $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_cxx_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* 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 $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func # ac_fn_cxx_check_member LINENO AGGR MEMBER VAR INCLUDES # ------------------------------------------------------ # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_cxx_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" 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 eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_member 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 libqalculate $as_me 0.9.10, which was generated by GNU Autoconf 2.69. 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=. $as_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append 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 as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset 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 $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; 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 $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_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'; as_fn_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 $as_echo "/* confdefs.h */" > 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 cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_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. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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.15' 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 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 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. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$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 rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # 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 ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file 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 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". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file 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 $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$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 test -d ./--version && rmdir ./--version 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. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' 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 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 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.10' 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"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_config_headers="$ac_config_headers config.h" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$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 this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_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='\' am__nodep='_no' 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.dSYM | *.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 if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg 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) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&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". rm -rf conftest.dir 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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac 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 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if ${ac_cv_search_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_strerror+:} false; then : break fi done if ${ac_cv_search_strerror+:} false; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg 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) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&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". rm -rf conftest.dir 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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac 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 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$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= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&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". rm -rf conftest.dir 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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac 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 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$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" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg 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) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&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". rm -rf conftest.dir 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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac 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 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then 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" as_fn_executable_p "$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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_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 as_fn_arith $ac_count + 1 && ac_count=$as_val 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 if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then 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" as_fn_executable_p "$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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_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 as_fn_arith $ac_count + 1 && ac_count=$as_val 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 if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } case "$am__api_version" in 1.01234) as_fn_error $? "Automake 1.5 or newer is required to use intltool" "$LINENO" 5 ;; *) ;; esac INTLTOOL_REQUIRED_VERSION_AS_INT=`echo | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` if test -n ""; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intltool >= " >&5 $as_echo_n "checking for intltool >= ... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found" >&5 $as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; } test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || as_fn_error $? "Your intltool is too old. You need intltool or later." "$LINENO" 5 fi # Extract the first word of "intltool-update", so it can be a program name with args. set dummy intltool-update; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_UPDATE+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_UPDATE in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_UPDATE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE if test -n "$INTLTOOL_UPDATE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_UPDATE" >&5 $as_echo "$INTLTOOL_UPDATE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "intltool-merge", so it can be a program name with args. set dummy intltool-merge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_MERGE+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_MERGE in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_MERGE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE if test -n "$INTLTOOL_MERGE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_MERGE" >&5 $as_echo "$INTLTOOL_MERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "intltool-extract", so it can be a program name with args. set dummy intltool-extract; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_EXTRACT+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_EXTRACT in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_EXTRACT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT if test -n "$INTLTOOL_EXTRACT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_EXTRACT" >&5 $as_echo "$INTLTOOL_EXTRACT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then as_fn_error $? "The intltool scripts were not found. Please install intltool." "$LINENO" 5 fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' INTLTOOL__v_MERGE_0='@echo " ITMRG " $@;' INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' intltool__v_merge_options_0='-q' INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< $@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< $@' else INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.$$RANDOM && mkdir $$_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u $$_it_tmp_dir $< $@ && rmdir $$_it_tmp_dir' fi INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 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 as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_PERL+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_PERL" >&5 $as_echo "$INTLTOOL_PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$INTLTOOL_PERL"; then as_fn_error $? "perl not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl >= 5.8.1" >&5 $as_echo_n "checking for perl >= 5.8.1... " >&6; } $INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 if test $? -ne 0; then as_fn_error $? "perl 5.8.1 is required for intltool" "$LINENO" 5 else IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IT_PERL_VERSION" >&5 $as_echo "$IT_PERL_VERSION" >&6; } fi if test "x" != "xno-xml"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML::Parser" >&5 $as_echo_n "checking for XML::Parser... " >&6; } if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else as_fn_error $? "XML::Parser perl module is required for intltool" "$LINENO" 5 fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&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 && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&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` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; 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 # Backslashify metacharacters that are still active within # double-quoted strings. 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 delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_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 do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_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_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_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 fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&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 yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&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 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&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 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) 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 : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&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* | cegcc*) # 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; ;; mint*) # On MiNT this can take a long time and run out of memory. 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; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # 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 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; 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" && \ test undefined != "$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 # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$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 cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&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 # that 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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; 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 ;; haiku*) 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])(-bit)?( [LM]SB)? 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) 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 ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi 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 test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # 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 bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # 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 for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&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]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' 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 # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # 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 # Try without a prefix underscore, 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. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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 <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_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 yes = "$pipe_works"; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_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 do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&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. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # 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 yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # 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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # 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 --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default 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 shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF 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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 _LT_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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 _LT_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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script 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 the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$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* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&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" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; 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= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # 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' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; 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 ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; 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' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # 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' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # 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='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; 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* | sunf77* | sunf90* | sunf95*) 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 case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&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" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; 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 # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&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 "$_lt_linker_boilerplate" | $SED '/^$/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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # 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= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # 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 yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [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 ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, 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 install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) 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 ;; esac ;; 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* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' 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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; 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 ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; 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* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' 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; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # 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; func_echo_all \"$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' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; 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; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; 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 case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; 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~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) 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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 <<_LT_EOF 1>&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. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 cannot *** 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 ;; *) # 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. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' 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 ;; 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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 no = "$ld_shlibs"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; 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. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_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 "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ 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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_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 "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ 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' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) 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 ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # 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. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper 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 `func_echo_all "$deplibs" | $SED '\''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' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all 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 ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=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 $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $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 no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=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 yes,no = "$GCC,$with_gnu_ld"; 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 $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $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' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $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 ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=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 yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) 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 ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; 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" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$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='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_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 archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $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 $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) 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' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $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 -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac 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 yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT 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='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; 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 ;; 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 if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # 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 yes,yes = "$GCC,$enable_shared"; 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 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\":${as_lineno-$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then 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; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) 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=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $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' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor 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* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc 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~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' 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="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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$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 # correct to gnu/linux during the next big refactor 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 ;; 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[23].*) 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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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;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' ;; 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 # correct to gnu/linux during the next big refactor 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=qnx 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='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; 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 # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 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 # correct to gnu/linux during the next big refactor 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=sco 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 shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; 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* | cegcc*) 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; 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 ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; 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 <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #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 /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; 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 <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #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 /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$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 striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&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" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "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" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&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 CC=$lt_save_CC if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 else _lt_caught_CXX_error=yes 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 archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # 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_CFLAGS=$CFLAGS 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++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; 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 no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&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 yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&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 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$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 yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -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 -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&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 ia64 = "$host_cpu"; 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive 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 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; 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 yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`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 "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX 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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`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 "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX 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' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' 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* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # 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_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' 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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; 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 ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all 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 yes != "$lt_cv_apple_cc_single_mod"; 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 ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes ;; 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 ;; freebsd2.*) # 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 ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; 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 "x$output_objdir/$soname" = "x$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) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; 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_direct_absolute_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; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; 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 $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $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" && func_echo_all "-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 yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$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=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | 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; func_echo_all "$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* | ecpc* ) # 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 case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols 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' ;; esac 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; func_echo_all \"$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=`func_echo_all "$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; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) 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; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # 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*) 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::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes 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__`"; 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=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | 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. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) 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" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) 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" && func_echo_all "-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' ;; esac 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=`func_echo_all "$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; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac 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 -v "^Configured with:" | $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* | sunCC*) # 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='func_echo_all' # 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 yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $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 $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -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 -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $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 $wl-h $wl$soname -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 -v "^Configured with:" | $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 CANNOT 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_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='$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,$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' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) 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 ;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # 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= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev 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 prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$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 no = "$pre_test_object_deps_done"; 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 CFLAGS=$_lt_libdeps_save_CFLAGS # 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= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac 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 lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # 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' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # 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' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; 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= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_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 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; 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_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 ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # 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_CXX='-DDLL_EXPORT' ;; 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 ia64 != "$host_cpu"; 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 | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' 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' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) 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*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; 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* | sunCC*) # 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 ;; 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 ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&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" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; 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 # # 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\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&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 "$_lt_linker_boilerplate" | $SED '/^$/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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # 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 yes,yes = "$GCC,$enable_shared"; 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 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\":${as_lineno-$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) 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=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $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' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor 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* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc 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~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' 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' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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$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 # correct to gnu/linux during the next big refactor 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 ;; 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[23].*) 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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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;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' ;; 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 # correct to gnu/linux during the next big refactor 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=qnx 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='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; 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 # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 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 # correct to gnu/linux during the next big refactor 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=sco 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 shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC 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 fi # test yes != "$_lt_caught_CXX_error" 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 ac_config_commands="$ac_config_commands libtool" # Only expand once: 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=6 QALCULATE_REVISION=0 QALCULATE_AGE=0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; 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 for ac_header in unordered_map do : ac_fn_cxx_check_header_mongrel "$LINENO" "unordered_map" "ac_cv_header_unordered_map" "$ac_includes_default" if test "x$ac_cv_header_unordered_map" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNORDERED_MAP 1 _ACEOF fi done 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags " glib-2.0 libxml-2.0 >= 2.3.8 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs " glib-2.0 libxml-2.0 >= 2.3.8 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 --print-errors --cflags --libs " glib-2.0 libxml-2.0 >= 2.3.8 " 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " glib-2.0 libxml-2.0 >= 2.3.8 " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 as_fn_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." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_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" "$LINENO" 5; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CLN" >&5 $as_echo_n "checking for CLN... " >&6; } if test -n "$CLN_CFLAGS"; then pkg_cv_CLN_CFLAGS="$CLN_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" cln >= 1.2 \""; } >&5 ($PKG_CONFIG --exists --print-errors " cln >= 1.2 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CLN_CFLAGS=`$PKG_CONFIG --cflags " cln >= 1.2 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CLN_LIBS"; then pkg_cv_CLN_LIBS="$CLN_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" cln >= 1.2 \""; } >&5 ($PKG_CONFIG --exists --print-errors " cln >= 1.2 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CLN_LIBS=`$PKG_CONFIG --libs " cln >= 1.2 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } 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 --print-errors --cflags --libs " cln >= 1.2 " 2>&1` else CLN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " cln >= 1.2 " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CLN_PKG_ERRORS" >&5 have_recent_cln=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_recent_cln=no else CLN_CFLAGS=$pkg_cv_CLN_CFLAGS CLN_LIBS=$pkg_cv_CLN_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_recent_cln=yes fi if test "$have_recent_cln" = "yes" ; then $as_echo "#define HAVE_RECENT_CLN 1" >>confdefs.h LIBS="$LIBS $CLN_LIBS" CPPFLAGS="$CPPFLAGS $CLN_CFLAGS" fi QALCULATE_TEXT="" LN_QALCULATE="" USE_READLINE="yes" READLINE_LIBS="" if test "x$enable_textport" = "xyes" ; then QALCULATE_TEXT="qalc" LN_QALCULATE="qalc" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use readline" >&5 $as_echo_n "checking whether to use readline... " >&6; } # Check whether --with-readline was given. if test "${with_readline+set}" = set; then : withval=$with_readline; case "${withval}" in yes) USE_READLINE="yes" ; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; no) USE_READLINE="no" ; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; only) USE_READLINE="yes" EXTRA_LIBREADLINE_DEPS=" " { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (using only readline)" >&5 $as_echo "yes (using only readline)" >&6; } ;; *) USE_READLINE="yes" EXTRA_LIBREADLINE_DEPS="${withval}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (using extra libraries ${withval})" >&5 $as_echo "yes (using extra libraries ${withval})" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${USE_READLINE}" >&5 $as_echo "${USE_READLINE}" >&6; } fi if test "$USE_READLINE" = yes ; then for ac_header in readline/readline.h readline/history.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find the headers for libreadline." >&5 $as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline -lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -lncurses" EXTRA_LIBREADLINE_DEPS=-lncurses $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h else unset ac_cv_lib_readline_readline { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline -lcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -lcurses" EXTRA_LIBREADLINE_DEPS=-lcurses $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h else unset ac_cv_lib_readline_readline { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline -ltermcap $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -ltermcap" EXTRA_LIBREADLINE_DEPS=-ltermcap $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h else unset ac_cv_lib_readline_readline { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h fi fi fi fi else unset ac_cv_lib_readline_readline { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline ${EXTRA_LIBREADLINE_DEPS} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline ${EXTRA_LIBREADLINE_DEPS}" $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h fi fi if test x${HAVE_LIBREADLINE} = xtrue; then READLINE_LIBS="-lreadline -lhistory ${EXTRA_LIBREADLINE_DEPS}" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find libreadline." >&5 $as_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5 $as_echo_n "checking for library containing nanosleep... " >&6; } if ${ac_cv_search_nanosleep+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 nanosleep (); int main () { return nanosleep (); ; return 0; } _ACEOF for ac_lib in '' rt posix4; 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 if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_nanosleep=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_nanosleep+:} false; then : break fi done if ${ac_cv_search_nanosleep+:} false; then : else ac_cv_search_nanosleep=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5 $as_echo "$ac_cv_search_nanosleep" >&6; } ac_res=$ac_cv_search_nanosleep if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" 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 : ac_fn_cxx_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" if test "x$ac_cv_header_locale_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LOCALE_H 1 _ACEOF fi done if test $ac_cv_header_locale_h = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 $as_echo_n "checking for LC_MESSAGES... " >&6; } if ${am_cv_val_LC_MESSAGES+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return LC_MESSAGES ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_val_LC_MESSAGES=yes else am_cv_val_LC_MESSAGES=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 $as_echo "$am_cv_val_LC_MESSAGES" >&6; } if test $am_cv_val_LC_MESSAGES = yes; then $as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h fi fi USE_NLS=yes gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= ac_fn_cxx_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" if test "x$ac_cv_header_libintl_h" = xyes; then : gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5 $as_echo_n "checking for ngettext in libc... " >&6; } if ${gt_cv_func_ngettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return !ngettext ("","", 1) ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : gt_cv_func_ngettext_libc=yes else gt_cv_func_ngettext_libc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_ngettext_libc" >&5 $as_echo "$gt_cv_func_ngettext_libc" >&6; } if test "$gt_cv_func_ngettext_libc" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5 $as_echo_n "checking for dgettext in libc... " >&6; } if ${gt_cv_func_dgettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return !dgettext ("","") ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : gt_cv_func_dgettext_libc=yes else gt_cv_func_dgettext_libc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5 $as_echo "$gt_cv_func_dgettext_libc" >&6; } fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then for ac_func in bind_textdomain_codeset do : ac_fn_cxx_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BIND_TEXTDOMAIN_CODESET 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5 $as_echo_n "checking for bindtextdomain in -lintl... " >&6; } if ${ac_cv_lib_intl_bindtextdomain+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_intl_bindtextdomain=yes else ac_cv_lib_intl_bindtextdomain=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5 $as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; } if test "x$ac_cv_lib_intl_bindtextdomain" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 $as_echo_n "checking for ngettext in -lintl... " >&6; } if ${ac_cv_lib_intl_ngettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_intl_ngettext=yes else ac_cv_lib_intl_ngettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 $as_echo "$ac_cv_lib_intl_ngettext" >&6; } if test "x$ac_cv_lib_intl_ngettext" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 $as_echo_n "checking for dgettext in -lintl... " >&6; } if ${ac_cv_lib_intl_dgettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_intl_dgettext=yes else ac_cv_lib_intl_dgettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5 $as_echo "$ac_cv_lib_intl_dgettext" >&6; } if test "x$ac_cv_lib_intl_dgettext" = xyes; then : gt_cv_func_dgettext_libintl=yes fi fi fi if test "$gt_cv_func_dgettext_libintl" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5 $as_echo_n "checking if -liconv is needed to use gettext... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 $as_echo_n "checking for ngettext in -lintl... " >&6; } if ${ac_cv_lib_intl_ngettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_intl_ngettext=yes else ac_cv_lib_intl_ngettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 $as_echo "$ac_cv_lib_intl_ngettext" >&6; } if test "x$ac_cv_lib_intl_ngettext" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5 $as_echo_n "checking for dcgettext in -lintl... " >&6; } if ${ac_cv_lib_intl_dcgettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_intl_dcgettext=yes else ac_cv_lib_intl_dcgettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5 $as_echo "$ac_cv_lib_intl_dcgettext" >&6; } if test "x$ac_cv_lib_intl_dcgettext" = xyes; 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 : ac_fn_cxx_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BIND_TEXTDOMAIN_CODESET 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 $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" for ac_func in dcgettext do : ac_fn_cxx_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext" if test "x$ac_cv_func_dcgettext" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi done MSGFMT_OPTS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking if msgfmt accepts -c" >&5 $as_echo_n "checking if msgfmt accepts -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 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$MSGFMT -c -o /dev/null conftest.foo"; } >&5 ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then MSGFMT_OPTS=-c; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : CATOBJEXT=.gmo DATADIRNAME=share else case $host in *-*-solaris*) ac_fn_cxx_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : CATOBJEXT=.gmo DATADIRNAME=share else CATOBJEXT=.mo DATADIRNAME=lib fi ;; *-*-openbsd*) CATOBJEXT=.mo DATADIRNAME=share ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac fi rm -f core conftest.err conftest.$ac_objext \ 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 $as_echo "#define ENABLE_NLS 1" >>confdefs.h fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5 $as_echo_n "checking for catalogs to be installed... " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking locale directory" >&5 $as_echo_n "checking locale directory... " >&6; } if test "x$prefix" = "xNONE"; then PACKAGE_LOCALE_DIR=$ac_default_prefix/share/locale else PACKAGE_LOCALE_DIR=$prefix/share/locale fi ac_fn_cxx_check_member "$LINENO" "struct lconv" "int_p_cs_precedes" "ac_cv_member_struct_lconv_int_p_cs_precedes" "$ac_includes_default #include " if test "x$ac_cv_member_struct_lconv_int_p_cs_precedes" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_LCONV_INT_P_CS_PRECEDES 1 _ACEOF fi ac_fn_cxx_check_member "$LINENO" "struct lconv" "int_n_cs_precedes" "ac_cv_member_struct_lconv_int_n_cs_precedes" "$ac_includes_default #include " if test "x$ac_cv_member_struct_lconv_int_n_cs_precedes" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_LCONV_INT_N_CS_PRECEDES 1 _ACEOF fi cat >>confdefs.h <<_ACEOF #define PACKAGE_LOCALE_DIR "$PACKAGE_LOCALE_DIR" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$PACKAGE_LOCALE_DIR\"" >&5 $as_echo "\"$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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; 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 if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_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=`$as_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. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi ac_config_commands="$ac_config_commands po/stamp-it" : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $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} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## 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=: # Pre-4.2 versions of Zsh do 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_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } 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.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac 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 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_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 || $as_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" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # 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 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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 libqalculate $as_me 0.9.10, which was generated by GNU Autoconf 2.69. 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 case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # 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_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent 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 the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libqalculate config.status 0.9.10 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 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' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. 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=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= 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 ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_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. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append 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 || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # 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 sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "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" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 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= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # 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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[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="$ac_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 || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append 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 '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; 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 || $as_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"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_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 || ac_write_fail=1 # 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= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 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 || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;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 " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_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 "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # 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 || $as_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) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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 || $as_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"` # 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'`; 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 || $as_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; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 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. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # 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 # 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//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # 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 # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # 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 into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # 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 # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # 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 # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # 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 # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # 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 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # 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 # 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 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # 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 a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # 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 # 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 DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # 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 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # 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 # 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 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # 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" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # 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 # 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 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # 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 a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # 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 # 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 DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_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 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # 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 # 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 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_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 # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; "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) if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then as_fn_error $? "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5 fi 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" sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r po/POTFILES } ' "po/Makefile.in" >"po/Makefile" rm -f "po/Makefile.tmp" mv "po/stamp-it.tmp" "po/stamp-it" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi libqalculate-0.9.10/config.guess0000755000175000017500000012367212461125176013524 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-11-04' # 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 3 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, see . # # 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . 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 1992-2014 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 case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # 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 tuples: *-*-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 -q __ELF__ 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 ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_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'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; 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 ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-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:*:[4567]) 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/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 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 -q __LP64__ 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:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-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 ;; 8664:Windows_NT:*) echo x86_64-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-${LIBC}`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/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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 -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${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-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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.[02]*:*) 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 i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-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; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' 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; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*) 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 ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku 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 eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi 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 ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} 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 ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac 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.10/README0000644000175000017500000001072012724503167012053 00000000000000Qalculate! library and CLI Qalculate! is a multi-purpose desktop calculator for GNU/Linux (and Mac OS). It is small and simple to use but with much power and versatility underneath. Features include customizable functions, units, arbitrary precision, plotting, and a user-friendly interface (GTK+ and CLI). 1. Installation In a terminal window in the top source code directory run ./autogen.sh (not required if using a release source tarball, only if using the git version) ./configure make make install 2. Requirements * CLN - Class Library for Numbers (http://www.ginac.de/CLN/) * Libxml2 (>= 2.3.8) * Glib * Gnuplot 1.7 (optional, for plotting) * GVfs or GNU Wget (optional, for retrieval of exchange rates) 3. API Documentation The API documentation is included in the package and is installed in $docdir/libqalculate/html (usually /usr/share/doc/libqalculate/html). It is generated when running autogen.sh. It is also available online at http://qalculate.github.io/reference/index.html. 4. Using the CLI program 'qalc' To calculate a single expression from the command line (non-interactive mode) enter `qalc mathematical expression` (e.g. qalc 5+2) `qalc --help` shows information about command line options in non-interactive mode. If you run `qalc` without any mathematical expression the program will start in interactive mode, where you can enter multiple expressions with history and completion, manipulate the result and change settings. Type `help` in interactive mode for more information. 5. Other Applications The main user interface for libqalculate is qalculate-gtk (https://github.com/Qalculate/qalculate-gtk). Other software using libqalculate include * KDE Plasma Workspace (https://www.kde.org/workspaces/plasmadesktop/) * Cantor (http://kde.org/applications/education/cantor/) * Step (http://kde.org/applications/education/step/) 6. Features * Calculation and parsing: * Basic operations and operators: + - * / ^ E () && || ! < > >= <= != ~ & | << >> * Fault-tolerant parsing of strings: log 5 / 2 .5 (3) + (2( 3 +5 = ln(5) / (2.5 * 3) + 2 * (3 + 5) * Supports complex and infinite numbers * Supports all number bases from 2 to 36, time format and roman numerals * Ability to disable functions, variables, units or unknown variables for less confusion: ex. when you do not want (a+b)^2 to mean (are+barn)^2 but ("a"+"b")^2 * Controllable implicit multiplication * Matrices and vectors, and related operations (determinants etc.) * Verbose error messages * Arbitrary precision * RPN mode * Result display: * Supports all number bases from 2 to 36, plus sexagesimal numbers, time format and roman numerals * Many customization options: precision, max/min decimals, multiplication sign, etc. * Exact or approximate * Fractions: 4 / 6 * 2 = 1.333... = 4/3 = 1 + 1/3 * Symbolic calculation: * Ex. (x + y)^2 = x^2 + 2xy + y^2; 4 "apples" + 3 "oranges" * Factorization and simplification * Differentiation and integration * Can solve most equations and inequalities * Customizable assumptions give different results (ex. ln(2x) = ln(2) + ln(x) if x is assumed positive) * Functions: * All the usual functions: sine, log, etc... : ln 5 = 1.609; sqrt(tan(20) - 5) = sqrt(-2.76283905578) * Lots of statistical, financial, geometrical, and more functions (approx. 200) * If..then..else function, optional arguments and more features for flexible function creation * Can easily be created, edit and saved to a standard XML file * Units: * Supports all SI units and prefixes (including binary), as well as imperial and other unit systems * Automatic conversion: ft + yd + m = 2.2192 m * Implicit conversion: 5m/s to mi/h = 11.18 miles/hour * Smart conversion: can automatically convert 5 kg*m/s^2 to 5 newton * Currency conversion with retrieval of daily exchange rates * Different name forms: abbreviation, singular, plural (m, meter, meters) * Can easily be created, edit and saved to a standard XML file * Variables and constants: * Basic constants: pi, e * Lots of physical constants and elements * CSV file import and export * Can easily be created, edit and saved to a standard XML file * Flexible, can contain simple numbers, units or whole expressions * Data sets with objects and associated properties in database-like structure * Plotting: * Uses Gnuplot * Can plot functions or data (matrices and vectors) * Ability to save plot to PNG image, postscript, etc. * Several customization options * and more... libqalculate-0.9.10/AUTHORS0000644000175000017500000000004412723757366012254 00000000000000Hanna Knutsson libqalculate-0.9.10/src/0000755000175000017500000000000012757636737012062 500000000000000libqalculate-0.9.10/src/Makefile.in0000644000175000017500000005311712757636732014051 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_defs2doc_OBJECTS = defs2doc.$(OBJEXT) defs2doc_OBJECTS = $(am_defs2doc_OBJECTS) defs2doc_DEPENDENCIES = ../libqalculate/libqalculate.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_qalc_OBJECTS = qalc.$(OBJEXT) qalc_OBJECTS = $(am_qalc_OBJECTS) qalc_DEPENDENCIES = ../libqalculate/libqalculate.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(defs2doc_SOURCES) $(qalc_SOURCES) DIST_SOURCES = $(defs2doc_SOURCES) $(qalc_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 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_CLAGS = @CLN_CLAGS@ 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@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ 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_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/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 $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list defs2doc$(EXEEXT): $(defs2doc_OBJECTS) $(defs2doc_DEPENDENCIES) $(EXTRA_defs2doc_DEPENDENCIES) @rm -f defs2doc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(defs2doc_OBJECTS) $(defs2doc_LDADD) $(LIBS) qalc$(EXEEXT): $(qalc_OBJECTS) $(qalc_DEPENDENCIES) $(EXTRA_qalc_DEPENDENCIES) @rm -f qalc$(EXEEXT) $(AM_V_CXXLD)$(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@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am 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 tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile #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.10/src/Makefile.am0000644000175000017500000000113112711115372014003 00000000000000# # src/Makefile.am for qalculate # AM_CPPFLAGS = \ -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.10/src/qalc.cc0000644000175000017500000042307112756774625013236 00000000000000/* Qalculate (CLI) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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 #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; int auto_update_exchange_rates; 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 use_readline = true; bool interactive_mode; bool ask_questions; bool result_only; fd_set in_set; struct timeval timeout; char buffer[1000]; void *view_proc(void *pipe); void setResult(Prefix *prefix = NULL, bool update_parse = false, bool goto_input = true, size_t stack_index = 0, bool register_moved = false, bool noprint = false); 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, bool show_result = true); 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);*/ return unicode_length(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, bool default_answer = false) { 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 if(str.empty()) { return default_answer; } 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; } bool check_exchange_rates() { if(!CALCULATOR->exchangeRatesUsed()) return false; if(CALCULATOR->checkExchangeRatesDate(auto_update_exchange_rates > 0 ? auto_update_exchange_rates : 7, false, auto_update_exchange_rates == 0 || (auto_update_exchange_rates < 0 && !ask_questions))) return false; if(auto_update_exchange_rates == 0 || (auto_update_exchange_rates < 0 && !ask_questions)) return false; bool b = false; if(auto_update_exchange_rates < 0) { char buffer[1000]; string ask_str; int cx = snprintf(buffer, 1000, _("It has been %s day(s) since the exchange rates last were updated."), i2s((int) floor(difftime(time(NULL), CALCULATOR->getExchangeRatesTime()) / 86400)).c_str()); if(cx >= 0 && cx < 1000) { ask_str = buffer; ask_str += "\n"; } ask_str += _("Do you wish to update the exchange rates now?"); b = ask_question(ask_str.c_str()); } if(b || auto_update_exchange_rates > 0) { CALCULATOR->fetchExchangeRates(15); CALCULATOR->loadExchangeRates(); return true; } return false; } #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 {int rows = 50, cols = 80, rcount = 0;} #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 parentheses", _("excessive parentheses"))) 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, "parsing mode", _("parsing mode"))) { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "adaptive", _("adaptive"))) v = PARSING_MODE_ADAPTIVE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "implicit first", _("implicit first"))) v = PARSING_MODE_IMPLICIT_MULTIPLICATION_FIRST; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "conventional", _("conventional"))) v = PARSING_MODE_CONVENTIONAL; 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.parsing_mode = (ParsingMode) v; expression_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "update exchange rates", _("update exchange rates"))) { if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "never", _("never"))) { auto_update_exchange_rates = 0; } else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "ask", _("ask"))) { auto_update_exchange_rates = -1; } else { int v = s2i(svalue); if(v < 0) auto_update_exchange_rates = -1; else auto_update_exchange_rates = v; } } 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, "optimal", _("optimal"))) 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.")); } } #define STR_AND_TABS(x) str = x; pctl = unicode_length_check(x); if(pctl >= 32) {str += "\t";} else if(pctl >= 24) {str += "\t\t";} else if(pctl >= 16) {str += "\t\t\t";} else if(pctl >= 8) {str += "\t\t\t\t";} else {str += "\t\t\t\t\t";} #define PRINT_AND_COLON_TABS(x) FPUTS_UNICODE(x, stdout); pctl = unicode_length_check(x); if(pctl >= 32) fputs("\t", stdout); else if(pctl >= 24) fputs("\t\t", stdout); else if(pctl >= 16) fputs("\t\t\t", stdout); else if(pctl >= 8) fputs("\t\t\t\t", stdout); else fputs("\t\t\t\t\t", stdout); #define PUTS_BOLD(x) str = "\033[1m"; str += x; str += "\033[0m"; puts(str.c_str()); void list_defs(bool in_interactive, char list_type = 0) { int rows, cols, rcount = 0; #ifdef HAVE_LIBREADLINE if(in_interactive && !cfile) { rl_get_screen_size(&rows, &cols); cout << cols << endl; } else { cols = 80; } #else cols = 80; rows = 50; #endif string str; if(list_type == 0) { puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED;} bool b_variables = false, b_functions = false, b_units = false; for(size_t i = 0; i < CALCULATOR->variables.size(); i++) { Variable *v = CALCULATOR->variables[i]; if((v->isLocal() || v->hasChanged()) && v->isActive() && (!is_answer_variable(v) || !v->representsUndefined())) { int pctl; if(!b_variables) { b_variables = true; PUTS_BOLD(_("Variables:")); if(in_interactive) {CHECK_IF_SCREEN_FILLED} STR_AND_TABS(_("Name")) str += _("Value"); PUTS_UNICODE(str.c_str()); if(in_interactive) {CHECK_IF_SCREEN_FILLED} } STR_AND_TABS(v->preferredInputName(false, false).name.c_str()) FPUTS_UNICODE(str.c_str(), stdout); string value; 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"); } } FPUTS_UNICODE(value.c_str(), stdout); if(v->isApproximate()) { fputs(" (", stdout); FPUTS_UNICODE(_("approximate"), stdout); fputs(")", stdout); } puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} } } for(size_t i = 0; i < CALCULATOR->functions.size(); i++) { MathFunction *f = CALCULATOR->functions[i]; if((f->isLocal() || f->hasChanged()) && f->isActive()) { if(!b_functions) { if(b_variables) puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} if(in_interactive) {CHECK_IF_SCREEN_FILLED} b_functions = true; PUTS_BOLD(_("Functions:")); } puts(f->preferredInputName(false, false).name.c_str()); if(in_interactive) {CHECK_IF_SCREEN_FILLED} } } for(size_t i = 0; i < CALCULATOR->units.size(); i++) { Unit *u = CALCULATOR->units[i]; if((u->isLocal() || u->hasChanged()) && u->isActive()) { if(!b_units) { if(b_variables || b_functions) puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} if(in_interactive) {CHECK_IF_SCREEN_FILLED} b_units = true; PUTS_BOLD(_("Units:")); } puts(u->preferredInputName(false, false).name.c_str()); if(in_interactive) {CHECK_IF_SCREEN_FILLED} } } if(!b_variables && !b_functions && !b_units) { puts(_("No local variables, functions or units have been defined.")); if(in_interactive) {CHECK_IF_SCREEN_FILLED} } puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} puts(_("For more information about a specific function, variable or unit, please use the info command (in interactive mode).")); if(in_interactive) {CHECK_IF_SCREEN_FILLED} puts(""); } else { int max_l = 0; list name_list; int i_end = 0; if(list_type == 'f') i_end = CALCULATOR->functions.size(); if(list_type == 'v') i_end = CALCULATOR->variables.size(); if(list_type == 'u') i_end = CALCULATOR->units.size(); ExpressionItem *item = NULL; string name_str, name_str2; for(int i = 0; i < i_end; i++) { if(list_type == 'f') item = CALCULATOR->functions[i]; if(list_type == 'v') item = CALCULATOR->variables[i]; if(list_type == 'u') item = CALCULATOR->units[i]; if(!item->isHidden() && item->isActive() && (list_type != 'u' || item->subtype() != SUBTYPE_COMPOSITE_UNIT)) { const ExpressionName &ename1 = item->preferredInputName(false, false); name_str = ename1.name; size_t name_i = 1; while(true) { const ExpressionName &ename = item->getName(name_i); if(ename == empty_expression_name) break; if(ename != ename1 && !ename.avoid_input && !ename.plural && (!ename.unicode || printops.use_unicode_signs)) { name_str += " / "; name_str += ename.name; } name_i++; } if((int) name_str.length() > max_l) max_l = name_str.length(); name_list.push_front(name_str); } } name_list.sort(); list::iterator it = name_list.begin(); list::iterator it_e = name_list.end(); int c = 0; int max_tabs = (max_l / 8) + 1; int max_c = cols / (max_tabs * 8); if(cfile) max_c = 0; while(it != it_e) { c++; if(c >= max_c) { c = 0; PUTS_UNICODE(it->c_str()); } else { if(c == 1 && in_interactive) {CHECK_IF_SCREEN_FILLED} int l = unicode_length_check(it->c_str()); int nr_of_tabs = max_tabs - (l / 8); for(int tab_nr = 0; tab_nr < nr_of_tabs; tab_nr++) { *it += "\t"; } FPUTS_UNICODE(it->c_str(), stdout); } ++it; } if(c > 0) puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} puts(_("For more information about a specific function, variable or unit, please use the info command (in interactive mode).")); if(in_interactive) {CHECK_IF_SCREEN_FILLED} puts(""); } } int main(int argc, char *argv[]) { string calc_arg; vector set_option_strings; bool calc_arg_begun = false; string command_file; cfile = NULL; interactive_mode = 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; fetch_exchange_rates_at_startup = false; char list_type = 'n'; #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); #endif setlocale(LC_ALL, ""); 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-b, -base", stdout); fputs(" ", stdout); FPUTS_UNICODE(_("BASE"), stdout); fputs("\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("set the result number base")); fputs("\n\t-e, -exrates\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("update exchange rates")); 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-i, -interactive\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("start in interactive mode")); fputs("\n\t-l, -list\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("displays a list of all user-defined variables, functions and units.")); fputs("\n\t--list-functions\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("displays a list of all functions.")); fputs("\n\t--list-units\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("displays a list of all units.")); fputs("\n\t--list-variables\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("displays a list of all variables.")); 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")); 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-s, -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-/+u8\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("turn on/off unicode support")); puts(""); PUTS_UNICODE(_("The program will start in interactive mode if no expression and no file is specified (or interactive mode is explicitly selected).")); 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], "-exrates") == 0 || strcmp(argv[i], "--exrates") == 0 || strcmp(argv[i], "-e") == 0)) { fetch_exchange_rates_at_startup = true; } else if(!calc_arg_begun && (strcmp(argv[i], "-base") == 0 || strcmp(argv[i], "--base") == 0 || strcmp(argv[i], "-b") == 0)) { i++; string set_base_str = "base "; if(i < argc) { set_base_str += argv[i]; } set_option_strings.push_back(set_base_str); } 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], "-interactive") == 0 || strcmp(argv[i], "--interactive") == 0 || strcmp(argv[i], "-i") == 0)) { interactive_mode = true; } else if(!calc_arg_begun && (strcmp(argv[i], "-list") == 0 || strcmp(argv[i], "--list") == 0 || strcmp(argv[i], "-l") == 0)) { list_type = 0; } else if(!calc_arg_begun && strcmp(argv[i], "--list-functions") == 0) { list_type = 'f'; } else if(!calc_arg_begun && strcmp(argv[i], "--list-units") == 0) { list_type = 'u'; } else if(!calc_arg_begun && strcmp(argv[i], "--list-variables") == 0) { list_type = 'v'; } 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 || strcmp(argv[i], "-s") == 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; } } 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 ask_questions = (command_file.empty() || interactive_mode) && !result_only; //exchange rates if(fetch_exchange_rates_at_startup && canfetch) { CALCULATOR->fetchExchangeRates(15); } if(load_global_defs && load_currencies) { if(!fetch_exchange_rates_at_startup && first_qalculate_run && canfetch && ask_questions) { 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)?"), true)) { CALCULATOR->fetchExchangeRates(15); } } CALCULATOR->setExchangeRatesWarningEnabled(!interactive_mode && (!command_file.empty() || (result_only && !calc_arg.empty()))); 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(); if(list_type != 'n') { CALCULATOR->terminateThreads(); list_defs(false, list_type); return 0; } //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(!interactive_mode) { pthread_cancel(view_thread); CALCULATOR->terminateThreads(); return 0; } } } } 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 { use_readline = false; execute_expression(interactive_mode); } if(!interactive_mode) { pthread_cancel(view_thread); CALCULATOR->terminateThreads(); return 0; } use_readline = true; } else if(!cfile) { ask_questions = !result_only; interactive_mode = true; } #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(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(interactive_mode); } } if(!interactive_mode) break; 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 (default: no)?")); char *cstr = (char*) malloc(sizeof(char) * (l + 1)); snprintf(cstr, l, _("Illegal name. Save as %s instead (default: no)?"), 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 (default: no)?"))) { 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, "delete", _("delete"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); Variable *v = CALCULATOR->getActiveVariable(str); if(v && v->isLocal()) { v->destroy(); } else { PUTS_UNICODE(_("No user-defined variable with the specified name exist.")); } //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(equalsIgnoreCase(str, "hex") || EQUALS_IGNORECASE_AND_LOCAL(str, "hexadecimal", _("hexadecimal"))) { int save_base = printops.base; printops.base = BASE_HEXADECIMAL; setResult(NULL, false); printops.base = save_base; } else if(equalsIgnoreCase(str, "bin") || EQUALS_IGNORECASE_AND_LOCAL(str, "binary", _("binary"))) { int save_base = printops.base; printops.base = BASE_BINARY; setResult(NULL, false); printops.base = save_base; } else if(equalsIgnoreCase(str, "oct") || EQUALS_IGNORECASE_AND_LOCAL(str, "octal", _("octal"))) { int save_base = printops.base; printops.base = BASE_OCTAL; setResult(NULL, false); printops.base = save_base; } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "bases", _("bases"))) { int save_base = printops.base; string save_result_text = result_text; string base_str = "\n "; base_str += result_text; if(save_base != BASE_BINARY) { base_str += " = "; printops.base = BASE_BINARY; setResult(NULL, false, true, 0, false, true); base_str += result_text; } if(save_base != BASE_OCTAL) { base_str += " = "; printops.base = BASE_OCTAL; setResult(NULL, false, true, 0, false, true); base_str += result_text; } if(save_base != BASE_DECIMAL) { base_str += " = "; printops.base = BASE_DECIMAL; setResult(NULL, false, true, 0, false, true); base_str += result_text; } if(save_base != BASE_HEXADECIMAL) { base_str += " = "; printops.base = BASE_HEXADECIMAL; setResult(NULL, false, true, 0, false, true); base_str += result_text; } base_str += "\n"; PUTS_UNICODE(base_str.c_str()); printops.base = save_base; result_text = save_result_text; } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "fraction", _("fraction"))) { NumberFractionFormat save_format = printops.number_fraction_format; if(mstruct->isNumber()) printops.number_fraction_format = FRACTION_COMBINED; else printops.number_fraction_format = FRACTION_FRACTIONAL; setResult(NULL, false); printops.number_fraction_format = save_format; } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "factors", _("factors"))) { execute_command(COMMAND_FACTORIZE); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "best", _("best")) || EQUALS_IGNORECASE_AND_LOCAL(str, "optimal", _("optimal"))) { CALCULATOR->resetExchangeRatesUsed(); MathStructure mstruct_new(CALCULATOR->convertToBestUnit(*mstruct, evalops)); if(check_exchange_rates()) mstruct->set(CALCULATOR->convertToBestUnit(*mstruct, evalops)); else mstruct->set(mstruct_new); result_action_executed(); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "base", _("base"))) { CALCULATOR->resetExchangeRatesUsed(); MathStructure mstruct_new(CALCULATOR->convertToBaseUnits(*mstruct, evalops)); if(check_exchange_rates()) mstruct->set(CALCULATOR->convertToBaseUnits(*mstruct, evalops)); else mstruct->set(mstruct_new); result_action_executed(); } else { CALCULATOR->resetExchangeRatesUsed(); MathStructure mstruct_new(CALCULATOR->convert(*mstruct, str, evalops)); if(check_exchange_rates()) mstruct->set(CALCULATOR->convert(*mstruct, str, evalops)); else mstruct->set(mstruct_new); 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; 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(_("optimal")); 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 parentheses")); 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(_("parsing mode")); switch(evalops.parse_options.parsing_mode) { case PARSING_MODE_ADAPTIVE: {PUTS_UNICODE(_("adaptive")); break;} case PARSING_MODE_IMPLICIT_MULTIPLICATION_FIRST: {PUTS_UNICODE(_("implicit first")); break;} case PARSING_MODE_CONVENTIONAL: {PUTS_UNICODE(_("conventional")); 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(_("update exchange rates")); switch(auto_update_exchange_rates) { case -1: {PUTS_UNICODE(_("ask")); break;} case 0: {PUTS_UNICODE(_("never")); break;} default: {printf("%i\n", auto_update_exchange_rates); break;} } 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 == "?") { INIT_SCREEN_CHECK puts(""); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("Enter a mathematical expression or a command and press enter.")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("Complete functions, units and variables with the tabulator key.")); CHECK_IF_SCREEN_FILLED puts(""); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("Available commands are:")); CHECK_IF_SCREEN_FILLED puts(""); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("approximate")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("assume"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("ASSUMPTIONS")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("base"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("BASE")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("clear stack")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("delete"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("NAME")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("exact")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("exrates"), stdout); if(!CALCULATOR->hasGVFS()) { fputs(" ", stdout); FPUTS_UNICODE("[", stdout); fputs(_("WGET ARGUMENTS"), stdout); FPUTS_UNICODE("]", stdout); } puts(""); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("factor")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("info")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("list")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("mode")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("rpn"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("ON/OFF")); CHECK_IF_SCREEN_FILLED 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(_("TITLE"), stdout); PUTS_UNICODE("]"); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("save definitions")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("save mode")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("set"), stdout); fputs(" ", stdout); FPUTS_UNICODE(_("OPTION"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("VALUE")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("simplify")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("stack")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("to"), stdout); fputs("/", stdout); FPUTS_UNICODE(_("convert"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("UNIT or \"TO\" COMMAND")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("quit"), stdout); fputs("/", stdout); PUTS_UNICODE(_("exit")); CHECK_IF_SCREEN_FILLED_PUTS(""); PUTS_UNICODE(_("Type help COMMAND for more information (example: help save).")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("Type info NAME for information about a function, variable or unit (example: info sin).")); CHECK_IF_SCREEN_FILLED_PUTS(""); PUTS_UNICODE(_("For more information about mathematical expression, different options, and a complete list of functions, variables and units, see the relevant sections in the manual of the graphical user interface (available at http://qalculate.github.io/manual/index.html).")); puts(""); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "list", _("list"))) { list_defs(true); } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "list", _("list"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); char list_type = 0; if(EQUALS_IGNORECASE_AND_LOCAL(str, "functions", _("functions"))) list_type = 'f'; if(EQUALS_IGNORECASE_AND_LOCAL(str, "variables", _("variables"))) list_type = 'v'; if(EQUALS_IGNORECASE_AND_LOCAL(str, "units", _("units"))) list_type = 'u'; list_defs(true, list_type); //qalc command } 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 >= 23) fputs(":\t", stdout); else if(pctl >= 15) fputs(":\t\t", stdout); else if(pctl >= 7) fputs(":\t\t\t", stdout); else fputs(":\t\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_BOOL(s, v) STR_AND_TABS(s); str += "("; str += _("on"); if(v) {str += "*";} str += ", "; str += _("off"); if(!v) {str += "*";} str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); #define STR_AND_TABS_YESNO(s, v) STR_AND_TABS(s); str += "("; str += _("yes"); if(v) {str += "*";} str += ", "; str += _("no"); if(!v) {str += "*";} str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); #define STR_AND_TABS_2(s, v, s0, s1, s2) STR_AND_TABS(s); str += "(0"; if(v == 0) {str += "*";} str += " = "; str += s0; str += ", 1"; if(v == 1) {str += "*";} str += " = "; str += s1; str += ", 2"; if(v == 2) {str += "*";} str += " = "; str += s2; str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); #define STR_AND_TABS_3(s, v, s0, s1, s2, s3) STR_AND_TABS(s); str += "(0"; if(v == 0) {str += "*";} str += " = "; str += s0; str += ", 1"; if(v == 1) {str += "*";} str += " = "; str += s1; str += ", 2"; if(v == 2) {str += "*";} str += " = "; str += s2; str += ", 2"; if(v == 3) {str += "*";} str += " = "; str += s3; str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); 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_BOOL(_("abbreviations"), printops.abbreviate_names); STR_AND_TABS_2(_("algebra mode"), evalops.structuring, _("none"), _("simplify"), _("factorize")); STR_AND_TABS_BOOL(_("all prefixes"), printops.use_all_prefixes); STR_AND_TABS_3(_("angle unit"), evalops.parse_options.angle_unit, _("none"), _("radians"), _("degrees"), _("gradians")); STR_AND_TABS_2(_("approximation"), evalops.approximation, _("exact"), _("try exact"), _("approximate")); STR_AND_TABS_BOOL(_("assume nonzero denominators"), evalops.assume_denominators_nonzero); STR_AND_TABS_BOOL(_("warn nonzero denominators"), evalops.warn_about_denominators_assumed_nonzero); Assumptions *ass = CALCULATOR->defaultAssumptions(); STR_AND_TABS(_("assumptions")); str += "("; str += _("unknown"); if(ass->sign() == ASSUMPTION_SIGN_UNKNOWN) str += "*"; str += ", "; str += _("non-zero"); if(ass->sign() == ASSUMPTION_SIGN_NONZERO) str += "*"; str += ", "; str += _("positive"); if(ass->sign() == ASSUMPTION_SIGN_POSITIVE) str += "*"; str += ", "; str += _("negative"); if(ass->sign() == ASSUMPTION_SIGN_NEGATIVE) str += "*"; str += ", "; str += _("non-positive"); if(ass->sign() == ASSUMPTION_SIGN_NONPOSITIVE) str += "*"; str += ", "; str += _("non-negative"); if(ass->sign() == ASSUMPTION_SIGN_NONNEGATIVE) str += "*"; str += " +\n"; str += "\t\t\t\t\t "; str += _("unknown"); if(ass->type() == ASSUMPTION_TYPE_NONE) str += "*"; str += ", "; str += _("non-matrix"); if(ass->type() == ASSUMPTION_TYPE_NONMATRIX) str += "*"; str += ", "; str += _("number"); if(ass->type() == ASSUMPTION_TYPE_NUMBER) str += "*"; str += ", "; str += _("complex"); if(ass->type() == ASSUMPTION_TYPE_COMPLEX) str += "*"; str += ", "; str += _("real"); if(ass->type() == ASSUMPTION_TYPE_REAL) str += "*"; str += ", "; str += _("rational"); if(ass->type() == ASSUMPTION_TYPE_RATIONAL) str += "*"; str += ", "; str += _("integer"); if(ass->type() == ASSUMPTION_TYPE_INTEGER) str += "*"; str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_2(_("autoconversion"), evalops.auto_post_conversion, _("none"), _("optimal"), _("base")); STR_AND_TABS(_("base")); str += "(2 - 36"; str += ", "; str += _("bin"); if(printops.base == BASE_BINARY) str += "*"; str += ", "; str += _("oct"); if(printops.base == BASE_OCTAL) str += "*"; str += ", "; str += _("dec"); if(printops.base == BASE_DECIMAL) str += "*"; str += ", "; str += _("hex"); if(printops.base == BASE_HEXADECIMAL) str += "*"; str += ", "; str += _("sex"); if(printops.base == BASE_SEXAGESIMAL) str += "*"; str += ", "; str += _("time"); if(printops.base == BASE_TIME) str += "*"; str += ", "; str += _("roman"); if(printops.base == BASE_ROMAN_NUMERALS) str += "*"; str += ")"; if(printops.base > 2 && printops.base <= 36 && printops.base != BASE_OCTAL && printops.base != BASE_DECIMAL && printops.base != BASE_HEXADECIMAL) {str += " "; str += i2s(printops.base); str += "*";} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_2(_("base display"), printops.base_display, _("none"), _("normal"), _("alternative")); STR_AND_TABS_BOOL(_("calculate functions"), evalops.calculate_functions); STR_AND_TABS_BOOL(_("calculate variables"), evalops.calculate_variables); STR_AND_TABS_BOOL(_("complex numbers"), evalops.allow_complex); STR_AND_TABS_BOOL(_("denominator prefixes"), printops.use_denominator_prefix); STR_AND_TABS_2(_("division sign"), printops.division_sign, "/", SIGN_DIVISION_SLASH, SIGN_DIVISION); STR_AND_TABS_BOOL(_("dot as separator"), evalops.parse_options.dot_as_separator); STR_AND_TABS_BOOL(_("exact"), (evalops.approximation == APPROXIMATION_EXACT)); STR_AND_TABS_BOOL(_("excessive parentheses"), printops.excessive_parenthesis); STR_AND_TABS(_("exp mode")); str += "("; str += _("off"); if(printops.min_exp == EXP_NONE) str += "*"; str += ", "; str += _("auto"); if(printops.min_exp == EXP_PRECISION) str += "*"; str += ", "; str += _("engineering"); if(printops.min_exp == EXP_BASE_3) str += "*"; str += ", "; str += _("pure"); if(printops.min_exp == EXP_PURE) str += "*"; str += ", "; str += _("scientific"); if(printops.min_exp == EXP_SCIENTIFIC) str += "*"; str += ", >= 0)"; if(printops.min_exp != EXP_NONE && printops.min_exp != EXP_NONE && printops.min_exp != EXP_PRECISION && printops.min_exp != EXP_BASE_3 && printops.min_exp != EXP_PURE && printops.min_exp != EXP_SCIENTIFIC) {str += " "; str += i2s(printops.min_exp); str += "*";} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_3(_("fractions"), printops.number_fraction_format, _("off"), _("exact"), _("on"), _("combined")); STR_AND_TABS_BOOL(_("functions"), evalops.parse_options.functions_enabled); STR_AND_TABS(_("input base")); str += "(2 - 36"; str += ", "; str += _("bin"); if(evalops.parse_options.base == BASE_BINARY) str += "*"; str += ", "; str += _("oct"); if(evalops.parse_options.base == BASE_OCTAL) str += "*"; str += ", "; str += _("dec"); if(evalops.parse_options.base == BASE_DECIMAL) str += "*"; str += ", "; str += _("hex"); if(evalops.parse_options.base == BASE_HEXADECIMAL) str += "*"; str += ", "; str += _("roman"); if(evalops.parse_options.base == BASE_ROMAN_NUMERALS) str += "*"; str += ")"; if(evalops.parse_options.base > 2 && evalops.parse_options.base != BASE_OCTAL && evalops.parse_options.base != BASE_DECIMAL && evalops.parse_options.base != BASE_HEXADECIMAL) {str += " "; str += i2s(evalops.parse_options.base); str += "*";} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_BOOL(_("infinite numbers"), evalops.allow_infinite); STR_AND_TABS_BOOL(_("indicate infinite series"), printops.indicate_infinite_series); STR_AND_TABS_BOOL(_("limit implicit multiplication"), evalops.parse_options.limit_implicit_multiplication); STR_AND_TABS_BOOL(_("lowercase e"), printops.lower_case_e); STR_AND_TABS_BOOL(_("lowercase numbers"), printops.lower_case_numbers); STR_AND_TABS(_("max decimals")); str += "("; str += _("off"); if(printops.max_decimals < 0) str += "*"; str += ", >= 0)"; if(printops.max_decimals >= 0) {str += " "; str += i2s(printops.max_decimals); str += "*";} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS(_("min decimals")); str += "("; str += _("off"); if(printops.min_decimals < 0) str += "*"; str += ", >= 0)"; if(printops.min_decimals >= 0) {str += " "; str += i2s(printops.min_decimals); str += "*";} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_2(_("multiplication sign"), printops.multiplication_sign, "*", SIGN_MULTIDOT, SIGN_MULTIPLICATION); STR_AND_TABS_2(_("parsing mode"), evalops.parse_options.parsing_mode, _("adaptive"), _("implicit first"), _("conventional")); STR_AND_TABS_BOOL(_("place units separately"), printops.place_units_separately); STR_AND_TABS(_("precision")); str += "(> 0) "; str += i2s(CALCULATOR->getPrecision()); str += "*"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_BOOL(_("prefixes"), printops.use_unit_prefixes); STR_AND_TABS_2(_("read precision"), evalops.parse_options.read_precision, _("off"), _("always"), _("when decimals")) STR_AND_TABS_BOOL(_("round to even"), printops.round_halfway_to_even); STR_AND_TABS_BOOL(_("rpn"), rpn_mode); STR_AND_TABS_BOOL(_("rpn syntax"), evalops.parse_options.rpn); STR_AND_TABS_YESNO(_("save definitions"), save_defs_on_exit); STR_AND_TABS_YESNO(_("save mode"), save_mode_on_exit); STR_AND_TABS_BOOL(_("show ending zeroes"), printops.show_ending_zeroes); STR_AND_TABS_BOOL(_("show negative exponents"), printops.negative_exponents); STR_AND_TABS_BOOL(_("short multiplication"), printops.short_multiplication); STR_AND_TABS_BOOL(_("spacious"), printops.spacious); STR_AND_TABS_BOOL(_("spell out logical"), printops.spell_out_logical_operators); STR_AND_TABS_BOOL(_("sync units"), evalops.sync_units); STR_AND_TABS_BOOL(_("unicode"), printops.use_unicode_signs); STR_AND_TABS_BOOL(_("units"), evalops.parse_options.units_enabled); STR_AND_TABS_BOOL(_("unknowns"), evalops.parse_options.unknowns_enabled); STR_AND_TABS(_("update exchange rates")); str += "(-1 = "; str += _("ask"); if(auto_update_exchange_rates < 0) str += "*"; str += ", 0 = "; str += _("never"); if(auto_update_exchange_rates == 0) str += "*"; str += ", > 0 = "; str += _("days"); str += ")"; if(auto_update_exchange_rates > 0) {str += " "; str += i2s(auto_update_exchange_rates); str += "*";} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_BOOL(_("variables"), evalops.parse_options.variables_enabled); CHECK_IF_SCREEN_FILLED_PUTS(_("The current value is marked with '*'.")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Example: set base 16.")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Some options have additional help text (e.g. help parsing mode).")); CHECK_IF_SCREEN_FILLED_PUTS(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "assume", _("assume"))) { puts(""); PUTS_UNICODE(_("Set default assumptions for unknown variables.")); Assumptions *ass = CALCULATOR->defaultAssumptions(); str = "("; str += _("unknown"); if(ass->sign() == ASSUMPTION_SIGN_UNKNOWN) str += "*"; str += ", "; str += _("non-zero"); if(ass->sign() == ASSUMPTION_SIGN_NONZERO) str += "*"; str += ", "; str += _("positive"); if(ass->sign() == ASSUMPTION_SIGN_POSITIVE) str += "*"; str += ", "; str += _("negative"); if(ass->sign() == ASSUMPTION_SIGN_NEGATIVE) str += "*"; str += ", "; str += _("non-positive"); if(ass->sign() == ASSUMPTION_SIGN_NONPOSITIVE) str += "*"; str += ", "; str += _("non-negative"); if(ass->sign() == ASSUMPTION_SIGN_NONNEGATIVE) str += "*"; str += " +\n"; str += _("unknown"); if(ass->type() == ASSUMPTION_TYPE_NONE) str += "*"; str += ", "; str += _("non-matrix"); if(ass->type() == ASSUMPTION_TYPE_NONMATRIX) str += "*"; str += ", "; str += _("number"); if(ass->type() == ASSUMPTION_TYPE_NUMBER) str += "*"; str += ", "; str += _("complex"); if(ass->type() == ASSUMPTION_TYPE_COMPLEX) str += "*"; str += ", "; str += _("real"); if(ass->type() == ASSUMPTION_TYPE_REAL) str += "*"; str += ", "; str += _("rational"); if(ass->type() == ASSUMPTION_TYPE_RATIONAL) str += "*"; str += ", "; str += _("integer"); if(ass->type() == ASSUMPTION_TYPE_INTEGER) str += "*"; 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, "delete", _("delete"))) { puts(""); PUTS_UNICODE(_("Removes the user-defined variable with the specified name.")); puts(""); PUTS_UNICODE(_("Example: delete 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, "list", _("list"))) { puts(""); PUTS_UNICODE(_("Displays a list of all user-defined variables, functions and units.")); PUTS_UNICODE(_("Enter with argument 'functions', 'variables' or 'units' to show a list of all functions, variables or units.")); puts(""); PUTS_UNICODE(_("Example: list functions.")); 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 number 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 or changes number base in current result.")); puts(""); PUTS_UNICODE(_("Possible values:")); puts(""); PUTS_UNICODE(_("a unit (e.g. meter, prepend with ? to request the optimal prefix)")); PUTS_UNICODE(_("a unit expression (e.g. km/h)")); PUTS_UNICODE(_("base (convert to base units)")); PUTS_UNICODE(_("optimal (convert to optimal unit)")); puts(""); PUTS_UNICODE(_("bin / binary (show as binary number)")); PUTS_UNICODE(_("oct / octal (show as octal number)")); PUTS_UNICODE(_("hex / hexadecimal (show as hexadecimal number)")); PUTS_UNICODE(_("bases (show as binary, octal, decimal and hexadecimal number)")); puts(""); PUTS_UNICODE(_("fraction (show result in combined fractional format)")); PUTS_UNICODE(_("factors (factorize result)")); puts(""); PUTS_UNICODE(_("Example: to ?g")); puts(""); if(EQUALS_IGNORECASE_AND_LOCAL(str, "to", _("to"))) { PUTS_UNICODE(_("This command can also be typed directly at the end of the mathematical expression.")); 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 if(EQUALS_IGNORECASE_AND_LOCAL(str, "parsing mode", _("parsing mode"))) { puts(""); PUTS_BOLD(_("conventional")); puts(_("Implicit multiplication does not differ from explicit multiplication (\"12/2(1+2) = 12/2*3 = 18\", \"5x/5y = 5*x/5*y = xy\").")); puts(""); PUTS_BOLD(_("implicit first")); puts(_("Implicit multiplication is parsed before explicit multiplication (\"12/2(1+2) = 12/(2*3) = 2\", \"5x/5y = (5*x)/(5*y) = x/y\").")); puts(""); PUTS_BOLD(_("adaptive")); puts(_("The default adaptive mode works as the \"implicit first\" mode, unless spaces are found (\"1/5x = 1/(5*x)\", but \"1/5 x = (1/5)*x\"). In the adaptive mode unit expressions are parsed separately (\"5 m/5 m/s = (5*m)/(5*(m/s)) = 1 s\").")); puts(""); puts(_("Function arguments without parentheses are an exception, where implicit multiplication in front of variables and units is parsed first regardless of mode (\"sqrt 2x = sqrt(2x)\").")); 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() { CALCULATOR->abortPrint(); } void *view_proc(void *pipe) { //pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); FILE *view_pipe = (FILE*) pipe; while(true) { //pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); 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, bool update_parse, bool goto_input, size_t stack_index, bool register_moved, bool noprint) { b_busy = true; if(!interactive_mode) goto_input = false; 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(); CALCULATOR->startPrintControl(); 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 if(use_readline) c = rl_read_key(); else read(STDIN_FILENO, &c, 1); #else read(STDIN_FILENO, &c, 1); #endif if(c == '\n') { on_abort_display(); } } else { if(!result_only) { printf("."); fflush(stdout); } nanosleep(&rtime, NULL); } } } CALCULATOR->stopPrintControl(); printops.prefix = NULL; if(noprint) { return; } 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(mstruct->isComparison()) fputs(LEFT_PARENTHESIS, stdout); if(update_parse) { FPUTS_UNICODE(parsed_text.c_str(), stdout); } else { FPUTS_UNICODE(prev_result_text.c_str(), stdout); } if(mstruct->isComparison()) fputs(RIGHT_PARENTHESIS, stdout); if(!(*printops.is_approximate) && !mstruct->isApproximate()) { printf(" = "); } else { if(printops.use_unicode_signs) { printf(" " SIGN_ALMOST_EQUAL " "); } else { printf(" = %s ", _("approx.")); } } } if(!result_only && mstruct->isComparison()) { fputs(LEFT_PARENTHESIS, stdout); FPUTS_UNICODE(result_text.c_str(), stdout); puts(RIGHT_PARENTHESIS); } else { PUTS_UNICODE(result_text.c_str()); } if(goto_input) printf("\n"); } 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, bool show_result) { 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 if(use_readline) c = rl_read_key(); else read(STDIN_FILENO, &c, 1); #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; } } if(show_result) 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; bool do_bases = false, do_factors = false, do_fraction = false; if(!interactive_mode) goto_input = false; if(do_stack) { } else { str = expression_str; string from_str = str, to_str; bool b_units_saved = evalops.parse_options.units_enabled; evalops.parse_options.units_enabled = true; if(CALCULATOR->separateToExpression(from_str, to_str, evalops, true)) { if(equalsIgnoreCase(to_str, "hex") || EQUALS_IGNORECASE_AND_LOCAL(to_str, "hexadecimal", _("hexadecimal"))) { int save_base = printops.base; expression_str = from_str; printops.base = BASE_HEXADECIMAL; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); printops.base = save_base; expression_str = str; evalops.parse_options.units_enabled = b_units_saved; return; } else if(equalsIgnoreCase(to_str, "bin") || EQUALS_IGNORECASE_AND_LOCAL(to_str, "binary", _("binary"))) { int save_base = printops.base; expression_str = from_str; printops.base = BASE_BINARY; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); printops.base = save_base; expression_str = str; evalops.parse_options.units_enabled = b_units_saved; return; } else if(equalsIgnoreCase(to_str, "oct") || EQUALS_IGNORECASE_AND_LOCAL(to_str, "octal", _("octal"))) { int save_base = printops.base; expression_str = from_str; printops.base = BASE_OCTAL; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); printops.base = save_base; expression_str = str; evalops.parse_options.units_enabled = b_units_saved; return; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "fraction", _("fraction"))) { str = from_str; do_fraction = true; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "factors", _("factors"))) { str = from_str; do_factors = true; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "bases", _("bases"))) { do_bases = true; str = from_str; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "optimal", _("optimal"))) { expression_str = from_str; AutoPostConversion save_auto_post_conversion = evalops.auto_post_conversion; evalops.auto_post_conversion = POST_CONVERSION_BEST; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); evalops.auto_post_conversion = save_auto_post_conversion; expression_str = str; evalops.parse_options.units_enabled = b_units_saved; return; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "base", _("base"))) { expression_str = from_str; AutoPostConversion save_auto_post_conversion = evalops.auto_post_conversion; evalops.auto_post_conversion = POST_CONVERSION_BEST; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); evalops.auto_post_conversion = save_auto_post_conversion; expression_str = str; evalops.parse_options.units_enabled = b_units_saved; return; } } evalops.parse_options.units_enabled = b_units_saved; } expression_executed = true; b_busy = true; size_t stack_size = 0; CALCULATOR->resetExchangeRatesUsed(); 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 if(use_readline) c = rl_read_key(); else read(STDIN_FILENO, &c, 1); #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(); } if(!do_mathoperation && check_exchange_rates()) { execute_expression(goto_input, do_mathoperation, op, f, rpn_mode, do_stack ? stack_index : 0); return; } if(do_factors) { if(do_stack && stack_index != 0) { MathStructure *save_mstruct = mstruct; mstruct = CALCULATOR->getRPNRegister(stack_index + 1); execute_command(COMMAND_FACTORIZE, false); mstruct = save_mstruct; } else { execute_command(COMMAND_FACTORIZE, false); } } //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(""); } } if(do_bases) { int save_base = printops.base; printops.base = BASE_BINARY; setResult(NULL, (!do_stack || stack_index == 0), false, do_stack ? stack_index : 0, false, true); string base_str = result_text; base_str += " = "; printops.base = BASE_OCTAL; setResult(NULL, false, false, do_stack ? stack_index : 0, false, true); base_str += result_text; base_str += " = "; printops.base = BASE_DECIMAL; setResult(NULL, false, false, do_stack ? stack_index : 0, false, true); base_str += result_text; base_str += " = "; printops.base = BASE_HEXADECIMAL; setResult(NULL, false, false, do_stack ? stack_index : 0, false, true); base_str += result_text; if(has_printed) printf("\n"); if(goto_input) printf("\n "); if(!result_only) { FPUTS_UNICODE(parsed_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(base_str.c_str()); printops.base = save_base; result_text = base_str; if(goto_input) printf("\n"); } else if(do_fraction) { NumberFractionFormat save_format = printops.number_fraction_format; if(((!do_stack || stack_index == 0) && mstruct->isNumber()) || (do_stack && stack_index != 0 && CALCULATOR->getRPNRegister(stack_index + 1)->isNumber())) printops.number_fraction_format = FRACTION_COMBINED; else printops.number_fraction_format = FRACTION_FRACTIONAL; setResult(NULL, (!do_stack || stack_index == 0), goto_input, do_stack ? stack_index : 0); printops.number_fraction_format = save_format; } else { 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.parsing_mode = PARSING_MODE_ADAPTIVE; 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; auto_update_exchange_rates = -1; first_time = false; FILE *file = NULL; #ifdef HAVE_LIBREADLINE gchar *historyfile = g_build_filename(getLocalDir().c_str(), "qalc.history", NULL); gchar *oldhistoryfile = NULL; #endif gchar *gstr_oldfile = NULL; gchar *gstr_file = g_build_filename(getLocalDir().c_str(), "qalc.cfg", NULL); file = fopen(gstr_file, "r"); if(!file) { gstr_oldfile = g_build_filename(getOldLocalDir().c_str(), "qalc.cfg", NULL); file = fopen(gstr_oldfile, "r"); if(!file) { g_free(gstr_file); g_free(gstr_oldfile); #ifdef HAVE_LIBREADLINE g_free(historyfile); #endif first_time = true; set_saved_mode(); return; } #ifdef HAVE_LIBREADLINE oldhistoryfile = g_build_filename(getOldLocalDir().c_str(), "qalc.history", NULL); #endif mkdir(getLocalDir().c_str(), S_IRWXU); } #ifdef HAVE_LIBREADLINE stifle_history(100); if(oldhistoryfile) { read_history(oldhistoryfile); move_file(oldhistoryfile, historyfile); g_free(oldhistoryfile); } else { read_history(historyfile); } g_free(historyfile); #endif int version_numbers[] = {0, 9, 8}; 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") { if(auto_update_exchange_rates < 0 && v) auto_update_exchange_rates = 1; } else if(svar == "auto_update_exchange_rates") { auto_update_exchange_rates = 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 == "parsing_mode") { if(v >= PARSING_MODE_ADAPTIVE && v <= PARSING_MODE_CONVENTIONAL) { evalops.parse_options.parsing_mode = (ParsingMode) 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 == "use_prefixes_for_all_units") { printops.use_prefixes_for_all_units = v; } else if(svar == "use_prefixes_for_currencies") { printops.use_prefixes_for_currencies = 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 == "comma_as_separator") { evalops.parse_options.comma_as_separator = v; if(CALCULATOR->getDecimalPoint() != ",") { CALCULATOR->useDecimalPoint(evalops.parse_options.comma_as_separator); } } 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); } } } } fclose(file); if(gstr_oldfile) { move_file(gstr_oldfile, gstr_file); g_free(gstr_oldfile); } } else { first_time = true; } g_free(gstr_file); //remember start mode for when we save preferences set_saved_mode(); } /* save preferences to ~/.config/qalculate/qalc.cfg set mode to true to save current calculator mode */ bool save_preferences(bool mode) { FILE *file = NULL; mkdir(getLocalDir().c_str(), S_IRWXU); #ifdef HAVE_LIBREADLINE gchar *historyfile = g_build_filename(getLocalDir().c_str(), "qalc.history", NULL); write_history(historyfile); g_free(historyfile); #endif gchar *filename = g_build_filename(getLocalDir().c_str(), "qalc.cfg", NULL); file = fopen(filename, "w+"); g_free(filename); if(file == NULL) { fprintf(stderr, _("Couldn't write preferences to\n%s"), filename); 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, "auto_update_exchange_rates=%i\n", auto_update_exchange_rates); 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, "comma_as_separator=%i\n", evalops.parse_options.comma_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, "use_prefixes_for_all_units=%i\n", saved_printops.use_prefixes_for_all_units); fprintf(file, "use_prefixes_for_currencies=%i\n", saved_printops.use_prefixes_for_currencies); 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, "parsing_mode=%i\n", evalops.parse_options.parsing_mode); 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.10/src/defs2doc.cc0000644000175000017500000006147712710462165013776 00000000000000/* Qalculate Copyright (C) 2004 Hanna Knutsson (hanna_k@fmgirl.com) 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.10/docs/0000755000175000017500000000000012757636740012215 500000000000000libqalculate-0.9.10/docs/reference/0000755000175000017500000000000012757636740014153 500000000000000libqalculate-0.9.10/docs/reference/Makefile.in0000644000175000017500000003701212757636731016143 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(referencedir)" DATA = $(reference_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 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_CLAGS = @CLN_CLAGS@ 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@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ 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_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ referencedir = $(docdir)/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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/reference/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-referenceDATA: $(reference_DATA) @$(NORMAL_INSTALL) @list='$(reference_DATA)'; test -n "$(referencedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(referencedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(referencedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(referencedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(referencedir)" || exit $$?; \ done uninstall-referenceDATA: @$(NORMAL_UNINSTALL) @list='$(reference_DATA)'; test -n "$(referencedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(referencedir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 html-am: info: info-am info-am: install-data-am: install-referenceDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 \ cscopelist-am ctags-am 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 tags-am uninstall \ uninstall-am uninstall-referenceDATA .PRECIOUS: Makefile # 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.10/docs/reference/Makefile.am0000644000175000017500000000027512710462703016114 00000000000000# # docs/reference/Makefile.am for qalculate # referencedir = $(docdir)/reference/html reference_DATA = html/*.png html/*.html html/*.css EXTRA_DIST = html/*.png html/*.html html/*.css libqalculate-0.9.10/docs/reference/html/0000755000175000017500000000000012757636740015117 500000000000000libqalculate-0.9.10/docs/reference/html/functions_func_z.html0000644000175000017500000001036412757636735021311 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- z -

libqalculate-0.9.10/docs/reference/html/functions_c.html0000644000175000017500000002520612757636735020250 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- c -

libqalculate-0.9.10/docs/reference/html/classCompositeUnit.html0000644000175000017500000021176112757636735021571 00000000000000 libqalculate-0.9.8: CompositeUnit Class Reference

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

#include <Unit.h>

Inheritance diagram for CompositeUnit:
Unit ExpressionItem

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, bool set_null_prefixes=false) const
 
virtual void setBaseExpression (string base_expression_)
 
virtual void clear ()
 
- Public Member Functions inherited from Unit
 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)
 
bool isSIUnit () const
 
void setAsSIUnit ()
 
void setSystem (string s_system)
 
const string & system () const
 
bool useWithPrefixesByDefault () const
 
void setUseWithPrefixesByDefault (bool use_with_prefixes)
 
bool isCurrency () 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 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
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
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)
 

Protected Attributes

string sshort
 
vector< AliasUnit_Composite * > units
 
- Protected Attributes inherited from Unit
string ssystem
 
bool b_si
 
bool b_use_with_prefixes
 
- Protected Attributes inherited from ExpressionItem
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

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
uUnit.
expExponent.
prefixPrefix.
virtual void CompositeUnit::clear ( )
virtual

Removes all sub/base units.

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

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

virtual size_t CompositeUnit::countUnits ( ) const
virtual

Returns the number of sub/base units

virtual MathStructure CompositeUnit::generateMathStructure ( bool  make_division = false,
bool  set_null_prefixes = false 
) const
virtual

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

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

Retrieves information about a sub/base unit

Parameters
indexIndex starting at 1.
[out]expExponent.
[out]prefixPrefix.
Returns
Sub/base unit (AliasUnit_Composite::firstBaseUnit()).
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.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/classIntegerArgument.html0000644000175000017500000007616612757636735022077 00000000000000 libqalculate-0.9.8: IntegerArgument Class Reference

A definition for integer arguments. More...

#include <Function.h>

Inheritance diagram for IntegerArgument:
Argument

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
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
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
 

Protected Member Functions

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

Protected Attributes

Numberimin
 
Numberimax
 
- Protected Attributes inherited from Argument
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 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 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 void IntegerArgument::set ( const Argument arg)
virtual

Sets the argument to a copy of an argument definition.

Parameters
argArgument to copy.

Reimplemented from Argument.

virtual string IntegerArgument::subprintlong ( ) const
protectedvirtual

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 bool IntegerArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 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:
libqalculate-0.9.10/docs/reference/html/classTextArgument-members.html0000644000175000017500000003143412757636735023043 00000000000000 libqalculate-0.9.8: 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const TextArgumentvirtual
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const TextArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const TextArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const TextArgumentprotectedvirtual
suggestsQuotes() const (defined in TextArgument)TextArgumentvirtual
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 TextArgumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~TextArgument() (defined in TextArgument)TextArgumentvirtual
libqalculate-0.9.10/docs/reference/html/functions_b.html0000644000175000017500000001164412757636735020250 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- b -

libqalculate-0.9.10/docs/reference/html/structParseOptions.html0000644000175000017500000003623112757636735021631 00000000000000 libqalculate-0.9.8: ParseOptions Struct Reference
ParseOptions Struct Reference

Options for parsing expressions. More...

#include <includes.h>

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. More...
 
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 comma_as_separator
 If true commas will ignored if another character is the default decimal sign, to allow commas to be used as thousand separator. You also need to call CALCULATOR->useDecimalPoint(true). 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.
 
bool convert_temperature_units
 Convert degree Celsius and Fahrenheit to Kelvin already when parsing the expression. Turn off when parsing unit expression to convert to. Default: true.
 
ParsingMode parsing_mode
 Parsing mode. Default: PARSING_MODE_ADAPTIVE.
 

Detailed Description

Options for parsing expressions.

Member Data Documentation

bool ParseOptions::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.

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:
libqalculate-0.9.10/docs/reference/html/functions_func_b.html0000644000175000017500000001040312757636735021253 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- b -

libqalculate-0.9.10/docs/reference/html/classAliasUnit__Composite.png0000644000175000017500000000153512757636735022655 00000000000000PNG  IHDR~='PLTEutRNST2IDATxr E*Q!ǨɾӉK%Ms>Ȓ"d?էGN87P/IyJ?k}`J|Xyd$I[e/I/I{ջqo~k~/#}c;Ur$dm_!Im2o:%U׽t@%D%Ʉ_s6_v߬====\%}%E%ԧ65$!IOJ}/.K]/['LՓ73_ d"d¯9gw|x]g{/oxELDLDLDs>Ȓ"dt/Ճsg$ }Zk$i%}_TZC}CISMmַ=挛i_i85c-'x<%qB/I&B/I&spWuVW;fg~\DLDLDL*)"&#}7͸zĐ٬]Rq4 `4ܗY p\ ^-4~Mmַ=~1h$4HߜTwc -/3y)~zT]ׯ~Gg9%[>'tOrj5.?-0קD;N#nfIENDB`libqalculate-0.9.10/docs/reference/html/classIntegerArgument.png0000644000175000017500000000100312757636735021671 00000000000000PNG  IHDRiP-)mPLTEutRNST2IDATx풃 E#oFaw:81 /{?ExIEQ]_\/cn]x] mI:ʤ=ylI:&I蚴]-R}+IuvYR< IHRE}߈B#$i@9]$55$iT_J`Yi'hj+" kFHZ$Q- `T0EJsM` `T@*wjK^ uz qnC=FG eIuhԈ88lXC.N9I/&QV#}Z$; d1Y4zfj$]IG峗ݩfܭKRIOUPUak|/%9 d3IENDB`libqalculate-0.9.10/docs/reference/html/structExpressionName-members.html0000644000175000017500000001312412757636735023567 00000000000000 libqalculate-0.9.8: 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
libqalculate-0.9.10/docs/reference/html/classUnit.png0000644000175000017500000000224312757636735017517 00000000000000PNG  IHDR-=PLTEutRNST22IDATx풪0DNw$|NVdEJ9"IM$3 @,3\!/Yc߹317m=J/{ak,'sPzi .= `ˬ S5+_&eֆ5CPCu_cw\u.D),ꖓՓbz&<{RTj2dB=y|3 3 @,3ƐsΧEN3 0+ ^"%2 )`I`3He3AR,3 b f f0Xf0$ź CJ)Ij" f0XfC|{ CR|I:=1O2`3a<<o f0Xf0$2Ck )tZ$$1C %RR(3 b f fCu]ʝ4 )`I`3He3AR,3{9iDb3e i|/;7.ؑ4CZ^mg ]-pyu5^}hAEKo㑻apiD5^E0?5:جwV?gllf`VyRF913,db}RC W?6CmgHa(:Gu b*f0-3 @,3 9|ZC9I$$9f:;aVDJ e3AR,3 b f f0Xf0$2 )`I`3Hus ]9Ij"ଘ fbY4w.H?/Y]A3˳6r!py50H(/.OoaoE51{j$5:C5Qa Y]ya'Et2'Yvw,N jvfX  ڰB7ϐ0,XtyIQt~R|3 `;g׹8(_c}12Ck 9|Z$h+'IENDB`libqalculate-0.9.10/docs/reference/html/classVariable.png0000644000175000017500000000227212757636735020327 00000000000000PNG  IHDR9PLTEutRNST2IIDATx떳*Z#u''6Ӗ`4{#Km(@YLT.DʒO`:al=t牎;Gɞ|ݎGnI[u3:x׳l椬Ew0e)ӍFto)nE'^"!JϞBKPNC6UwGU7_®UTR*I9& P1Q$]{oQ =Ћ0tbڋ˳nDTso7D.D)t= [n7 :AWЍ:^J>A4z83 ϢJf:l.uC -+7% M݆.e(@YLrL,& p9& P眻G1@/Љi//>L & & & & P0 F~6+& P(DJb0Q(@L$& Pz ?{IXTnD%&*I%UԭI:b Bw>7[,'~Nhfsb7߻ur9N|%F΅7Z-?p6Qo@]E'?ݰ`Qߋ,p(Jn4j~(O4y$Ehtow{Gٻ8hT*'74v_͖_V.˟JRQvD%<&*I0QI*JRLTJғG$pzNL{}yaڍU]0Q0Q0Q0Q0Q0Q0Q0Q0Q0Q0Q0Q* {%6L,&*IceYDO&LGِr~ѝےCvE7ʕq7M4ϯze>vC #ZE{⫝x9)n8Qh:ODJ]B#$i;/-ὁuVoD{ Z;X:OcJ: \B6#*_}ID zV%Zҳ+I0Q$]{o'[IENDB`libqalculate-0.9.10/docs/reference/html/functions_k.html0000644000175000017500000001116312757636735020255 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- k -

libqalculate-0.9.10/docs/reference/html/functions_func_u.html0000644000175000017500000001135512757636735021305 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- u -

libqalculate-0.9.10/docs/reference/html/classFunctionArgument.png0000644000175000017500000000101112757636735022060 00000000000000PNG  IHDRsPLPLTEutRNST2IDATx]n )?rccR+Sy{L$:$5PӵJ/t ʩlMKT_u59Wv!IZ\d-$Ss1W9]V㴽TiZ39ui۴I*{!IFgW>5/I$ዜ{?x 1^z.5y;N>L'@ Їta:^s e:ps(<ϺZUP༳JΥ\ AG*DJs2 ɳS9aRZc%Wefy_ӎ:Yٴ)ճ;cҽr1W9T㴽ag/j3rcټ=q!8a!oȻ+]LT,0EN|0^JIENDB`libqalculate-0.9.10/docs/reference/html/classPrefix.html0000644000175000017500000006105512757636735020223 00000000000000 libqalculate-0.9.8: Prefix Class Reference

Abstract class for prefixes. More...

#include <Prefix.h>

Inheritance diagram for Prefix:
BinaryPrefix DecimalPrefix NumberPrefix

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_nameLong name.
short_nameShort name.
unicode_nameUnicode name.

Member Function Documentation

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_longIf the short name shall be returned if the prefix has not got a long name (if it is empty).
use_unicodeIf a unicode version of the name is allowed and preferred.
Returns
The long name of 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_defaultIf a short name is preferred.
use_unicodeIf a unicode name is preferred.
can_display_unicode_string_functionFunction 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_argArgument to pass to the above test function.
Returns
A preferred name.
void Prefix::setLongName ( string  long_name)

Sets the long name of the prefix.

Parameters
long_nameThe new long name for the prefix.
void Prefix::setShortName ( string  short_name)

Sets the short name of the prefix.

Parameters
short_nameThe new short 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_nameThe new unicode name for the prefix.
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_shortIf the long name shall be returned if the prefix has not got a short name (if it is empty).
use_unicodeIf a unicode version of the name is allowed and preferred.
Returns
The short name of the prefix.
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 NumberPrefix, BinaryPrefix, and DecimalPrefix.

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

Returns the unicode name of the prefix.

Parameters
return_short_if_no_uniIf 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.
virtual Number Prefix::value ( const Number nexp) const
pure virtual

Returns the value of the prefix.

Parameters
nexpThe power of the prefixed unit.
Returns
The value of the prefix.

Implemented in NumberPrefix, BinaryPrefix, and DecimalPrefix.

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

Returns the value of the prefix.

Parameters
iexpThe power of the prefixed unit.
Returns
The value of the prefix.

Implemented in NumberPrefix, BinaryPrefix, and DecimalPrefix.

virtual Number Prefix::value ( ) const
pure virtual

Returns the value of the prefix.

Returns
The value of the prefix.

Implemented in NumberPrefix, BinaryPrefix, and DecimalPrefix.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/functions_r.html0000644000175000017500000001516612757636735020273 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- r -

libqalculate-0.9.10/docs/reference/html/functions_p.html0000644000175000017500000002206012757636735020260 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- p -

libqalculate-0.9.10/docs/reference/html/classFunctionArgument-members.html0000644000175000017500000003162412757636735023705 00000000000000 libqalculate-0.9.8: 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const FunctionArgumentvirtual
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 Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const FunctionArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const FunctionArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const FunctionArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const FunctionArgumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~FunctionArgument() (defined in FunctionArgument)FunctionArgumentvirtual
libqalculate-0.9.10/docs/reference/html/classAngleArgument.png0000644000175000017500000000077112757636735021335 00000000000000PNG  IHDRcP: ;PLTEutRNST2IDATxr #7C[LJ sdExd4$p4@+ÍJ~JH]"%@ۆ*I,B)ʨu!IG8^#|ב֢;:*IGzY~]Վeq_e$8Grԑ#IX<`a}%9~.c<&s/TL}FrX`c9l,pι6v\٪lj;]sn:E((O[x_NpZE9Av^:ңeȪ׎_ݝ|9 Gzu'QG;z=NzY,8%=9tG8 j# :m97/#nڱIENDB`libqalculate-0.9.10/docs/reference/html/functions_func_f.html0000644000175000017500000001100012757636735021251 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- f -

libqalculate-0.9.10/docs/reference/html/classPrefix.png0000644000175000017500000000144512757636735020040 00000000000000PNG  IHDR"PPLTEutRNST2IDATx CUF 2V9[(3LRJVX@X@E5o[HWQhWS4/yE=^]Nef{%\,zz)z\im+ɬh]E>[|+"+"+"+!E)t c0= b "n`A!VbE!VbE!VbE!VbE!\4MOpx<X@X@X@X@X@X@\SQ93(?#Kӗ3N++++JQ%#I[omu iBJX)N(I[k93?^^3FOx ,G<2rRSKIEv6X~\>QEkvEǥ΢HZe_ME#y9*ERm_n +چZα_媪*(@Ql] ojtE|@vErhޱηvP_@C߸ъVoGy[SIe{FKIRDyHR~Yc<{MC\EV$I!V$I!V$I!V$I!?(O~97r3}:Ac\$IENDB`libqalculate-0.9.10/docs/reference/html/sync_off.png0000644000175000017500000000152512757636734017361 00000000000000PNG  IHDRw=IDATxKhTW1I&38MII3b$c I1V1-(T.* t!K[čf`l(l"Y6gT}sgܹ d{8?̝;u`:!FB?Űm'y>ѝlU_?]Y(N8f1qn-etm 0}b%׌=0?1s08;_ W|%\Zð >舽lnp.a{ )t; b n652?>Oдunm`׭ZWjC~>־0+ {{fMŕټ` ݛ%uA6,]kWu]7ihu1 l Ҷ̺:\cxhRQt$ fd<4B[fd7=.M9//O a},j?.5ښm?X2#d p(?c!a1ޗةܾ7dK:)3],H+ku<|`LhC7e םt H$^2%l.aeÉ|s }D^hz~Rá]|#@חև[k<|(*ݹdtM:,]' X_n| /cfOIENDB`libqalculate-0.9.10/docs/reference/html/hierarchy.html0000644000175000017500000004376612757636735017727 00000000000000 libqalculate-0.9.8: Class Hierarchy
Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
[detail level 1234]
 CArgumentA mathematical function argument definition with free value and base class for all argument definitions
 CAngleArgument
 CArgumentSetA set of accepted arguments
 CBooleanArgumentA boolean argument
 CDataObjectArgumentData object function argument
 CDataPropertyArgumentData property function argument
 CDateArgumentA date argument
 CExpressionItemArgumentArgument for functions, variables and units
 CFileArgument
 CFunctionArgumentA function argument
 CIntegerArgumentA definition for integer arguments
 CMatrixArgumentA matrix argument
 CNumberArgumentA definition for numerical arguments
 CSymbolicArgumentA symbolic argument
 CTextArgumentA text argument
 CUnitArgument
 CVariableArgument
 CVectorArgumentA vector argument
 CAssumptionsAn assumption about an unknown mathematical value
 CCalculatorThe almighty calculator class
 CCalculatorMessageA message with information to the user. Primarily used for errors and warnings
 CDataObjectA a data set object
 CDataPropertyA data set property
 CElement
 CEvaluationOptionsOptions for calculation
 CExpressionItemAbstract base class for functions, variables and units
 CMathFunctionAbstract base class for mathematical functions
 CDataSetA data set
 CUserFunctionA user defined mathematical function
 CUnitA unit for measurement
 CAliasUnitAn unit with relation to another unit
 CAliasUnit_CompositeA subunit in a CompositeUnit
 CCompositeUnitA unit consisting of a number of other units
 CVariableAbstract base class for variables
 CKnownVariableA variable with a known value
 CDynamicVariableAbstract base class for variables with a value which is recalculated when the precision has changed
 CUnknownVariableA variable with unknown value
 CExpressionNameA name for an expression item (function, variable or unit)
 CInternalPrintStruct
 CMathStructureA structure representing a mathematical value/expression/result
 CNumberA number
 CParseOptionsOptions for parsing expressions
 CPlotDataParametersParameters for plot data series
 CPlotParametersParameters passed to plotting functions
 CPrefixAbstract class for prefixes
 CBinaryPrefixA binary prefix
 CDecimalPrefixA decimal (metric) prefix
 CNumberPrefixA prefix with a free numerical value
 CPrintOptionsOptions for formatting and display of mathematical structures/results
 CSortOptionsOptions for ordering the parts of a mathematical expression/result before display
libqalculate-0.9.10/docs/reference/html/functions_n.html0000644000175000017500000001250512757636735020261 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- n -

libqalculate-0.9.10/docs/reference/html/functions_func_d.html0000644000175000017500000001172112757636735021261 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- d -

libqalculate-0.9.10/docs/reference/html/classUserFunction-members.html0000644000175000017500000013060512757636735023040 00000000000000 libqalculate-0.9.8: 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)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addSubfunction(string subfunction, bool precalculate=true) (defined in UserFunction)UserFunction
appendDefaultValues(MathStructure &vargs) (defined in MathFunction)MathFunction
argc (defined in MathFunction)MathFunctionprotected
args() const MathFunction
args(const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)MathFunction
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)UserFunctionvirtual
calculate(const string &eq, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunctionvirtual
calculate(MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunctionvirtual
category() const ExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearArgumentDefinitions()MathFunction
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
clearSubfunctions() (defined in UserFunction)UserFunction
condition() const MathFunction
copy() const (defined in UserFunction)UserFunctionvirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
countSubfunctions() const (defined in UserFunction)UserFunction
createFunctionMathStructureFromSVArgs(vector< string > &svargs) (defined in MathFunction)MathFunctionprotectedvirtual
createFunctionMathStructureFromVArgs(const MathStructure &vargs) (defined in MathFunction)MathFunctionprotectedvirtual
default_values (defined in MathFunction)MathFunctionprotected
delSubfunction(size_t index) (defined in UserFunction)UserFunction
description() const ExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
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 ExpressionItemvirtual
formula() const UserFunction
getArgumentDefinition(size_t index)MathFunction
getDefaultValue(size_t arg_) const (defined in MathFunction)MathFunction
getName(size_t index) const ExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
getSubfunction(size_t index) const (defined in UserFunction)UserFunction
hasChanged() const ExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) const ExpressionItemvirtual
hasNameCaseSensitive(const string &sname) const ExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
internalFormula() const UserFunction
isActive() const ExpressionItemvirtual
isApproximate() const ExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
last_argdef_index (defined in MathFunction)MathFunctionprotected
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)MathFunctionprotected
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)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
parse(const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunctionvirtual
parse(MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunctionvirtual
precision() const ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
printCondition()MathFunction
priv (defined in MathFunction)MathFunctionprotected
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)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() const ExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsComplex(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsEven(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsInteger(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonMatrix(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsNonNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonZero(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNumber(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsOdd(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsRational(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsReal(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsUndefined(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
scondition (defined in MathFunction)MathFunctionprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in UserFunction)UserFunctionvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setArgumentDefinition(size_t index, Argument *argdef)MathFunction
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setCondition(string expression)MathFunction
setDefaultValue(size_t arg_, string value_) (defined in MathFunction)MathFunction
setDescription(string descr_)ExpressionItemvirtual
setFormula(string new_formula, int argc_=-1, int max_argc_=0)UserFunction
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
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_)ExpressionItemvirtual
sformula (defined in UserFunction)UserFunctionprotected
sformula_calc (defined in UserFunction)UserFunctionprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
stringArgs(const string &str, vector< string > &svargs) (defined in MathFunction)MathFunction
subfunctionPrecalculated(size_t index) const (defined in UserFunction)UserFunction
subtype() const UserFunctionvirtual
testArgumentCount(int itmp) (defined in MathFunction)MathFunction
testArguments(MathStructure &vargs) (defined in MathFunction)MathFunctionprotected
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 ExpressionItemvirtual
type() const MathFunctionvirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
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)UserFunctionprotected
v_refs (defined in ExpressionItem)ExpressionItemprotected
v_subs (defined in UserFunction)UserFunctionprotected
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~MathFunction() (defined in MathFunction)MathFunctionvirtual
libqalculate-0.9.10/docs/reference/html/classVectorArgument.html0000644000175000017500000007466012757636735021741 00000000000000 libqalculate-0.9.8: VectorArgument Class Reference

A vector argument. More...

#include <Function.h>

Inheritance diagram for VectorArgument:
Argument

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
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Protected Attributes

vector< Argument * > subargs
 
bool b_argloop
 
- Protected Attributes inherited from Argument
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 vector argument.

Member Function Documentation

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.

virtual string VectorArgument::subprintlong ( ) const
protectedvirtual

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 bool VectorArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int VectorArgument::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:
libqalculate-0.9.10/docs/reference/html/classDynamicVariable.html0000644000175000017500000016241012757636735022015 00000000000000 libqalculate-0.9.8: DynamicVariable Class Reference
DynamicVariable Class Referenceabstract

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

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 ()
 
- Public Member Functions inherited from KnownVariable
 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)
 
bool isKnown () const
 
virtual bool isExpression () const
 
virtual string expression () const
 
int subtype () const
 
- Public Member Functions inherited from Variable
 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Variable (const Variable *variable)
 
virtual int type () const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
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)
 

Protected Member Functions

virtual void calculate () const =0
 

Additional Inherited Members

- Protected Attributes inherited from KnownVariable
MathStructuremstruct
 
bool b_expression
 
int calculated_precision
 
string sexpression
 
- Protected Attributes inherited from ExpressionItem
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 variables with a value which is recalculated when the precision has changed.

Member Function Documentation

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.
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.

virtual bool DynamicVariable::representsPositive ( bool  = false)
inlinevirtual

Returns if the variable represents a positive value.

Reimplemented from KnownVariable.

void DynamicVariable::set ( const MathStructure o)
virtual

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

Parameters
oValue.

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.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/classNumberArgument-members.html0000644000175000017500000004373512757636735023356 00000000000000 libqalculate-0.9.8: 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)NumberArgumentprotected
b_error (defined in Argument)Argumentprotected
b_incl_max (defined in NumberArgument)NumberArgumentprotected
b_incl_min (defined in NumberArgument)NumberArgumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_rational_number (defined in NumberArgument)NumberArgumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
complexAllowed() const (defined in NumberArgument)NumberArgument
copy() const NumberArgumentvirtual
fmax (defined in NumberArgument)NumberArgumentprotected
fmin (defined in NumberArgument)NumberArgumentprotected
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 Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const NumberArgumentvirtual
printlong() const Argument
rationalNumber() const (defined in NumberArgument)NumberArgument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)NumberArgumentvirtual
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)Argumentprotected
subprintlong() const NumberArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const NumberArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const NumberArgumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~NumberArgument() (defined in NumberArgument)NumberArgumentvirtual
libqalculate-0.9.10/docs/reference/html/classAssumptions.html0000644000175000017500000003536312757636735021316 00000000000000 libqalculate-0.9.8: Assumptions Class Reference

An assumption about an unknown mathematical value. More...

#include <Variable.h>

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:
libqalculate-0.9.10/docs/reference/html/nav_h.png0000644000175000017500000000014212757636734016640 00000000000000PNG  IHDR ,@)IDATxA @BQۛТ) ) aܿoRlIENDB`libqalculate-0.9.10/docs/reference/html/classDataObjectArgument.png0000644000175000017500000000104112757636735022276 00000000000000PNG  IHDRP PLTEutRNST2IDATxa A@ T}T+:1E1."I.8C@4?N"|hCz8NC{$ya3dGHf"{MĴ Iv4Nw9VhKpV^)@{ G߉O/(i $?dFȿN31ƸR6X۶a9 `1z? NNN@ A!,,8!He sx*y5Z佻?Z1NUgP/gh7YJ2M(3Ϫi' libqalculate-0.9.8: Class Members - Functions
 

- c -

libqalculate-0.9.10/docs/reference/html/globals_eval.html0000644000175000017500000002023012757636735020360 00000000000000 libqalculate-0.9.8: File Members
 

- a -

- f -

- p -

- s -

- t -

libqalculate-0.9.10/docs/reference/html/functions_func_e.html0000644000175000017500000001217012757636735021261 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- e -

libqalculate-0.9.10/docs/reference/html/functions_func_0x7e.html0000644000175000017500000001021512757636735021616 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- ~ -

libqalculate-0.9.10/docs/reference/html/functions_e.html0000644000175000017500000001311012757636735020241 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- e -

libqalculate-0.9.10/docs/reference/html/classDynamicVariable.png0000644000175000017500000000165112757636735021634 00000000000000PNG  IHDRm9TPLTEutRNST28IDATx떤* F7k|2Nu:}VO"c_r $96IGmi'I8Ľn6Imk޿v^vY};ԫִȒ$;.V:v>IއzoGJv;wwzoG[?V"6̲P~OhLt|e'6jUUMMRw|들&IM,p圳j[O%s~uM X6 `A,a l#9Y$Y?<쮦tgʶRi}]o$]ܶڬ$邿Xdƭ;5kts۴I<<-FF-]뚔$+&IM,p圳j[O%s~uM X6 `A,a l#9Y$YNtE n:hv>Ҿm [ۺ5jqm.ѮwG[5\֌(Sκurc`ߴ?Tl/f]_$ JWSWy?&%; $Y6Iݖs^|mYZwZk+{|tfΘFh6xegk[^G۶'S libqalculate-0.9.8: Member List
Prefix Member List

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

l_name (defined in Prefix)Prefixprotected
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)Prefixprotected
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 =0Prefixpure virtual
u_name (defined in Prefix)Prefixprotected
unicodeName(bool return_short_if_no_uni=true) const Prefix
value(const Number &nexp) const =0Prefixpure virtual
value(int iexp) const =0Prefixpure virtual
value() const =0Prefixpure virtual
~Prefix() (defined in Prefix)Prefixvirtual
libqalculate-0.9.10/docs/reference/html/classUnknownVariable.html0000644000175000017500000015524712757636735022102 00000000000000 libqalculate-0.9.8: UnknownVariable Class Reference

A variable with unknown value. More...

#include <Variable.h>

Inheritance diagram for UnknownVariable:
Variable ExpressionItem

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 ()
 
- Public Member Functions inherited from Variable
 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Variable (const Variable *variable)
 
virtual int type () const
 
virtual bool representsEven (bool=false)
 
virtual bool representsOdd (bool=false)
 
virtual bool representsUndefined (bool=false, bool=false, bool=false)
 
virtual bool representsBoolean ()
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
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)
 

Protected Attributes

Assumptionso_assumption
 
- Protected Attributes inherited from ExpressionItem
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

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_localIf the variable is local/user-defined or global.
is_builtinIf the variable is builtin and not modifiable.
is_activeIf 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
variableUnknown variable to copy.

Member Function Documentation

Assumptions* UnknownVariable::assumptions ( )

Returns the assumptions of the unknown variable.

Returns
Assumptions of the unknown variable.
bool UnknownVariable::isKnown ( ) const
inlinevirtual

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 UnknownVariable::representsPositive ( bool  = false)
virtual

Returns if the variable represents a positive value.

Reimplemented from Variable.

void UnknownVariable::setAssumptions ( Assumptions ass)

Sets the assumptions of the unknown variable.

Parameters
assAssumptions.
int UnknownVariable::subtype ( ) const
inlinevirtual

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

Returns
VariableSubtype.

Reimplemented from Variable.

References SUBTYPE_UNKNOWN_VARIABLE.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/functions_func_m.html0000644000175000017500000001113512757636735021271 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- m -

libqalculate-0.9.10/docs/reference/html/structPlotParameters.html0000644000175000017500000004165412757636735022152 00000000000000 libqalculate-0.9.8: PlotParameters Struct Reference
PlotParameters Struct Reference

Parameters passed to plotting functions. More...

#include <Calculator.h>

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:
libqalculate-0.9.10/docs/reference/html/classBinaryPrefix-members.html0000644000175000017500000002034412757636735023014 00000000000000 libqalculate-0.9.8: 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)BinaryPrefixprotected
exponent(int iexp=1) const BinaryPrefix
exponent(const Number &nexp) const BinaryPrefix
l_name (defined in Prefix)Prefixprotected
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)Prefixprotected
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 BinaryPrefixvirtual
u_name (defined in Prefix)Prefixprotected
unicodeName(bool return_short_if_no_uni=true) const Prefix
value(const Number &nexp) const BinaryPrefixvirtual
value(int iexp) const BinaryPrefixvirtual
value() const BinaryPrefixvirtual
~BinaryPrefix() (defined in BinaryPrefix)BinaryPrefix
~Prefix() (defined in Prefix)Prefixvirtual
libqalculate-0.9.10/docs/reference/html/classDataPropertyArgument.png0000644000175000017500000000113712757636735022722 00000000000000PNG  IHDRP fPLTEutRNST2IDATx IasV4 O%9e K"$$L$I`MR$0iS#o"էl}٦/=H6;m567U._)kSWm_CSMT,= %OlZ$+|MpI IY&W <a)c%l2 e{      ?mRJiH6>alʒ>6Mp2D/؇lo_eRǵLnJj^KCmke=g6P5{qmV v}C2` 6ވӫڔC=_=̍?S׹---y3ʅ]>C3N;~جpS%48.nUƹtQ?6^u;{jsQ;]o8a೜MJ)qA~IENDB`libqalculate-0.9.10/docs/reference/html/classSymbolicArgument-members.html0000644000175000017500000003162412757636735023701 00000000000000 libqalculate-0.9.8: 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const SymbolicArgumentvirtual
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const SymbolicArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const SymbolicArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const SymbolicArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
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 SymbolicArgumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~SymbolicArgument() (defined in SymbolicArgument)SymbolicArgumentvirtual
libqalculate-0.9.10/docs/reference/html/classIntegerArgument-members.html0000644000175000017500000003515612757636735023521 00000000000000 libqalculate-0.9.8: 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const IntegerArgumentvirtual
getCustomCondition() const Argument
imax (defined in IntegerArgument)IntegerArgumentprotected
imin (defined in IntegerArgument)IntegerArgumentprotected
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 Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const IntegerArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)IntegerArgumentvirtual
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)Argumentprotected
subprintlong() const IntegerArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const IntegerArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const IntegerArgumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~IntegerArgument() (defined in IntegerArgument)IntegerArgumentvirtual
libqalculate-0.9.10/docs/reference/html/classUnitArgument.html0000644000175000017500000006571612757636735021420 00000000000000 libqalculate-0.9.8: UnitArgument Class Reference
Inheritance diagram for UnitArgument:
Argument

Public Member Functions

 UnitArgument (string name_="", bool does_test=true, bool does_error=true)
 
 UnitArgument (const UnitArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 

Member Function Documentation

virtual Argument* UnitArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

virtual string UnitArgument::print ( ) const
virtual

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

Returns
Short description.

Reimplemented from Argument.

virtual string UnitArgument::subprintlong ( ) const
protectedvirtual

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 bool UnitArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int UnitArgument::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:
libqalculate-0.9.10/docs/reference/html/globals.html0000644000175000017500000002677612757636735017376 00000000000000 libqalculate-0.9.8: File 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 -

libqalculate-0.9.10/docs/reference/html/classVariable-members.html0000644000175000017500000007340012757636735022140 00000000000000 libqalculate-0.9.8: 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)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
category() const ExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const =0 (defined in Variable)Variablepure virtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() const ExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
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 ExpressionItemvirtual
getName(size_t index) const ExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() const ExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) const ExpressionItemvirtual
hasNameCaseSensitive(const string &sname) const ExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() const ExpressionItemvirtual
isApproximate() const ExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() const =0Variablepure virtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
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)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
precision() const ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() const ExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in Variable)Variableinlinevirtual
representsComplex(bool=false) (defined in Variable)Variableinlinevirtual
representsEven(bool=false) (defined in Variable)Variableinlinevirtual
representsInteger(bool=false) (defined in Variable)Variableinlinevirtual
representsNegative(bool=false) (defined in Variable)Variableinlinevirtual
representsNonMatrix() (defined in Variable)Variableinlinevirtual
representsNonNegative(bool=false) (defined in Variable)Variableinlinevirtual
representsNonPositive(bool=false) (defined in Variable)Variableinlinevirtual
representsNonZero(bool=false) (defined in Variable)Variableinlinevirtual
representsNumber(bool=false) (defined in Variable)Variableinlinevirtual
representsOdd(bool=false) (defined in Variable)Variableinlinevirtual
representsPositive(bool=false)Variableinlinevirtual
representsRational(bool=false) (defined in Variable)Variableinlinevirtual
representsReal(bool=false) (defined in Variable)Variableinlinevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in Variable)Variableinlinevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in Variable)Variablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() const Variableinlinevirtual
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 ExpressionItemvirtual
type() const Variableinlinevirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
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)ExpressionItemvirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-0.9.10/docs/reference/html/classDateArgument.html0000644000175000017500000006641012757636735021346 00000000000000 libqalculate-0.9.8: DateArgument Class Reference

A date argument. More...

#include <Function.h>

Inheritance diagram for DateArgument:
Argument

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
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Argument
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 date argument.

A text argument representing a date.

Member Function Documentation

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.

virtual string DateArgument::subprintlong ( ) const
protectedvirtual

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 bool DateArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int DateArgument::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:
libqalculate-0.9.10/docs/reference/html/structPlotDataParameters.html0000644000175000017500000001363612757636735022743 00000000000000 libqalculate-0.9.8: PlotDataParameters Struct Reference
PlotDataParameters Struct Reference

Parameters for plot data series. More...

#include <Calculator.h>

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:
libqalculate-0.9.10/docs/reference/html/classNumberArgument.png0000644000175000017500000000100512757636735021526 00000000000000PNG  IHDRnPPLTEutRNST2IDATxn g?#71q ъV`eK! I:IrL&}Y(-96X#]0%a7%IR*h I2ԽF.ptSI2k{2[]udIڙ%I2U=NהR>bntgX Iru! OxcX[{V|gn[8uNl[8uWցb+],:~:IK建I;*OJQ)PjQ4]R@ O7X95Gw<ŕ@vMZut ĨW2ONtOu5x0鯃.FՋNf 3p+;dUy]/=g`puff:(IIENDB`libqalculate-0.9.10/docs/reference/html/classArgumentSet-members.html0000644000175000017500000003406612757636735022656 00000000000000 libqalculate-0.9.8: 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const ArgumentSetvirtual
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 Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const ArgumentSetvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subargs (defined in ArgumentSet)ArgumentSetprotected
subprintlong() const ArgumentSetprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const ArgumentSetprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const ArgumentSetvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~ArgumentSet() (defined in ArgumentSet)ArgumentSetvirtual
libqalculate-0.9.10/docs/reference/html/DataSet_8h.html0000644000175000017500000001566412757636735017671 00000000000000 libqalculate-0.9.8: libqalculate/DataSet.h File Reference
DataSet.h File Reference

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 vector< DataProperty * >::iterator DataObjectPropertyIter
 
typedef vector< DataProperty * >::iterator DataPropertyIter
 
typedef vector< DataObject * >::iterator DataObjectIter
 

Enumerations

enum  PropertyType { PROPERTY_EXPRESSION, PROPERTY_NUMBER, PROPERTY_STRING }
 
libqalculate-0.9.10/docs/reference/html/classMathStructure-members.html0000644000175000017500000036263312757636735023236 00000000000000 libqalculate-0.9.8: 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)MathStructureprotected
b_plural (defined in MathStructure)MathStructureprotected
b_protected (defined in MathStructure)MathStructureprotected
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
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
containsFunction(MathFunction *f, bool structural_only=true, bool check_variables=false, bool check_functions=false) 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, Prefix *new_prefix=NULL) (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)MathStructureprotected
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)MathStructureprotected
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)MathStructurestatic
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)MathStructureprotected
i_ref (defined in MathStructure)MathStructureprotected
improve_division_multipliers(const PrintOptions &po=default_print_options) (defined in MathStructure)MathStructure
init() (defined in MathStructure)MathStructureprotected
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
isAborted() const (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)MathStructureprotected
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)MathStructurestatic
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)MathStructureprotected
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)MathStructureprotected
o_number (defined in MathStructure)MathStructureprotected
o_prefix (defined in MathStructure)MathStructureprotected
o_uncertainty (defined in MathStructure)MathStructureprotected
o_unit (defined in MathStructure)MathStructureprotected
o_variable (defined in MathStructure)MathStructureprotected
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) 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)MathStructurestatic
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)MathStructurestatic
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)MathStructureprotected
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
setAborted(bool preserve_precision=false)MathStructure
setApproximate(bool is_approx=true, bool recuresive=false) (defined in MathStructure)MathStructure
setBitwiseNot() (defined in MathStructure)MathStructure
setChild(const MathStructure &o, size_t index=1, bool merge_precision=false) (defined in MathStructure)MathStructure
setChild_nocopy(MathStructure *o, size_t index=1, bool merge_precision=false) (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, bool recursive=false) (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
setPrefixForUnit(Unit *u, Prefix *new_prefix) (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
unit_exp_prefix() const (defined in MathStructure)MathStructure
unit_exp_unit() const (defined in MathStructure)MathStructure
unref() (defined in MathStructure)MathStructure
v_order (defined in MathStructure)MathStructureprotected
v_subs (defined in MathStructure)MathStructureprotected
variable() const (defined in MathStructure)MathStructure
~MathStructure() (defined in MathStructure)MathStructure
libqalculate-0.9.10/docs/reference/html/classExpressionItemArgument.png0000644000175000017500000000115012757636735023255 00000000000000PNG  IHDRPn|yPLTEutRNST2IDATx벣 #o\\ڝSt0_bq>4%IV\K\ t״Vk>Oz,IVh%(ţJ*"}'If.i=֘j:VU|B/5V*ZY&b,If>˟N$m5Ig^)ISjI*%IVՊ17SvkNՌ^jJZV\ kXq-+`ŵZV\ kXBa>ZV\ JJ !~b޳/mUNOƎ=N[.,6 t%r>/,]j6dk ^BD@ךsi?̔aڪɯن3~m{6kkj}͇2zUnz5j-6U{z5Q%?xj8h%fݮIJTVbJ):ȕ^gXiu /eM2V!L6 IENDB`libqalculate-0.9.10/docs/reference/html/Function_8h.html0000644000175000017500000003547512757636735020133 00000000000000 libqalculate-0.9.8: libqalculate/Function.h File Reference
Function.h File Reference

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...
 

Enumeration Type Documentation

Type of mathematical function.

Enumerator
SUBTYPE_FUNCTION 

class MathFunction

SUBTYPE_USER_FUNCTION 

class UseFunction

SUBTYPE_DATA_SET 

class DataSet

libqalculate-0.9.10/docs/reference/html/classDecimalPrefix-members.html0000644000175000017500000002041212757636735023122 00000000000000 libqalculate-0.9.8: 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)DecimalPrefixprotected
exponent(int iexp=1) const DecimalPrefix
exponent(const Number &nexp) const DecimalPrefix
l_name (defined in Prefix)Prefixprotected
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)Prefixprotected
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 DecimalPrefixvirtual
u_name (defined in Prefix)Prefixprotected
unicodeName(bool return_short_if_no_uni=true) const Prefix
value(const Number &nexp) const DecimalPrefixvirtual
value(int iexp) const DecimalPrefixvirtual
value() const DecimalPrefixvirtual
~DecimalPrefix() (defined in DecimalPrefix)DecimalPrefix
~Prefix() (defined in Prefix)Prefixvirtual
libqalculate-0.9.10/docs/reference/html/classKnownVariable.html0000644000175000017500000017757112757636735021543 00000000000000 libqalculate-0.9.8: KnownVariable Class Reference

A variable with a known value. More...

#include <Variable.h>

Inheritance diagram for KnownVariable:
Variable ExpressionItem DynamicVariable

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 ()
 
- Public Member Functions inherited from Variable
 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Variable (const Variable *variable)
 
virtual int type () const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
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)
 

Protected Attributes

MathStructuremstruct
 
bool b_expression
 
int calculated_precision
 
string sexpression
 
- Protected Attributes inherited from ExpressionItem
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

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.
oValue.
title_Descriptive name.
is_localIf the variable is local/user-defined or global.
is_builtinIf the variable is builtin and not modifiable.
is_activeIf 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_localIf the variable is local/user-defined or global.
is_builtinIf the variable is builtin and not modifiable.
is_activeIf 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
variableKnown variable to copy.

Member Function Documentation

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.
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::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.
bool KnownVariable::isKnown ( ) const
inlinevirtual

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::representsPositive ( bool  = false)
virtual

Returns if the variable represents a positive value.

Reimplemented from Variable.

Reimplemented in DynamicVariable.

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

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

Parameters
oValue.

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.

int KnownVariable::subtype ( ) const
inlinevirtual

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

Returns
VariableSubtype.

Reimplemented from Variable.

References SUBTYPE_KNOWN_VARIABLE.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/structSortOptions.html0000644000175000017500000001024412757636735021502 00000000000000 libqalculate-0.9.8: SortOptions Struct Reference
SortOptions Struct Reference

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

#include <includes.h>

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:
libqalculate-0.9.10/docs/reference/html/MathStructure_8h.html0000644000175000017500000001213212757636735021141 00000000000000 libqalculate-0.9.8: libqalculate/MathStructure.h File Reference
MathStructure.h File Reference

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 }
 
libqalculate-0.9.10/docs/reference/html/annotated.html0000644000175000017500000004211012757636735017704 00000000000000 libqalculate-0.9.8: Class List
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
 CAliasUnitAn unit with relation to another unit
 CAliasUnit_CompositeA subunit in a CompositeUnit
 CAngleArgument
 CArgumentA mathematical function argument definition with free value and base class for all argument definitions
 CArgumentSetA set of accepted arguments
 CAssumptionsAn assumption about an unknown mathematical value
 CBinaryPrefixA binary prefix
 CBooleanArgumentA boolean argument
 CCalculatorThe almighty calculator class
 CCalculatorMessageA message with information to the user. Primarily used for errors and warnings
 CCompositeUnitA unit consisting of a number of other units
 CDataObjectA a data set object
 CDataObjectArgumentData object function argument
 CDataPropertyA data set property
 CDataPropertyArgumentData property function argument
 CDataSetA data set
 CDateArgumentA date argument
 CDecimalPrefixA decimal (metric) prefix
 CDynamicVariableAbstract base class for variables with a value which is recalculated when the precision has changed
 CElement
 CEvaluationOptionsOptions for calculation
 CExpressionItemAbstract base class for functions, variables and units
 CExpressionItemArgumentArgument for functions, variables and units
 CExpressionNameA name for an expression item (function, variable or unit)
 CFileArgument
 CFunctionArgumentA function argument
 CIntegerArgumentA definition for integer arguments
 CInternalPrintStruct
 CKnownVariableA variable with a known value
 CMathFunctionAbstract base class for mathematical functions
 CMathStructureA structure representing a mathematical value/expression/result
 CMatrixArgumentA matrix argument
 CNumberA number
 CNumberArgumentA definition for numerical arguments
 CNumberPrefixA prefix with a free numerical value
 CParseOptionsOptions for parsing expressions
 CPlotDataParametersParameters for plot data series
 CPlotParametersParameters passed to plotting functions
 CPrefixAbstract class for prefixes
 CPrintOptionsOptions for formatting and display of mathematical structures/results
 CSortOptionsOptions for ordering the parts of a mathematical expression/result before display
 CSymbolicArgumentA symbolic argument
 CTextArgumentA text argument
 CUnitA unit for measurement
 CUnitArgument
 CUnknownVariableA variable with unknown value
 CUserFunctionA user defined mathematical function
 CVariableAbstract base class for variables
 CVariableArgument
 CVectorArgumentA vector argument
libqalculate-0.9.10/docs/reference/html/functions_s.html0000644000175000017500000004146412757636735020274 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- s -

libqalculate-0.9.10/docs/reference/html/classUnitArgument-members.html0000644000175000017500000003141412757636735023034 00000000000000 libqalculate-0.9.8: Member List
UnitArgument Member List

This is the complete list of members for UnitArgument, 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const UnitArgumentvirtual
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const UnitArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const UnitArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const UnitArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const UnitArgumentvirtual
UnitArgument(string name_="", bool does_test=true, bool does_error=true) (defined in UnitArgument)UnitArgument
UnitArgument(const UnitArgument *arg) (defined in UnitArgument)UnitArgument
zeroForbidden() const Argument
~Argument()Argumentvirtual
~UnitArgument() (defined in UnitArgument)UnitArgumentvirtual
libqalculate-0.9.10/docs/reference/html/classAliasUnit__Composite-members.html0000644000175000017500000012213112757636735024461 00000000000000 libqalculate-0.9.8: 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)Unitvirtual
addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
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)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
b_si (defined in Unit)Unitprotected
b_use_with_prefixes (defined in Unit)Unitprotected
baseExponent(int exp=1) const (defined in AliasUnit)AliasUnitvirtual
baseUnit() const (defined in AliasUnit)AliasUnitvirtual
category() const ExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
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)AliasUnitvirtual
convertFromBaseUnit(MathStructure &mvalue) const (defined in AliasUnit)AliasUnitvirtual
convertFromBaseUnit() const (defined in AliasUnit)AliasUnitvirtual
convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnitvirtual
convertToBaseUnit(MathStructure &mvalue) const (defined in AliasUnit)AliasUnitvirtual
convertToBaseUnit() const (defined in AliasUnit)AliasUnitvirtual
convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
copy() const (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() const ExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
expression() const (defined in AliasUnit)AliasUnitvirtual
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 ExpressionItemvirtual
firstBaseExponent() const (defined in AliasUnit)AliasUnitvirtual
firstBaseUnit() const (defined in AliasUnit)AliasUnitvirtual
getName(size_t index) const ExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() const ExpressionItemvirtual
hasComplexExpression() const (defined in AliasUnit)AliasUnitvirtual
hasComplexRelationTo(Unit *u) const (defined in AliasUnit)AliasUnitvirtual
hasName(const string &sname, bool case_sensitive=true) const ExpressionItemvirtual
hasNameCaseSensitive(const string &sname) const ExpressionItemvirtual
i_exp (defined in AliasUnit)AliasUnitprotected
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
inverseExpression() const (defined in AliasUnit)AliasUnitvirtual
isActive() const ExpressionItemvirtual
isApproximate() const ExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isChildOf(Unit *u) const AliasUnitvirtual
isCurrency() const Unit
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isParentOf(Unit *u) const AliasUnitvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
isSIUnit() const Unit
isUsedByOtherUnits() const (defined in Unit)Unitvirtual
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)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
o_unit (defined in AliasUnit)AliasUnitprotected
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)Unitvirtual
precision() const ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
prefix() const (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
prefixExponent() const (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
prefixv (defined in AliasUnit_Composite)AliasUnit_Compositeprotected
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_Compositevirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() const ExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
set(Unit *u, int exp=1, Prefix *prefix_=NULL) (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setAsSIUnit()Unit
setBaseUnit(Unit *alias) (defined in AliasUnit)AliasUnitvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setExponent(int exp) (defined in AliasUnit)AliasUnitvirtual
setExpression(string relation)AliasUnitvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setInverseExpression(string inverse)AliasUnitvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setSystem(string s_system)Unit
setTitle(string title_)ExpressionItemvirtual
setUseWithPrefixesByDefault(bool use_with_prefixes)Unit
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)Unitvirtual
sinverse (defined in AliasUnit)AliasUnitprotected
ssystem (defined in Unit)Unitprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() const AliasUnitvirtual
svalue (defined in AliasUnit)AliasUnitprotected
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 ExpressionItemvirtual
type() const Unitvirtual
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)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
useWithPrefixesByDefault() const Unit
v_refs (defined in ExpressionItem)ExpressionItemprotected
~AliasUnit() (defined in AliasUnit)AliasUnitvirtual
~AliasUnit_Composite() (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~Unit() (defined in Unit)Unitvirtual
libqalculate-0.9.10/docs/reference/html/structSortOptions-members.html0000644000175000017500000000601312757636735023131 00000000000000 libqalculate-0.9.8: 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)SortOptionsinline
libqalculate-0.9.10/docs/reference/html/classMathStructure.html0000644000175000017500000067601312757636735021606 00000000000000 libqalculate-0.9.8: MathStructure Class Reference

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

#include <MathStructure.h>

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 setAborted (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
 
Unitunit_exp_unit () const
 
Prefixprefix () const
 
Prefixunit_exp_prefix () 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, bool merge_precision=false)
 
void setChild_nocopy (MathStructure *o, size_t index=1, bool merge_precision=false)
 
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 isAborted () 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 recuresive=false)
 
bool isApproximate () const
 
void setPrecision (int prec, bool recursive=false)
 
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 setPrefixForUnit (Unit *u, Prefix *new_prefix)
 
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, Prefix *new_prefix=NULL)
 
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
 
int containsFunction (MathFunction *f, bool structural_only=true, 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 ()
 

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.

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.

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
oThe 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
numThe numerator of the numeric value.
denThe denominator of the numeric value.
exp10The base 10 exponent of the numeric value.
MathStructure::MathStructure ( string  sym)

Create a new symbolic/text structure.

Parameters
symSymbolic/text value.
MathStructure::MathStructure ( double  float_value)

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

Parameters
oNumeric value.
MathStructure::MathStructure ( const MathStructure o,
  ... 
)

Create a new vector.

Parameters
oThe first element (copied) in the vector.
...Elements (copied) in the vector. End with NULL.
MathStructure::MathStructure ( MathFunction o,
  ... 
)

Create a new function structure.

Parameters
oFunction value.
...Arguments (copied) to the function. End with NULL.
MathStructure::MathStructure ( Unit u,
Prefix p = NULL 
)

Create a new unit structure.

Parameters
uThe unit value.
pPrefix of the unit.
MathStructure::MathStructure ( Variable o)

Create a new variable structure.

Parameters
oVariable value.
MathStructure::MathStructure ( const Number o)

Create a new numeric structure.

Parameters
oNumeric value.

Member Function Documentation

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.

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

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

Parameters
indexIndex (starting at 1) of the updated child. If true, do the same for each child of the child.
void MathStructure::clear ( bool  preserve_precision = false)

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

Parameters
preserve_precisionPreserve the current precision.
void MathStructure::clearMatrix ( bool  preserve_precision = false)

Set the structure to an empty matrix.

Parameters
preserve_precisionPreserve the current precision.
void MathStructure::clearVector ( bool  preserve_precision = false)

Set the structure to an empty vector.

Parameters
preserve_precisionPreserve the current precision.
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.
MathStructure& MathStructure::operator[] ( size_t  index)

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

Parameters
indexIndex (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
indexIndex (starting at zero).
void MathStructure::set ( const MathStructure o,
bool  merge_precision = false 
)

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

Parameters
oThe structure to copy.
merge_precisionPreserve 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
numThe numerator of the new numeric value.
denThe denominator of the new numeric value.
exp10The base 10 exponent of the new numeric value.
preserve_precisionPreserve 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
oThe new symolic/text value.
preserve_precisionPreserve 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
oThe new numeric value.
preserve_precisionPreserve the current precision (unless the new value has a lower precision).
void MathStructure::set ( MathFunction o,
  ... 
)

Set the structure to a mathematical function.

Parameters
oThe 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
uThe new unit value.
pPrefix of the unit.
preserve_precisionPreserve 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
oThe new variable value.
preserve_precisionPreserve the current precision.
void MathStructure::set ( const Number o,
bool  preserve_precision = false 
)

Set the structure to a number.

Parameters
oThe new numeric value.
preserve_precisionPreserve 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
oThe structure to copy.
merge_precisionPreserve the current precision (unless the new value has a lower precision).
void MathStructure::setAborted ( bool  preserve_precision = false)

Mark that calculation was aborted.

Parameters
preserve_precisionPreserve 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
mtypeThe new structure type
void MathStructure::setUndefined ( bool  preserve_precision = false)

Set the value of the structure to undefined.

Parameters
preserve_precisionPreserve the current precision.
void MathStructure::setVector ( const MathStructure o,
  ... 
)

Set the structure to a vector.

Parameters
oThe first element (copied) in the new vector.
...Elements (copied) in the new vector. End with NULL.

The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/classVectorArgument.png0000644000175000017500000000077612757636735021556 00000000000000PNG  IHDRhPSPLTEutRNST2IDATx g?OYJzdaV9fϳD4$us|p r^!%TzGTe\g$5)*PRAZEϕ(%Js[IjGw/5Ǫk_wHw&Itm ߄$ "眛@7=LDO4VDC,K0 DC,K?ff3> 1_BcmѻS"}U)K&ގ83}| Rȝ!IZ+QCQjߋ_EsQp*ڝ!`Tє"ё>]TݶpZQ libqalculate-0.9.8: Class Members - Functions
 

- n -

libqalculate-0.9.10/docs/reference/html/classNumber-members.html0000644000175000017500000013663612757636735021656 00000000000000 libqalculate-0.9.8: 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)Numberprotected
b_inf (defined in Number)Numberprotected
b_minf (defined in Number)Numberprotected
b_pinf (defined in Number)Numberprotected
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)Numberprotected
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 (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) 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)Numberprotected
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)Numberprotected
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)Numberprotected
testInteger() (defined in Number)Numberprotected
toBoolean() (defined in Number)Number
trunc(const Number &o) (defined in Number)Number
trunc() (defined in Number)Number
value (defined in Number)Numberprotected
zeta()Number
~Number() (defined in Number)Numbervirtual
libqalculate-0.9.10/docs/reference/html/classMatrixArgument.png0000644000175000017500000000100712757636735021544 00000000000000PNG  IHDReP7KPLTEutRNST2IDATxr F~\ d&ӱ9xMJ)IfZ$)$xd#RẔ~mM"%鞁D\%lݽtKJ-jܾ #oϒoYd7$mX-e릯 H҆ݏ^Ҹs0/I_"|% pN\.ghN\%'hα|aZ"L @i0- p0d*mK_Ã\Ip#퀗_2߂\Z=y8t^vRfsJ-4&g̲cK7x`cGoO6foߠ}+֬rCKuy||_s\+e3 B:IENDB`libqalculate-0.9.10/docs/reference/html/functions.html0000644000175000017500000001725312757636735017751 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- a -

libqalculate-0.9.10/docs/reference/html/util_8h.html0000644000175000017500000006225312757636735017315 00000000000000 libqalculate-0.9.8: libqalculate/util.h File Reference
util.h File Reference

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 s2date (string str, void *gtime)
 
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 getOldLocalDir ()
 
string getLocalDir ()
 
string getLocalDataDir ()
 
string getLocalTmpDir ()
 
bool move_file (const char *from_file, const char *to_file)
 
libqalculate-0.9.10/docs/reference/html/structElement-members.html0000644000175000017500000000753412757636735022230 00000000000000 libqalculate-0.9.8: Member List
Element Member List

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

group (defined in Element)Element
name (defined in Element)Element
number (defined in Element)Element
symbol (defined in Element)Element
weight (defined in Element)Element
x_pos (defined in Element)Element
y_pos (defined in Element)Element
libqalculate-0.9.10/docs/reference/html/classDecimalPrefix.png0000644000175000017500000000070212757636735021312 00000000000000PNG  IHDRZPVPLTEutRNST2QIDATxr E_>3{#wEuM;4#@)Ę"IN$CHbt+tk1IzhLt]yս^^Гtm֮r/zFklPOc6*kk vjWu ћT -tސ x]1z! h:рWXY?N}IENDB`libqalculate-0.9.10/docs/reference/html/nav_g.png0000644000175000017500000000013712757636734016643 00000000000000PNG  IHDR1&IDATx1 OHf_ ->~M iMS<IENDB`libqalculate-0.9.10/docs/reference/html/functions_l.html0000644000175000017500000001521312757636735020256 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- l -

libqalculate-0.9.10/docs/reference/html/classVariable.html0000644000175000017500000014075112757636735020514 00000000000000 libqalculate-0.9.8: Variable Class Reference
Variable Class Referenceabstract

Abstract base class for variables. More...

#include <Variable.h>

Inheritance diagram for Variable:
ExpressionItem KnownVariable UnknownVariable DynamicVariable

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 ()
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
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)
 

Additional Inherited Members

- Protected Attributes inherited from ExpressionItem
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 variables.

A variable is an alpha-numerical representation of a known or unknown value.

Member Function Documentation

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 KnownVariable, and UnknownVariable.

virtual bool Variable::representsPositive ( bool  = false)
inlinevirtual

Returns if the variable represents a positive value.

Reimplemented in DynamicVariable, KnownVariable, and UnknownVariable.

virtual int Variable::subtype ( ) const
inlinevirtual

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

Returns
VariableSubtype.

Implements ExpressionItem.

Reimplemented in KnownVariable, and UnknownVariable.

References SUBTYPE_VARIABLE.

virtual int Variable::type ( ) const
inlinevirtual

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

Returns
ExpressionItemType.

Implements ExpressionItem.

References TYPE_VARIABLE.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/functions_z.html0000644000175000017500000001070512757636735020275 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- z -

libqalculate-0.9.10/docs/reference/html/functions_o.html0000644000175000017500000001054612757636735020265 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- o -

libqalculate-0.9.10/docs/reference/html/classUserFunction.html0000644000175000017500000023407412757636735021415 00000000000000 libqalculate-0.9.8: UserFunction Class Reference

A user defined mathematical function. More...

#include <Function.h>

Inheritance diagram for UserFunction:
MathFunction ExpressionItem

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
 
- Public Member Functions inherited from MathFunction
 MathFunction (string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true)
 
 MathFunction (const MathFunction *function)
 
virtual int type () 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)
 
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
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
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)
 

Protected Attributes

string sformula
 
string sformula_calc
 
vector< string > v_subs
 
vector< bool > v_precalculate
 
- Protected Attributes inherited from MathFunction
MathFunction_p * priv
 
int argc
 
int max_argc
 
vector< string > default_values
 
size_t last_argdef_index
 
string scondition
 
- Protected Attributes inherited from ExpressionItem
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
 

Additional Inherited Members

- Protected Member Functions inherited from MathFunction
bool testArguments (MathStructure &vargs)
 
virtual MathStructure createFunctionMathStructureFromVArgs (const MathStructure &vargs)
 
virtual MathStructure createFunctionMathStructureFromSVArgs (vector< string > &svargs)
 

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 ('\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.

Member Function Documentation

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]mstructStructure that is set with the result of the calculation.
vargsArguments passed to the mathematical function.
eoEvaluation options.
Returns
1 if the calculation was successful.

Reimplemented from MathFunction.

string UserFunction::formula ( ) const

Returns the external representation of the formula.

string UserFunction::internalFormula ( ) const

Returns the internal representation of the formula.

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

Sets the formula of the mathematical function.

Parameters
new_formulaFormula/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
indexIndex (starting at 1).
subfunctionFormula/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:
libqalculate-0.9.10/docs/reference/html/classCompositeUnit.png0000644000175000017500000000115512757636735021403 00000000000000PNG  IHDR`/QPLTEutRNST2IDATxir0[cxqԠePkor$I2yN$`8vHm Wj\c}壣!zn1It곩%VКkDڂX*mzJ2$Itq6S8[q_/I2yBsΎ\[uo_؄$&!0 ILB`򅂜s,I~@LA8$鐛uA*HJ}3\[2H wAj'gO$"dI2yBsΎ\[uo_؄$&!0 ILB`򅂔RGL W:Ŷp`a}+h* Mct1ƺy,Lnێ7)"!5."ОNOiʐB}VI&]ڃ7z٘)*Rɿ!ML#?(M02IENDB`libqalculate-0.9.10/docs/reference/html/functions_h.html0000644000175000017500000001264712757636735020262 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- h -

libqalculate-0.9.10/docs/reference/html/classAngleArgument-members.html0000644000175000017500000003150712757636735023146 00000000000000 libqalculate-0.9.8: Member List
AngleArgument Member List

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

alerts() const Argument
AngleArgument(string name_="", bool does_test=true, bool does_error=true) (defined in AngleArgument)AngleArgument
AngleArgument(const AngleArgument *arg) (defined in AngleArgument)AngleArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const AngleArgumentvirtual
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const AngleArgumentvirtual
Argument::parse(const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const AngleArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const AngleArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const AngleArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const AngleArgumentvirtual
zeroForbidden() const Argument
~AngleArgument() (defined in AngleArgument)AngleArgumentvirtual
~Argument()Argumentvirtual
libqalculate-0.9.10/docs/reference/html/functions_func_l.html0000644000175000017500000001333312757636735021272 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- l -

libqalculate-0.9.10/docs/reference/html/classNumberPrefix.html0000644000175000017500000004525112757636735021374 00000000000000 libqalculate-0.9.8: NumberPrefix Class Reference

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

#include <Prefix.h>

Inheritance diagram for NumberPrefix:
Prefix

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
 
- Public Member Functions inherited from Prefix
 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
 

Protected Attributes

Number o_number
 
- Protected Attributes inherited from Prefix
string l_name
 
string s_name
 
string u_name
 

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
nrValue of the prefix.
long_nameLong name.
short_nameShort name.
unicode_nameUnicode name.

Member Function Documentation

void NumberPrefix::setValue ( const Number nr)

Sets the value of the prefix.

Parameters
nrNew value for the 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.

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

Returns the value of the prefix.

Parameters
nexpThe 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
iexpThe 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.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/classUnit-members.html0000644000175000017500000010133512757636735021331 00000000000000 libqalculate-0.9.8: 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)Unitvirtual
addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
b_si (defined in Unit)Unitprotected
b_use_with_prefixes (defined in Unit)Unitprotected
baseExponent(int exp=1) const (defined in Unit)Unitvirtual
baseUnit() const (defined in Unit)Unitvirtual
category() const ExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
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)Unitvirtual
convertFromBaseUnit(MathStructure &mvalue) const (defined in Unit)Unitvirtual
convertFromBaseUnit() const (defined in Unit)Unitvirtual
convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in Unit)Unitvirtual
convertToBaseUnit(MathStructure &mvalue) const (defined in Unit)Unitvirtual
convertToBaseUnit() const (defined in Unit)Unitvirtual
copy() const (defined in Unit)Unitvirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() const ExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
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 ExpressionItemvirtual
getName(size_t index) const ExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() const ExpressionItemvirtual
hasComplexRelationTo(Unit *u) const (defined in Unit)Unitvirtual
hasName(const string &sname, bool case_sensitive=true) const ExpressionItemvirtual
hasNameCaseSensitive(const string &sname) const ExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() const ExpressionItemvirtual
isApproximate() const ExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isChildOf(Unit *u) const Unitvirtual
isCurrency() const Unit
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isParentOf(Unit *u) const Unitvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
isSIUnit() const Unit
isUsedByOtherUnits() const (defined in Unit)Unitvirtual
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)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
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)Unitvirtual
precision() const ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 Unitvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() const ExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in Unit)Unitvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setAsSIUnit()Unit
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setSystem(string s_system)Unit
setTitle(string title_)ExpressionItemvirtual
setUseWithPrefixesByDefault(bool use_with_prefixes)Unit
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)Unitvirtual
ssystem (defined in Unit)Unitprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() const Unitvirtual
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 ExpressionItemvirtual
type() const Unitvirtual
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)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
useWithPrefixesByDefault() const Unit
v_refs (defined in ExpressionItem)ExpressionItemprotected
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~Unit() (defined in Unit)Unitvirtual
libqalculate-0.9.10/docs/reference/html/classArgument.png0000644000175000017500000001501612757636735020364 00000000000000PNG  IHDR6-PLTEutRNST2IDATxvJ t }AdaTboTv {e+@\Mcl-_ml' nb;8>OmlsaZ~&پvSdf*#5i w봓Nn6Ugfl;#)c+@\W67`v S4u+@ڗZ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqOaaxsT_ƕM5lqeSNչkTo-婫ToIl_xbb;^/gwO}T_ӻUiyTՖ 4]1lNǻl1~?<;m9ٶzmW϶ #C9Nf;]G]=l6ճ~?N&ջmm`pYmpMkpY綹HUZTʦW6ոƽ0 W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@S؆a^/G6WlqeS+j\T6ŶS Övmv8~͡0 ÐjjCl' nb;8>OFy& ;]'f؎cΐTl~TjݛmOmg]q7#;Î+xvRU:a[efl;='EʦW6ոƕM5 ؆a^.G6mW6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\6 z<簩ZeS+j\Tʦl.Eǿ5՟vR&piNl׹[ M}<ߎ4 W^g-=P6gy8,Via[^"F]m뫪}³AtZuwvyv`Z=-7M'>m٪}l;c?V6ոƕM5lqo6 r<lĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\a Q=M*j\TʦW6ո7d}[~>88qqZNߑ엜s 4 t{jsKf<1ο+Fqt:ޙmw|icGֳkmn5*x"Ҽc[|ᩫׯҕɹv7fxNzt{]q]";lqf7/֛;/fGQuzC6_v9MT(u~}:4Tߦ~1.x߷٦ʦW6ոƕM5 ؆a^.G6mW6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\6 z<簩ZeS+j\TʦVl+WZ xu~-ǿ{gf;`4?~[p~El[=s'Սk7m /Ԋl~7_\ړz=l~~Ho϶iݘٶ;خ?nqZ:lk7nSNzDlu'U}󷆫^ylNV}ۍCfS}VeS+j\Tʦl0 /z +@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqOaaxsT_ƕM5lqeSjoo Cc;=̺ςp:8xzyq66UG0;Uﵵvmnlǽ֎+o-Mw?l~T"]ޟm뫪Nzl`[?>|+.w5i wk{U6To&>mчͶq-MHUƕM5lqeS{a Q= `ە lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6 0^9lVTʦW6ոƽ O]:q~aSn}Sggfӻ0<޴b;}xp-ho7ێ?NHtx~(45 26OuY+_ t:;m9]p{lMOcwu-ܘ$o>|etZz-ngEz\,;IWb _Mĸ+y Nl5/L-;˦uZ?lgeS+j\Tʦl0 /z +@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqOaaxsT_ƕM5lqeS xx-Ϋrfخ]lvy xy"z]i/"NMkm}U6l`[?Hk0cO?6_ɤzbImHUQTʦW6ոƽ0 W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@S؆a^/G6WlqeS+j\Tޗmwz.zߘMV/R }83xib;CO߸lwO ۑqՋٶmznxvk|"mC[~xWڏm}UM̶qw-V[gw+lwί[e7'>muq;NjG/R?lqeS+j\TހmxTOave+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ )l0 zU6ոƕM5lqoζN¶Kݶw}8p<8>9w96vKIo|s"=mbLz[mlIWoWަؾ-f͸o\ַl~Tou1*7fmsm֏O^wsy;״Nߧz7gS 8>O7in-ff+AV[rZl V7[~x[A9ݺkm}UV[mWblׇ-Œ<ӯv`^kX[=jOIn6:?giWU>sUeS+j\Tʦl0 /z +@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqOaaxsT_ƕM5lqeS{k:yVzwƿ7mm˾{:9u}nVh[l{|8}4.^o|f05 Z >_l |rumA2~Ջ{'==ʶO-jUߛm뫪NzvoE:. p|Il-` .ƞDU{gb?}aosm\iXƕM5lqeS{a Q= `ە lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6 0^9lVTʦW6ոmmw.^Ǐg'Um?pf}$aod;Μ.!r$il Rnd;PݹzT1qi~Uw8ds:՝ͶUmq[Ezgi ͖IU&>muGͶӮ}"U}@eS+j\Tʦl0 /z +@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqOaaxsT_ƕM5lqeS n3~<~O/om>}(ۗx}w851W؎3H:Th{:jsw~b;?Uy3aЦgEz\kIs| Ǖ5mM~9TAlӬS>ivUտ#*j\TʦW6ո7`axS]W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe{ 0 æjM5lqeS+jN.ޭ V[cmluapr9~z?8]ǯsCTmm9ӧqӥ5|Em,+=ݹna5jylWִ& .ͪ=mNlgz a^ֳĵz}"q~xN[_\IUIn˶܆U>wvUռ^VTʦW6ոƽ0 W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@\W6ĕ lqe+@S؆a^/G6WlqeS+j\Tޝm{q)lmlw|`#u醯ͪ ۄ0G0UEI͹kUS}1~?<;l'ۼq0.~mk+϶klGH/V;r3d;mN0b-w<TO&ջ}" libqalculate-0.9.8: Number Class Reference

A number. More...

#include <Number.h>

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
numberText string to read number from.
poOptions 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

bool Number::add ( const Number o)

Add to the number (x+o).

Parameters
oNumber to add.
Returns
true if the operation was successful.
void Number::catalan ( )

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

bool Number::divide ( const Number o)

Divide the number (x/o).

Parameters
oNumber to divide by.
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::euler ( )

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

bool Number::exp10 ( const Number o)

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

Parameters
oNumber to raise 10 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 ( const Number o)

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

Parameters
oNumber to raise 2 by.
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.
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.
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]overflowIf 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.
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::isMinusInfinity ( ) const

Returns true if the number is minus infinity.

Returns
true if the number is minus infinity.
bool Number::isPlusInfinity ( ) const

Returns true if the number is plus infinity.

Returns
true if the number is plus infinity.
bool Number::multiply ( const Number o)

Multiply the number (x*o).

Parameters
oNumber to multiply with.
Returns
true if the operation was successful.
bool Number::negate ( )

Negate the number (-x).

Returns
true if the operation was successful.
void Number::pi ( )

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

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::raise ( const Number o,
bool  try_exact = true 
)

Raise the number (x^o).

Parameters
oNumber to raise to.
try_exactIf an exact solution should be tried first (might be slow).
Returns
true if the operation was successful.
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.
bool Number::recip ( )

Invert the number (1/x).

Returns
true if the operation was successful.
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_approximateIf the number shall be regarded as approximate.
bool Number::square ( )

Raise the number by two (x^2).

Returns
true if the operation was successful.
bool Number::subtract ( const Number o)

Subtracts from to the number (x-o).

Parameters
oNumber to subtract.
Returns
true if the operation was successful.
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:
libqalculate-0.9.10/docs/reference/html/tab_h.png0000644000175000017500000000026112757636734016624 00000000000000PNG  IHDR$[xIDATxM@~ΒEv"!d*rGq={SݧH uO^[_Xvyұ=VCff{R%_rug(?gh\i>|sIENDB`libqalculate-0.9.10/docs/reference/html/classDateArgument.png0000644000175000017500000000074712757636735021167 00000000000000PNG  IHDR\PPLTEutRNST2vIDATx RE.Zj$0 M!̂ IsXrII{6jGkKפӣWKږyEoWyNҶ\j:_IrH]SayYˑ\)KٲxyN`cQRJr =Su4­I`}r%!0 )<&gʟy/-KгKбKбKoff#Oݾ88/x3hMX'yN&0p*\s'?̦٥\kS_|nּ,uY˺<em{Bvy|Lpt|l?Yz$IENDB`libqalculate-0.9.10/docs/reference/html/classExpressionItemArgument.html0000644000175000017500000006757012757636735023457 00000000000000 libqalculate-0.9.8: ExpressionItemArgument Class Reference
ExpressionItemArgument Class Reference

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

#include <Function.h>

Inheritance diagram for ExpressionItemArgument:
Argument

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
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 

Detailed Description

Argument for functions, variables and units.

Text string representing a function, variable or unit name.

Member Function Documentation

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.

virtual string ExpressionItemArgument::subprintlong ( ) const
protectedvirtual

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 bool ExpressionItemArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int ExpressionItemArgument::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:
libqalculate-0.9.10/docs/reference/html/sync_on.png0000644000175000017500000000151512757636734017222 00000000000000PNG  IHDRw=IDATx_HTY8i4-g6&kQ)!0URKڅ/PE>K-+K.YdEPaAZSܝ;3wgfsWK.Da'q_k DQCg 0Y:qZ)~L0HV z-C%g68%wUϿ }? ?3 K@h aaUe s~2&&B*Alji*˨,oƣT,d[3-*> LɟfkҠw#*AEjKUy>&{8m5Ki jjD*Nigw7DmzK۾M!k?o_lX#~XӑR*EՂדE;6e"Q(=Ezæ5Kؼָ_ 1zBJ X96jL^7{J1i@%8'7M_\Q#Uy Wo x8sv|Sn q_m >b[JX,4[T{Ratjjzz'ȶiIws KC^Y%6ꈺ]vhiWvh'̂|[^YrD= libqalculate-0.9.8: 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const DataPropertyArgumentvirtual
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)DataPropertyArgumentprotected
parse(const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const DataPropertyArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const DataPropertyArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const DataPropertyArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const DataPropertyArgumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~DataPropertyArgument() (defined in DataPropertyArgument)DataPropertyArgument
libqalculate-0.9.10/docs/reference/html/functions_func_i.html0000644000175000017500000001475512757636735021300 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- i -

libqalculate-0.9.10/docs/reference/html/classAliasUnit.html0000644000175000017500000020160712757636735020656 00000000000000 libqalculate-0.9.8: AliasUnit Class Reference

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

#include <Unit.h>

Inheritance diagram for AliasUnit:
Unit ExpressionItem AliasUnit_Composite

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
 
- Public Member Functions inherited from Unit
 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)
 
bool isSIUnit () const
 
void setAsSIUnit ()
 
void setSystem (string s_system)
 
const string & system () const
 
bool useWithPrefixesByDefault () const
 
void setUseWithPrefixesByDefault (bool use_with_prefixes)
 
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 int type () 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
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
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)
 

Protected Attributes

string svalue
 
string sinverse
 
int i_exp
 
Unito_unit
 
- Protected Attributes inherited from Unit
string ssystem
 
bool b_si
 
bool b_use_with_prefixes
 
- Protected Attributes inherited from ExpressionItem
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

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 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.

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.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/functions_func_s.html0000644000175000017500000003573412757636735021312 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- s -

libqalculate-0.9.10/docs/reference/html/classBooleanArgument-members.html0000644000175000017500000003156212757636735023500 00000000000000 libqalculate-0.9.8: 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
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 BooleanArgumentvirtual
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const BooleanArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const BooleanArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const BooleanArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const BooleanArgumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~BooleanArgument() (defined in BooleanArgument)BooleanArgumentvirtual
libqalculate-0.9.10/docs/reference/html/structElement.html0000644000175000017500000001175712757636735020602 00000000000000 libqalculate-0.9.8: Element Struct Reference
Element Struct Reference

Public Attributes

string symbol
 
string name
 
int number
 
int group
 
string weight
 
int x_pos
 
int y_pos
 

The documentation for this struct was generated from the following file:
libqalculate-0.9.10/docs/reference/html/classDataObjectArgument.html0000644000175000017500000007123312757636735022470 00000000000000 libqalculate-0.9.8: DataObjectArgument Class Reference

Data object function argument. More...

#include <DataSet.h>

Inheritance diagram for DataObjectArgument:
Argument

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)
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Protected Attributes

DataSeto_data
 
- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 

Detailed Description

Data object function argument.

Member Function Documentation

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.

virtual string DataObjectArgument::subprintlong ( ) const
protectedvirtual

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 bool DataObjectArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

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.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/structEvaluationOptions.html0000644000175000017500000004030512757636735022663 00000000000000 libqalculate-0.9.8: EvaluationOptions Struct Reference
EvaluationOptions Struct Reference

Options for calculation. More...

#include <includes.h>

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.
 
int 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 Default: STRUCTURING_NONE.
 
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:
libqalculate-0.9.10/docs/reference/html/tabs.css0000644000175000017500000000221312757636734016503 00000000000000.tabs, .tabs2, .tabs3 { background-image: url('tab_b.png'); width: 100%; z-index: 101; font-size: 13px; font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; } .tabs2 { font-size: 10px; } .tabs3 { font-size: 9px; } .tablist { margin: 0; padding: 0; display: table; } .tablist li { float: left; display: table-cell; background-image: url('tab_b.png'); line-height: 36px; list-style: none; } .tablist a { display: block; padding: 0 20px; font-weight: bold; background-image:url('tab_s.png'); background-repeat:no-repeat; background-position:right; color: #283A5D; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); text-decoration: none; outline: none; } .tabs3 .tablist a { padding: 0 10px; } .tablist a:hover { background-image: url('tab_h.png'); background-repeat:repeat-x; color: #fff; text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); text-decoration: none; } .tablist li.current a { background-image: url('tab_a.png'); background-repeat:repeat-x; color: #fff; text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); } libqalculate-0.9.10/docs/reference/html/includes_8h.html0000644000175000017500000030450712757636735020147 00000000000000 libqalculate-0.9.8: libqalculate/includes.h File Reference
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>
#include <stdint.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...
 

Macros

#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_DEGREE   "°"
 
#define SIGN_POWER_0   "⁰"
 
#define SIGN_POWER_1   "¹"
 
#define SIGN_POWER_2   "²"
 
#define SIGN_POWER_3   "³"
 
#define SIGN_POWER_4   "³"
 
#define SIGN_POWER_5   "⁴"
 
#define SIGN_POWER_6   "⁶"
 
#define SIGN_POWER_7   "⁷"
 
#define SIGN_POWER_8   "⁸"
 
#define SIGN_POWER_9   "⁹"
 
#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 }
 
enum  ParsingMode { PARSING_MODE_ADAPTIVE, PARSING_MODE_IMPLICIT_MULTIPLICATION_FIRST, PARSING_MODE_CONVENTIONAL }
 

Variables

static string empty_string
 
static const int PRIMES []
 
static const int SQUARE_PRIMES []
 
static const struct SortOptions default_sort_options
 
static const struct PrintOptions default_print_options
 
static const struct InternalPrintStruct top_ips
 
static const struct ParseOptions default_parse_options
 
static const 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
 

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
PARSING_MODE_ADAPTIVE 

The default adaptive mode works as the "parse implicit multiplication first" mode, unless spaces are found (<quote>1/5x = 1/(5*x)</quote>, but <quote>1/5 x = (1/5)*x</quote>). In the adaptive mode unit expressions are parsed separately (<quote>5 m/5 m/s = (5*m)/(5*(m/s)) = 1 s</quote>).

PARSING_MODE_IMPLICIT_MULTIPLICATION_FIRST 

In the "parse implicit multiplication first" mode, implicit multiplication is parsed before explicit multiplication (<quote>12/2(1+2) = 12/(2*3) = 2</quote>, <quote>5x/5y = (5*x)/(5*y) = x/y</quote>).

PARSING_MODE_CONVENTIONAL 

In the conventional mode implicit multiplication does not differ from explicit multiplication (<quote>12/2(1+2) = 12/2*3 = 18</quote>, <quote>5x/5y = 5*x/5*y = xy</quote>).

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
}
libqalculate-0.9.10/docs/reference/html/classUserFunction.png0000644000175000017500000000125412757636735021225 00000000000000PNG  IHDR`/QPLTEutRNST2;IDATxr0 ןgxGnbo*996-BVc\ QI2OG.p{ LIg )K4o(ߩJ̺닦@Rs¿_ Idr JV maZr/"ظ&.0q L\`1Ƹ$dr t߄0I9YH kr&H>t߬9 o:))1QGU?֧ L\`r &#'X 1IENDB`libqalculate-0.9.10/docs/reference/html/classArgumentSet.html0000644000175000017500000007253512757636735021231 00000000000000 libqalculate-0.9.8: ArgumentSet Class Reference

A set of accepted arguments. More...

#include <Function.h>

Inheritance diagram for ArgumentSet:
Argument

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
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Protected Attributes

vector< Argument * > subargs
 
- Protected Attributes inherited from Argument
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 set of accepted arguments.

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

Member Function Documentation

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.

virtual string ArgumentSet::subprintlong ( ) const
protectedvirtual

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 bool ArgumentSet::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int ArgumentSet::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:
libqalculate-0.9.10/docs/reference/html/index.html0000644000175000017500000001146012757636735017042 00000000000000 libqalculate-0.9.8: Index
libqalculate-0.9.8
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 expression, 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();
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:

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.9
])
AC_SUBST(QALCULATE_CFLAGS)
AC_SUBST(QALCULATE_LIBS)
libqalculate-0.9.10/docs/reference/html/Prefix_8h.html0000644000175000017500000001220412757636735017564 00000000000000 libqalculate-0.9.8: libqalculate/Prefix.h File Reference
Prefix.h File Reference

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.
 
libqalculate-0.9.10/docs/reference/html/functions_func_p.html0000644000175000017500000001763312757636735021305 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- p -

libqalculate-0.9.10/docs/reference/html/structPrintOptions-members.html0000644000175000017500000003343212757636735023303 00000000000000 libqalculate-0.9.8: 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)PrintOptionsinline
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_all_unitsPrintOptions
use_prefixes_for_currenciesPrintOptions
use_reference_namesPrintOptions
use_unicode_signsPrintOptions
use_unit_prefixesPrintOptions
libqalculate-0.9.10/docs/reference/html/structParseOptions-members.html0000644000175000017500000001521712757636735023262 00000000000000 libqalculate-0.9.8: Member List
ParseOptions Member List
libqalculate-0.9.10/docs/reference/html/functions_f.html0000644000175000017500000001226612757636735020255 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- f -

libqalculate-0.9.10/docs/reference/html/functions_func_g.html0000644000175000017500000001765712757636735021302 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- g -

libqalculate-0.9.10/docs/reference/html/functions_m.html0000644000175000017500000001242512757636735020261 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- m -

libqalculate-0.9.10/docs/reference/html/functions_u.html0000644000175000017500000001505712757636735020275 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- u -

libqalculate-0.9.10/docs/reference/html/classCalculator-members.html0000644000175000017500000041157112757636735022511 00000000000000 libqalculate-0.9.8: Member List
Calculator Member List

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

abort()Calculator
abort_this()Calculator
abortPrint(void)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)Calculatorprotected
AND_str (defined in Calculator)Calculatorprotected
and_str_len (defined in Calculator)Calculatorprotected
AND_str_len (defined in Calculator)Calculatorprotected
b_argument_errors (defined in Calculator)Calculatorprotected
b_busy (defined in Calculator)Calculator
b_calcvars_was (defined in Calculator)Calculatorprotected
b_exchange_rates_used (defined in Calculator)Calculatorprotected
b_exchange_rates_warning_enabled (defined in Calculator)Calculatorprotected
b_functions_was (defined in Calculator)Calculatorprotected
b_gnuplot_open (defined in Calculator)Calculatorprotected
b_printing_controlled (defined in Calculator)Calculatorprotected
b_rpn_was (defined in Calculator)Calculatorprotected
b_save_called (defined in Calculator)Calculatorprotected
b_units_was (defined in Calculator)Calculatorprotected
b_unknown_was (defined in Calculator)Calculatorprotected
b_variables_was (defined in Calculator)Calculatorprotected
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)Calculatorprotected
calculate_pipe_w (defined in Calculator)Calculatorprotected
calculate_thread (defined in Calculator)Calculatorprotected
calculate_thread_attr (defined in Calculator)Calculatorprotected
calculate_thread_stopped (defined in Calculator)Calculator
calculateRPN(MathStructure *mstruct, int command, size_t index, int msecs, const EvaluationOptions &eo) (defined in Calculator)Calculatorprotected
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)Calculatorprotected
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(unsigned int n_days=7, bool force_check=false, bool send_warning=false)Calculator
checkSaveFunctionCalled() (defined in Calculator)Calculator
clearBuffers()Calculator
clearRPNStack() (defined in Calculator)Calculator
closeGnuplot() (defined in Calculator)Calculator
COMMA_S (defined in Calculator)Calculatorprotected
COMMA_STR (defined in Calculator)Calculatorprotected
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
convertTimeOut(string str, Unit *from_unit, Unit *to_unit, int msecs, 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)Calculatorprotected
decimal_null_prefix (defined in Calculator)Calculator
decimal_prefixes (defined in Calculator)Calculator
default_assumptions (defined in Calculator)Calculatorprotected
default_dot_as_separator (defined in Calculator)Calculator
default_real_signs (defined in Calculator)Calculatorprotected
default_signs (defined in Calculator)Calculatorprotected
defaultAssumptions()Calculator
delDefaultStringAlternative(string replacement, string standard) (defined in Calculator)Calculator
deleted_functions (defined in Calculator)Calculatorprotected
deleted_units (defined in Calculator)Calculatorprotected
deleted_variables (defined in Calculator)Calculatorprotected
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)Calculatorprotected
DOT_S (defined in Calculator)Calculatorprotected
DOT_STR (defined in Calculator)Calculatorprotected
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_check_time (defined in Calculator)Calculatorprotected
exchange_rates_time (defined in Calculator)Calculatorprotected
exchangeRatesUsed() const Calculator
exchangeRatesWarningEnabled() const (defined in Calculator)Calculator
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
findMatchingUnit(const MathStructure &mstruct)Calculator
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
getExchangeRatesTime()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)Calculatorprotected
gnuplot_pipe (defined in Calculator)Calculatorprotected
gnuplotOpen() (defined in Calculator)Calculator
has_gvfs (defined in Calculator)Calculatorprotected
hasFunction(MathFunction *f)Calculator
hasGnomeVFS()Calculator
hasGVFS()Calculator
hasToExpression(const string &str) const (defined in Calculator)Calculator
hasUnit(Unit *u)Calculator
hasVariable(Variable *v)Calculator
i_precision (defined in Calculator)Calculatorprotected
i_print_timeout (defined in Calculator)Calculatorprotected
i_printing_aborted (defined in Calculator)Calculatorprotected
ianglemode (defined in Calculator)Calculatorprotected
ILLEGAL_IN_NAMES (defined in Calculator)Calculatorprotected
ILLEGAL_IN_NAMES_MINUS_SPACE_STR (defined in Calculator)Calculatorprotected
ILLEGAL_IN_UNITNAMES (defined in Calculator)Calculatorprotected
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)Calculatorprotected
localizeExpression(string str) const Calculator
localToString() const Calculator
message(MessageType mtype, const char *TEMPLATE,...)Calculator
message()Calculator
messages (defined in Calculator)Calculatorprotected
minus_str (defined in Calculator)Calculatorprotected
minus_str_len (defined in Calculator)Calculatorprotected
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)Calculatorprotected
NAME_NUMBER_PRE_STR (defined in Calculator)Calculatorprotected
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)Calculatorprotected
OR_str (defined in Calculator)Calculatorprotected
or_str_len (defined in Calculator)Calculatorprotected
OR_str_len (defined in Calculator)Calculatorprotected
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)Calculatorprotected
per_str_len (defined in Calculator)Calculatorprotected
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)Calculatorprotected
plus_str_len (defined in Calculator)Calculatorprotected
prefixes (defined in Calculator)Calculator
prefixNameChanged(Prefix *p, bool new_item=false)Calculator
printingAborted(void) (defined in Calculator)Calculator
printingAbortedMessage(void) const (defined in Calculator)Calculator
printingControlled(void) (defined in Calculator)Calculator
printMathStructureTimeOut(const MathStructure &mstruct, int msecs=100000, const PrintOptions &op=default_print_options)Calculator
priv (defined in Calculator)Calculatorprotected
real_signs (defined in Calculator)Calculatorprotected
reset()Calculator
resetExchangeRatesUsed() (defined in Calculator)Calculator
resetFunctions()Calculator
resetUnits()Calculator
resetVariables()Calculator
restoreState()Calculator
rpn_stack (defined in Calculator)Calculatorprotected
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)Calculatorprotected
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, bool keep_modifiers=false) const Calculator
setDefaultAssumptions(Assumptions *ass)Calculator
setExchangeRatesUsed()Calculator
setExchangeRatesWarningEnabled(bool enable)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)Calculatorprotected
startPrintControl(int milli_timeout=0)Calculator
stillHasFunction(MathFunction *f)Calculator
stillHasUnit(Unit *u)Calculator
stillHasVariable(Variable *v)Calculator
stopped_errors_count (defined in Calculator)Calculatorprotected
stopped_messages_count (defined in Calculator)Calculatorprotected
stopped_warnings_count (defined in Calculator)Calculatorprotected
stopPrintControl(void)Calculator
t_print_end (defined in Calculator)Calculatorprotected
temporaryCategory(void) const (defined in Calculator)Calculator
terminateThreads()Calculator
testCondition(string expression) (defined in Calculator)Calculator
timedOutString(void) const (defined in Calculator)Calculator
times_str (defined in Calculator)Calculatorprotected
times_str_len (defined in Calculator)Calculatorprotected
tmp_evaluationoptions (defined in Calculator)Calculator
tmp_maketodivision (defined in Calculator)Calculator
tmp_parsedstruct (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_celsius (defined in Calculator)Calculator
u_deg (defined in Calculator)Calculator
u_euro (defined in Calculator)Calculator
u_fahrenheit (defined in Calculator)Calculator
u_gra (defined in Calculator)Calculator
u_kelvin (defined in Calculator)Calculator
u_rad (defined in Calculator)Calculator
ufv (defined in Calculator)Calculatorprotected
ufv_i (defined in Calculator)Calculatorprotected
ufvl (defined in Calculator)Calculatorprotected
ufvl_i (defined in Calculator)Calculatorprotected
ufvl_t (defined in Calculator)Calculatorprotected
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(bool comma_as_separator=false)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)Calculatorprotected
XOR_str (defined in Calculator)Calculatorprotected
XOR_str_len (defined in Calculator)Calculatorprotected
~Calculator() (defined in Calculator)Calculatorvirtual
libqalculate-0.9.10/docs/reference/html/tab_s.png0000644000175000017500000000027012757636734016637 00000000000000PNG  IHDR$[IDATx݁ @@ѣ?Q"%If6[HQ<]dr s?O=w'F -~rÍ[芭m֬ݯнF)Y% `n,9B!ь\<#IENDB`libqalculate-0.9.10/docs/reference/html/functions_func_r.html0000644000175000017500000001325612757636735021304 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- r -

libqalculate-0.9.10/docs/reference/html/classAliasUnit__Composite.html0000644000175000017500000020527112757636735023040 00000000000000 libqalculate-0.9.8: 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

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
 
- Public Member Functions inherited from AliasUnit
 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 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 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
 
- Public Member Functions inherited from Unit
 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)
 
bool isSIUnit () const
 
void setAsSIUnit ()
 
void setSystem (string s_system)
 
const string & system () const
 
bool useWithPrefixesByDefault () const
 
void setUseWithPrefixesByDefault (bool use_with_prefixes)
 
bool isCurrency () 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 int type () 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
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
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)
 

Protected Attributes

Prefixprefixv
 
- Protected Attributes inherited from AliasUnit
string svalue
 
string sinverse
 
int i_exp
 
Unito_unit
 
- Protected Attributes inherited from Unit
string ssystem
 
bool b_si
 
bool b_use_with_prefixes
 
- Protected Attributes inherited from ExpressionItem
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

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:
libqalculate-0.9.10/docs/reference/html/globals_enum.html0000644000175000017500000001131312757636735020377 00000000000000 libqalculate-0.9.8: File Members
 
libqalculate-0.9.10/docs/reference/html/classArgument.html0000644000175000017500000014243412757636735020551 00000000000000 libqalculate-0.9.8: 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:
AngleArgument ArgumentSet BooleanArgument DataObjectArgument DataPropertyArgument DateArgument ExpressionItemArgument FileArgument FunctionArgument IntegerArgument MatrixArgument NumberArgument SymbolicArgument TextArgument UnitArgument VariableArgument VectorArgument

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
nameName/title of the argument definition.
does_testIf argument values will be tested.
does_errorIf an error will issued if the value tests false.
Argument::Argument ( const Argument arg)

Creates a copy of an argument definition.

Parameters
argArgument to copy.
virtual Argument::~Argument ( )
virtual

Destructor

Member Function Documentation

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.
string Argument::getCustomCondition ( ) const

Returns the custom condition expression set for argument values.

Returns
Custom condition for argument values.
string Argument::name ( ) const

Returns the name/title of the argument definition.

Returns
Name/title.
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
strExpression.
poParse 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
mstructMathematical structure to set with the parsed expression.
strExpression.
poParse options.

Reimplemented in AngleArgument.

virtual string Argument::print ( ) const
virtual
string Argument::printlong ( ) const

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

Returns
Long description.
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 void Argument::set ( const Argument arg)
virtual

Sets the argument to a copy of an argument definition.

Parameters
argArgument to copy.

Reimplemented in IntegerArgument, and NumberArgument.

void Argument::setCustomCondition ( string  condition)

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

Parameters
conditionCondition expression.
void Argument::setName ( string  name_)

Sets the name/title of the argument definition.

Parameters
name_New name/title.
void Argument::setZeroForbidden ( bool  forbid_zero)

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

Parameters
forbid_zeroIf zero shall be forbidden.
virtual string Argument::subprintlong ( ) const
protectedvirtual

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 ArgumentSet, FileArgument, VariableArgument, AngleArgument, UnitArgument, BooleanArgument, FunctionArgument, ExpressionItemArgument, MatrixArgument, VectorArgument, DateArgument, TextArgument, SymbolicArgument, IntegerArgument, NumberArgument, DataObjectArgument, and DataPropertyArgument.

virtual bool Argument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

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

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
valueValue to test.
fMathematical function that the value is an argument for.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.
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.
virtual int Argument::type ( ) const
virtual
bool Argument::zeroForbidden ( ) const

If an argument value of zero is forbidden.

Returns
true if zero argument value is forbidden.

The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/structExpressionName.html0000644000175000017500000002701712757636735022145 00000000000000 libqalculate-0.9.8: ExpressionName Struct Reference
ExpressionName Struct Reference

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

#include <ExpressionItem.h>

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
snameThe name.

The documentation for this struct was generated from the following file:
libqalculate-0.9.10/docs/reference/html/functions_func_v.html0000644000175000017500000001104412757636735021301 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- v -

libqalculate-0.9.10/docs/reference/html/classExpressionItemArgument-members.html0000644000175000017500000003214012757636735025070 00000000000000 libqalculate-0.9.8: 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const ExpressionItemArgumentvirtual
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 Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const ExpressionItemArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const ExpressionItemArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const ExpressionItemArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const ExpressionItemArgumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~ExpressionItemArgument() (defined in ExpressionItemArgument)ExpressionItemArgumentvirtual
libqalculate-0.9.10/docs/reference/html/classNumberPrefix.png0000644000175000017500000000066212757636735021211 00000000000000PNG  IHDRYPE)UPLTEutRNST2AIDATx흁 EO/ (#;ewS X䴶|)"$9(?lGRgⓤ^"'I5KiaSRiremu.IҍfryJr~ϐ% r%i$WrJ)y`Z v#`'Wލ Ղddd>E43r/C%y<_#՜_UtK=v9R61ə-ڿtSl'xu/K?Cmr r\ZSj:ȵ6m1ht7NqOxTA2Hd33}5JIENDB`libqalculate-0.9.10/docs/reference/html/classExpressionItem.html0000644000175000017500000020756212757636735021751 00000000000000 libqalculate-0.9.8: ExpressionItem Class Reference
ExpressionItem Class Referenceabstract

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

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 string& ExpressionItem::category ( ) const
virtual

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

Returns
Category.
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 const string& ExpressionItem::description ( ) const
virtual

Returns the expression items description.

Returns
Description.
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
abbreviationIf the name must be abbreviated. 1=true, 0=false, -1=ignore.
use_unicodeIf the name must have unicode characters. 1=true, 0=false, -1=ignore.
pluralIf the name must be in plural form. 1=true, 0=false, -1=ignore.
can_display_unicode_string_functionFunction 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_argArgument 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& 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
indexIndex of name.
Returns
Name for index or empty_expression_name if not found.
virtual bool ExpressionItem::hasChanged ( ) const
virtual

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

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
snameA text string to look for (not case sensitive)
case_sensitiveIf 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
snameA 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 bool ExpressionItem::isActive ( ) const
virtual

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

Returns
true if active.
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 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
abbreviationIf an abbreviated name is preferred.
use_unicodeIf a name with unicode characters can be displayed/is preferred (prioritized if false).
pluralIf a name in plural form is preferred.
referenceIf a reference name is preferred (ignored if false).
can_display_unicode_string_functionFunction 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_argArgument 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
abbreviationIf an abbreviated name is preferred.
use_unicodeIf a name with unicode characters can be displayed/is preferred (prioritized if false).
pluralIf a name in plural form is preferred.
referenceIf a reference name is preferred (ignored if false).
can_display_unicode_string_functionFunction 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_argArgument to pass to the above test function.
Returns
The preferred name.
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
abbreviationIf an abbreviated name is preferred.
use_unicodeIf a name with unicode characters can be displayed/is preferred (prioritized if false).
pluralIf a name in plural form is preferred.
referenceIf a reference name is preferred (ignored if false).
can_display_unicode_string_functionFunction 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_argArgument to pass to the above test function.
Returns
The preferred name.
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 void ExpressionItem::setCategory ( string  cat_)
virtual

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

Parameters
cat_Category.
virtual void ExpressionItem::setDescription ( string  descr_)
virtual

Sets the expression items description.

Parameters
descr_Description.
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
enameThe new name.
indexIndex of name to change.
forceIf 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
snameThe new name text string.
indexIndex of name to change.
forceIf true, expression items with conflicting names are replaced, otherwise . Only applies if the item is registered.
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 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 CompositeUnit, KnownVariable, UserFunction, DataSet, AliasUnit, UnknownVariable, Variable, Unit, and MathFunction.

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_titleIf 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_unicodeIf a name with unicode characters can be displayed/is preferred (passed to preferredName()).
can_display_unicode_string_functionFunction 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_argArgument to pass to the above test function (passed to preferredName()).
Returns
Item title.
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 Variable, Unit, and MathFunction.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/Unit_8h.html0000644000175000017500000001570012757636735017252 00000000000000 libqalculate-0.9.8: libqalculate/Unit.h File Reference
Unit.h File Reference

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...
 

Enumeration Type Documentation

Type of unit.

Enumerator
SUBTYPE_BASE_UNIT 

class Unit

SUBTYPE_ALIAS_UNIT 

class AliasUnit

SUBTYPE_COMPOSITE_UNIT 

class CompositeUnit

libqalculate-0.9.10/docs/reference/html/functions_x.html0000644000175000017500000001170012757636735020267 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- x -

libqalculate-0.9.10/docs/reference/html/functions_y.html0000644000175000017500000001170012757636735020270 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- y -

libqalculate-0.9.10/docs/reference/html/structInternalPrintStruct.html0000644000175000017500000001622512757636735023202 00000000000000 libqalculate-0.9.8: InternalPrintStruct Struct Reference
InternalPrintStruct Struct Reference

Public Attributes

int depth
 
int power_depth
 
int division_depth
 
bool wrap
 
string * num
 
string * den
 
string * re
 
string * im
 
string * exp
 
bool * minus
 
bool * exp_minus
 
bool parent_approximate
 
int parent_precision
 

The documentation for this struct was generated from the following file:
libqalculate-0.9.10/docs/reference/html/Calculator_8h.html0000644000175000017500000001702112757636735020422 00000000000000 libqalculate-0.9.8: libqalculate/Calculator.h File Reference
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...
 

Macros

#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
}
 
libqalculate-0.9.10/docs/reference/html/classMathFunction.html0000644000175000017500000022176512757636735021373 00000000000000 libqalculate-0.9.8: MathFunction Class Reference

Abstract base class for mathematical functions. More...

#include <Function.h>

Inheritance diagram for MathFunction:
ExpressionItem DataSet UserFunction

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
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
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)
 

Protected Member Functions

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

Protected Attributes

MathFunction_p * priv
 
int argc
 
int max_argc
 
vector< string > default_values
 
size_t last_argdef_index
 
string scondition
 
- Protected Attributes inherited from ExpressionItem
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 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

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::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
strThe argument string to parse.
vargsVector to store parsed arguments in.
poParse options.
Returns
The number of parsed arguments.
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]mstructStructure that is set with the result of the calculation.
vargsArguments passed to the mathematical function.
eoEvaluation options.
Returns
1 if the calculation was successful.

Reimplemented in UserFunction, and DataSet.

void MathFunction::clearArgumentDefinitions ( )

Removes all argument definitions for the function.

string MathFunction::condition ( ) const

Returns the functions condition expression.

Returns
The function's condition expression
Argument* MathFunction::getArgumentDefinition ( size_t  index)

Returns the argument definition for an argument index.

Parameters
indexArgument index.
Returns
The argument definition for the index or NULL if no the argument was not defined for the index
size_t MathFunction::lastArgumentDefinitionIndex ( ) const

Returns the index of the last argument definition.

Returns
The index of the last argument definition
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::minargs ( ) const

Returns the minimum number of arguments for the function.

string MathFunction::printCondition ( )

Print the function's condition expression with argument names.

Returns
The printed condition
void MathFunction::setArgumentDefinition ( size_t  index,
Argument argdef 
)

Set the argument definition for an argument index.

Parameters
indexArgument index.
argdefA newly allocated argument definition
void MathFunction::setCondition ( string  expression)

Sets the functions condition expression.

Parameters
expressionThe function's new condition expression
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 UserFunction, and DataSet.

bool MathFunction::testCondition ( const MathStructure vargs)

Test if arguments fulfil the function's condition expression.

Parameters
vargsVector with arguments.
Returns
true if the arguments fulfil the function's condition expression
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.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/dir_e1cc17c9b46d352fb89a08ddc5bd498d.html0000644000175000017500000001242112757636735023401 00000000000000 libqalculate-0.9.8: libqalculate Directory Reference
libqalculate Directory Reference

Files

file  Calculator.h
 
file  DataSet.h
 
file  ExpressionItem.h
 
file  Function.h
 
file  includes.h
 
file  MathStructure.h
 
file  Number.h
 
file  Prefix.h
 
file  Unit.h
 
file  util.h
 
file  Variable.h
 
libqalculate-0.9.10/docs/reference/html/classBinaryPrefix.html0000644000175000017500000005151512757636735021370 00000000000000 libqalculate-0.9.8: BinaryPrefix Class Reference

A binary prefix. More...

#include <Prefix.h>

Inheritance diagram for BinaryPrefix:
Prefix

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
 
- Public Member Functions inherited from Prefix
 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
 

Protected Attributes

int exp
 
- Protected Attributes inherited from Prefix
string l_name
 
string s_name
 
string u_name
 

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
exp2Exponent for the value.
long_nameLong name.
short_nameShort name.
unicode_nameUnicode name.

Member Function Documentation

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

Returns the exponent.

Parameters
iexpExponent of the unit.
Returns
The exponent of the prefix.
Number BinaryPrefix::exponent ( const Number nexp) const

Returns the exponent.

Parameters
nexpExponent of the unit.
Returns
The exponent of the prefix.
void BinaryPrefix::setExponent ( int  iexp)

Sets the exponent of the prefix.

Parameters
iexpNew exponent for the 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.

Number BinaryPrefix::value ( const Number nexp) const
virtual

Returns the value of the prefix.

Parameters
nexpThe 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
iexpThe 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.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/classTextArgument.png0000644000175000017500000000073612757636735021234 00000000000000PNG  IHDRYPE)UPLTEutRNST2mIDATx펄 EO/;B6f ީb9sMN&hl4F|latC ג k#C#;=OkI*쁜]fNRim{"1Qǜ맒J"A5jrXng#-*wp#%i@9^Izs3Э `mzGgcl--"ȋ ffSL".'->P/r> {H}8a8I) K ;Vʳ>DŨZy!恜˭6ʹ~z[|(.(FϩV5llt7~rx`Η@[+ }5&IENDB`libqalculate-0.9.10/docs/reference/html/classAliasUnit.png0000644000175000017500000000154312757636735020473 00000000000000PNG  IHDR~='PLTEutRNST2IDATxђ C7 hܸs2--$䜳$$OiH vqsstw&jLLzf,$iϫ՗ӳfKhc!I;^}]^OyznFw/6{K}6fR%գ$m&dnWkU~W|O/9 H$$~}9ë߫؝~+?.B`"&B`"&B`"&BpsA$$SҭI:{ێ$>)csW_J~Yz?I?V^YB/I&B/I&spW? VW;fW~\DLDLDL*)"&D>)S>x7svNMD|kOwWxU}]V~J?G/۲&fM?\mu'j+DL)d~~aw====UrC9_,I.B/I&#}Z~~DGN{vO[͑M'Џ\n&)%xWW)UߏeƤ킕=iGn=P?PM~iޣ_Trdo^az)5Ǯ7{D~9N4۽?O%靜+竿KҗK >mgpL IENDB`libqalculate-0.9.10/docs/reference/html/classCalculatorMessage.html0000644000175000017500000001407612757636735022365 00000000000000 libqalculate-0.9.8: CalculatorMessage Class Reference
CalculatorMessage Class Reference

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

#include <Calculator.h>

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:
libqalculate-0.9.10/docs/reference/html/classTextArgument.html0000644000175000017500000006677712757636735021435 00000000000000 libqalculate-0.9.8: TextArgument Class Reference

A text argument. More...

#include <Function.h>

Inheritance diagram for TextArgument:
Argument

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
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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)
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Argument
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 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 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.

virtual string TextArgument::subprintlong ( ) const
protectedvirtual

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 bool TextArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int TextArgument::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:
libqalculate-0.9.10/docs/reference/html/classVariableArgument.png0000644000175000017500000000102612757636735022026 00000000000000PNG  IHDRrPgrPLTEutRNST2IDATx SJEZZ-xʲSVcKHR:ONNЈ?tg)CKԿ_^.=/Iuʘ>آ4)ÌMHR3Ln6R.1)ܥ +#qV%W*F6x7$wRv+Iorv\_I(~(qx69^y7v~A#;=JL%@S ЁTt`*qιF2ri Y6)ǞІ͉3Zk@OKCm1$r8 ek4*Ҕ WwY4fpX&ʌ|Pis*ueZ2[n]٢vGz`%b2K53zX8"sq.(sn({dIENDB`libqalculate-0.9.10/docs/reference/html/classAssumptions-members.html0000644000175000017500000002442212757636735022740 00000000000000 libqalculate-0.9.8: 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)Assumptionsprotected
b_incl_min (defined in Assumptions)Assumptionsprotected
fmax (defined in Assumptions)Assumptionsprotected
fmin (defined in Assumptions)Assumptionsprotected
i_sign (defined in Assumptions)Assumptionsprotected
i_type (defined in Assumptions)Assumptionsprotected
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
libqalculate-0.9.10/docs/reference/html/classVariableArgument.html0000644000175000017500000006604712757636735022224 00000000000000 libqalculate-0.9.8: VariableArgument Class Reference
Inheritance diagram for VariableArgument:
Argument

Public Member Functions

 VariableArgument (string name_="", bool does_test=true, bool does_error=true)
 
 VariableArgument (const VariableArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 

Member Function Documentation

virtual Argument* VariableArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

virtual string VariableArgument::print ( ) const
virtual

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

Returns
Short description.

Reimplemented from Argument.

virtual string VariableArgument::subprintlong ( ) const
protectedvirtual

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 bool VariableArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int VariableArgument::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:
libqalculate-0.9.10/docs/reference/html/classDynamicVariable-members.html0000644000175000017500000011047012757636735023444 00000000000000 libqalculate-0.9.8: 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)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_expression (defined in KnownVariable)KnownVariableprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculate() const =0 (defined in DynamicVariable)DynamicVariableprotectedpure virtual
calculated_precision (defined in KnownVariable)KnownVariableprotected
calculatedPrecision() const DynamicVariable
category() const ExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const =0 (defined in DynamicVariable)DynamicVariablepure virtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() const ExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
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 KnownVariablevirtual
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 ExpressionItemvirtual
get()DynamicVariablevirtual
getName(size_t index) const ExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() const ExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) const ExpressionItemvirtual
hasNameCaseSensitive(const string &sname) const ExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() const ExpressionItemvirtual
isApproximate() const ExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isExpression() const KnownVariablevirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() const KnownVariableinlinevirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
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)KnownVariableprotected
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)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
precision() const ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() const ExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsComplex(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsEven(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsInteger(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNegative(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonMatrix() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonNegative(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonPositive(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonZero(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNumber(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsOdd(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsPositive(bool=false)DynamicVariableinlinevirtual
representsRational(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsReal(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in DynamicVariable)DynamicVariablevirtual
set(const MathStructure &o)DynamicVariablevirtual
set(string expression_)DynamicVariablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
sexpression (defined in KnownVariable)KnownVariableprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() const KnownVariableinlinevirtual
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 ExpressionItemvirtual
type() const Variableinlinevirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
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)DynamicVariablevirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~KnownVariable() (defined in KnownVariable)KnownVariablevirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-0.9.10/docs/reference/html/structInternalPrintStruct-members.html0000644000175000017500000001431212757636735024625 00000000000000 libqalculate-0.9.8: Member List
InternalPrintStruct Member List

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

den (defined in InternalPrintStruct)InternalPrintStruct
depth (defined in InternalPrintStruct)InternalPrintStruct
division_depth (defined in InternalPrintStruct)InternalPrintStruct
exp (defined in InternalPrintStruct)InternalPrintStruct
exp_minus (defined in InternalPrintStruct)InternalPrintStruct
im (defined in InternalPrintStruct)InternalPrintStruct
InternalPrintStruct() (defined in InternalPrintStruct)InternalPrintStructinline
minus (defined in InternalPrintStruct)InternalPrintStruct
num (defined in InternalPrintStruct)InternalPrintStruct
parent_approximate (defined in InternalPrintStruct)InternalPrintStruct
parent_precision (defined in InternalPrintStruct)InternalPrintStruct
power_depth (defined in InternalPrintStruct)InternalPrintStruct
re (defined in InternalPrintStruct)InternalPrintStruct
wrap (defined in InternalPrintStruct)InternalPrintStruct
libqalculate-0.9.10/docs/reference/html/classNumberPrefix-members.html0000644000175000017500000001736112757636735023025 00000000000000 libqalculate-0.9.8: Member List
NumberPrefix Member List

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

l_name (defined in Prefix)Prefixprotected
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)NumberPrefixprotected
Prefix(string long_name, string short_name="", string unicode_name="")Prefix
s_name (defined in Prefix)Prefixprotected
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 NumberPrefixvirtual
u_name (defined in Prefix)Prefixprotected
unicodeName(bool return_short_if_no_uni=true) const Prefix
value(const Number &nexp) const NumberPrefixvirtual
value(int iexp) const NumberPrefixvirtual
value() const NumberPrefixvirtual
~NumberPrefix() (defined in NumberPrefix)NumberPrefix
~Prefix() (defined in Prefix)Prefixvirtual
libqalculate-0.9.10/docs/reference/html/classUnknownVariable.png0000644000175000017500000000131112757636735021700 00000000000000PNG  IHDRoZEhPLTEutRNST2XIDATx풴* *_#ǦS{C@&'BiO/?Iz!nmx2vI|+ ka{jYIn5 fI E):]M:7BZF;ac((et&+;zC~LS~dFI$ɗI_<>ad߲Nپ?p$|~>?G9<$M#|ϗ̵k4O]$]o0TeltcrߪGKxgw󵛗o;r^}n{}[$;Rʼ)zsZ6֪~J$?'I~|s`"}2W8ٷ g|~>?G#|DH_~e58x,O{ֈJknzVK_3ݼ7y0`Mr- fޏrݧ92Y;[]i+*H\q>ΤKs>oU?'G/4.sIENDB`libqalculate-0.9.10/docs/reference/html/classDataSet-members.html0000644000175000017500000014320312757636735021737 00000000000000 libqalculate-0.9.8: 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)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
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)MathFunctionprotected
args() const MathFunction
args(const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)MathFunction
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_loaded (defined in DataSet)DataSetprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)DataSetvirtual
calculate(const string &eq, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunctionvirtual
calculate(MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunctionvirtual
category() const ExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearArgumentDefinitions()MathFunction
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
condition() const MathFunction
copy() const (defined in DataSet)DataSetvirtual
copyright() const (defined in DataSet)DataSet
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
createFunctionMathStructureFromSVArgs(vector< string > &svargs) (defined in MathFunction)MathFunctionprotectedvirtual
createFunctionMathStructureFromVArgs(const MathStructure &vargs) (defined in MathFunction)MathFunctionprotectedvirtual
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)MathFunctionprotected
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 ExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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)ExpressionItemvirtual
hasChanged() const ExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) const ExpressionItemvirtual
hasNameCaseSensitive(const string &sname) const ExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() const ExpressionItemvirtual
isApproximate() const ExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
last_argdef_index (defined in MathFunction)MathFunctionprotected
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)MathFunctionprotected
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)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
objects (defined in DataSet)DataSetprotected
objectsLoaded() const (defined in DataSet)DataSet
parse(const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunctionvirtual
parse(MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunctionvirtual
precision() const ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
printCondition()MathFunction
printProperties(string object) (defined in DataSet)DataSet
printProperties(DataObject *o) (defined in DataSet)DataSet
priv (defined in MathFunction)MathFunctionprotected
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)DataSetprotected
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() const ExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsComplex(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsEven(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsInteger(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonMatrix(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsNonNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonZero(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNumber(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsOdd(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsRational(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsReal(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsUndefined(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
saveObjects(const char *file_name=NULL, bool save_global=false) (defined in DataSet)DataSet
scat (defined in ExpressionItem)ExpressionItemprotected
scondition (defined in MathFunction)MathFunctionprotected
scopyright (defined in DataSet)DataSetprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in DataSet)DataSetvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setArgumentDefinition(size_t index, Argument *argdef)MathFunction
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
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_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setObjectsLoaded(bool objects_loaded) (defined in DataSet)DataSet
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
sfile (defined in DataSet)DataSetprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
stringArgs(const string &str, vector< string > &svargs) (defined in MathFunction)MathFunction
subtype() const DataSetvirtual
testArgumentCount(int itmp) (defined in MathFunction)MathFunction
testArguments(MathStructure &vargs) (defined in MathFunction)MathFunctionprotected
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 ExpressionItemvirtual
type() const MathFunctionvirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~MathFunction() (defined in MathFunction)MathFunctionvirtual
libqalculate-0.9.10/docs/reference/html/functions_i.html0000644000175000017500000001651112757636735020255 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- i -

libqalculate-0.9.10/docs/reference/html/doxygen.png0000644000175000017500000000730312757636734017230 00000000000000PNG  IHDRh ;IDATx]y\պ~45%TL QPE"q11]8aw*(*" z`8 m,p$%B(8k6lk[߷;?kPx'tz3_Q4g@m ci{~4:Hc'PP7^h zbcP 3}OqNkT(?d ~z<4ǡ؞vz٦Zd,6k]Fz< Zs?sU2Sw1c`[}%ѽ.Լ6BLZ!F8[ T #g]:vu?vbR?wgb$kF~;عƕX?lNʪ,HCgAzlӺg ]jM3oҳ'=$f}GS_co.ȹ:ds:1={9?zqviDp moaEqҵw}~{j{ºFNë[OqOSXO]>muľe5{Jկ(bl}`UyacCAklysA7oJ .Be. Z'-PyF.lp&.j7rez19HG%qz׈c_k_")HJn~֘5 q5#+9T Rܸrzϴ̝ =υ{áOfwg|/$;֙ƭ]W"/< DఽB}yIEc^=[VhM$l];Kr¦* t$]M;I1!M (f<5~z mՠ>کIz;u[ie^ӳNF6B\}7+,'a -yHY,^f~?Hc{Z+4\sٷnߣFơsغD?<vkx0MlذIxdEEAMg*YE7ۙ^[uv[wG=Edn׶l'pGk+C82 dz3H BS[wŘ ~xptmţiQ歉AB1fى4uI]6% 1t.NJphz̠R1"3-"&1[:N mW0_œ 6&)ꦬ}~{m]zMP~^:eQT_*798ˍ 347E¿uSɻU_ NWeNӏ|;;d"ȉ޵ᆴ"ĴMM+bY_E]PXKНIޥoE<_(EP|m,өZߺk,kM`jzeU t36˷r}w:Χ |TܵQK_pໃYd0!a –W$$/\$ 2mLH dHV,:RZJaz*>_NT(‚^SVFU8E܈nd;8\C]=m:bDd=ߞUU5O|]Pv\]2"y[yzg{Y{Ù5;w{N3nĨwKݭ29Id y)P8ũ@mPwjl,6 hWd ump.DžtwR xBδYcxg*vo y򑕓[?V0NO난~󒯷h#Hk8kӍ^q@]ӓ,56-κUn[>]@nϜp[6# 4tn:}8T9_Y$/GK(ђM`dѺ;OB &P{qhJ+閧l2M_1ӫtlya L^y.۽[ u/]iS}N>e1qjf&iT\=kϛX-.84V5u!TE .OH4zwTr. xքHHg hT$yqzp< qrwI]I鲘s":ՖbզL69VW<;3?M3AV#ޯKUr9!qtH+6V/TS^pqgLP'5E ޺ n"2|;W"֬TwtO' +W+Z̖<&nO,I06.Z.h*INڒOegBXZ9hDSʍ A/c`A"z|ş;H#|%OOD mcƤqmu&~n πZj =_n[nN$_bE)8?6l}#bW( d-p&a"9ņ$ڛA!;{~8ޣ10`#kuN Qbh 8Mawhq(bK Z%m֍(J)@> 7% {y ohf>{p.­_%glZ\B2B #Һphݚ[<#SpA7Ht4:|gtL*($Ʃ$;b`=MM5ǾHH.HeA5}rd)T};Q5i2O00;,냔}g]79_{C>h{.II?[Kswz6u;OJa˶zvd l舊yc'rTWӰL |ʽhB T'ò]K(=Kx  L,Pʵu׈ž1ݫ;pGDxZY kf676oھH~޸ 8Up6(? K+?%ݷ/19U?B)l @=ޞkIENDB`libqalculate-0.9.10/docs/reference/html/functions_v.html0000644000175000017500000001156312757636735020274 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- v -

libqalculate-0.9.10/docs/reference/html/classKnownVariable.png0000644000175000017500000000165312757636735021346 00000000000000PNG  IHDRm9TPLTEutRNST2:IDATxr FU##K %AIM,Q[~C~hж^N/׍\+IjR64ϝP٫H<=NNm2J-EaVYhc}(>iAߜd:CN.sIj}}4$Im18 X1ն,3uSmlnWLpnm X6 c J$&Ic\Mm藤3>Vmmmۛk}ts[tfmUIomf[m'1k~Im8I libqalculate-0.9.8: 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)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
appendDefaultValues(MathStructure &vargs) (defined in MathFunction)MathFunction
argc (defined in MathFunction)MathFunctionprotected
args() const MathFunction
args(const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)MathFunction
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculate(const string &eq, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunctionvirtual
calculate(MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunctionvirtual
calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)MathFunctionvirtual
category() const ExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearArgumentDefinitions()MathFunction
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
condition() const MathFunction
copy() const =0 (defined in MathFunction)MathFunctionpure virtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
createFunctionMathStructureFromSVArgs(vector< string > &svargs) (defined in MathFunction)MathFunctionprotectedvirtual
createFunctionMathStructureFromVArgs(const MathStructure &vargs) (defined in MathFunction)MathFunctionprotectedvirtual
default_values (defined in MathFunction)MathFunctionprotected
description() const ExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
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 ExpressionItemvirtual
getArgumentDefinition(size_t index)MathFunction
getDefaultValue(size_t arg_) const (defined in MathFunction)MathFunction
getName(size_t index) const ExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() const ExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) const ExpressionItemvirtual
hasNameCaseSensitive(const string &sname) const ExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() const ExpressionItemvirtual
isApproximate() const ExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
last_argdef_index (defined in MathFunction)MathFunctionprotected
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)MathFunctionprotected
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)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
parse(const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunctionvirtual
parse(MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunctionvirtual
precision() const ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
printCondition()MathFunction
priv (defined in MathFunction)MathFunctionprotected
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)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() const ExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsComplex(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsEven(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsInteger(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonMatrix(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsNonNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonZero(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNumber(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsOdd(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsRational(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsReal(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsUndefined(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
scondition (defined in MathFunction)MathFunctionprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in MathFunction)MathFunctionvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setArgumentDefinition(size_t index, Argument *argdef)MathFunction
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setCondition(string expression)MathFunction
setDefaultValue(size_t arg_, string value_) (defined in MathFunction)MathFunction
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
stitle (defined in ExpressionItem)ExpressionItemprotected
stringArgs(const string &str, vector< string > &svargs) (defined in MathFunction)MathFunction
subtype() const MathFunctionvirtual
testArgumentCount(int itmp) (defined in MathFunction)MathFunction
testArguments(MathStructure &vargs) (defined in MathFunction)MathFunctionprotected
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 ExpressionItemvirtual
type() const MathFunctionvirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~MathFunction() (defined in MathFunction)MathFunctionvirtual
libqalculate-0.9.10/docs/reference/html/structPrintOptions.html0000644000175000017500000010232212757636735021646 00000000000000 libqalculate-0.9.8: PrintOptions Struct Reference

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

#include <includes.h>

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_all_units
 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
 Use prefixes for all units (even imperial and similar ones). 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:
libqalculate-0.9.10/docs/reference/html/functions_w.html0000644000175000017500000001061212757636735020267 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- w -

libqalculate-0.9.10/docs/reference/html/classExpressionItem.png0000644000175000017500000000614212757636735021560 00000000000000PNG  IHDR&PLTEutRNST2 IDATxve W -]jOS)Bv <7 (Ic lҘ@4&P&۝;ܜoc6&P๹0 #e97_˙Nj <7&?)\48{И@NVŚeaMLRc76&c~.7cr<1w.\ϙW;WO5 xn^qX3옴&PWsrNQVI <7tusc ؤ16NmLsӘ@4&P& (Ic lv?(WCf(P`96hL@-9niL@;4$P& (Ic lҘ@4&P& (Ic lҘ@4&P& eoR0~`P 0Q?0~T?jL &ՏGmA6DQ`~`P 0Q?0~T?jL &ՏGmAŏeYO_e8\,˲|,ˠǒ$?3E#ɠƤm$#ɠƤm$#ɠƤm$#ɠƤm$#ɠ_}udiI*-2*I/8i+K6'k$;1y?јcrX:^>sI#瘬Xo^brgJ%I~gI <#m P0mA F-0~@(umwؾKet oj{ō <1qƽd_ NLnߘ/b#&/ߧw9`Ǔ\4 kuGg/WL7&2y8o{19_qe_.Mv|ŭ <51zc\MmV71K&L1%&/T.\ntxb^#Vay,1S;\_udLݠ'n{19u"y7&l_$+xF^0xeZ?vLJvYqڲ1f;&/zXOqqq&ALsgNW\]lLy"IH{G$1g19eo_8&AJxJ`=?4&|WLM~j$McHj[`PQm P0mA F-˲\,˲ )|IENDB`libqalculate-0.9.10/docs/reference/html/splitbar.png0000644000175000017500000000047212757636735017374 00000000000000PNG  IHDRMIDATxݡJCa( %4 bȘͶ3v^EL ,b;{Ï/aYկq:\IIIIIIIIIIIIIIIIII-l揊_t/ϻYQVYivk_ۣI@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$C[V=[fIENDB`libqalculate-0.9.10/docs/reference/html/classNumberArgument.html0000644000175000017500000010712012757636735021713 00000000000000 libqalculate-0.9.8: NumberArgument Class Reference

A definition for numerical arguments. More...

#include <Function.h>

Inheritance diagram for NumberArgument:
Argument

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
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
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
 

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
 
- Protected Attributes inherited from Argument
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 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 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 void NumberArgument::set ( const Argument arg)
virtual

Sets the argument to a copy of an argument definition.

Parameters
argArgument to copy.

Reimplemented from Argument.

virtual string NumberArgument::subprintlong ( ) const
protectedvirtual

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 bool NumberArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 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:
libqalculate-0.9.10/docs/reference/html/classFunctionArgument.html0000644000175000017500000006650012757636735022256 00000000000000 libqalculate-0.9.8: FunctionArgument Class Reference

A function argument. More...

#include <Function.h>

Inheritance diagram for FunctionArgument:
Argument

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
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Argument
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 function argument.

Member Function Documentation

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.

virtual string FunctionArgument::subprintlong ( ) const
protectedvirtual

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 bool FunctionArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int FunctionArgument::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:
libqalculate-0.9.10/docs/reference/html/bdwn.png0000644000175000017500000000022312757636734016477 00000000000000PNG  IHDR5ZIDATx DP1lm rj.e D[ɾ|6V3?Ls'(}>+ Kch` ^ލnIENDB`libqalculate-0.9.10/docs/reference/html/classArgument-members.html0000644000175000017500000002746112757636735022203 00000000000000 libqalculate-0.9.8: 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const Argumentvirtual
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const Argumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const Argumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const Argumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const Argumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
libqalculate-0.9.10/docs/reference/html/tab_b.png0000644000175000017500000000025112757636734016615 00000000000000PNG  IHDR$[pIDATxM EǻԸu`V0}:t]Ds䮂u|x>1&m8SxLU޲iEOsnxKN~jIENDB`libqalculate-0.9.10/docs/reference/html/classFileArgument-members.html0000644000175000017500000003141412757636735022774 00000000000000 libqalculate-0.9.8: Member List
FileArgument Member List

This is the complete list of members for FileArgument, 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const FileArgumentvirtual
FileArgument(string name_="", bool does_test=true, bool does_error=true) (defined in FileArgument)FileArgument
FileArgument(const FileArgument *arg) (defined in FileArgument)FileArgument
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const FileArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const FileArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const FileArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const FileArgumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~FileArgument() (defined in FileArgument)FileArgumentvirtual
libqalculate-0.9.10/docs/reference/html/functions_vars.html0000644000175000017500000004651412757636735021006 00000000000000 libqalculate-0.9.8: 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 -

libqalculate-0.9.10/docs/reference/html/classMatrixArgument-members.html0000644000175000017500000003335512757636735023367 00000000000000 libqalculate-0.9.8: 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_square (defined in MatrixArgument)MatrixArgumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const MatrixArgumentvirtual
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 Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const MatrixArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)MatrixArgumentvirtual
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
squareDemanded() const (defined in MatrixArgument)MatrixArgumentvirtual
subprintlong() const MatrixArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const MatrixArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const MatrixArgumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~MatrixArgument() (defined in MatrixArgument)MatrixArgumentvirtual
libqalculate-0.9.10/docs/reference/html/classCalculatorMessage-members.html0000644000175000017500000001053212757636735024006 00000000000000 libqalculate-0.9.8: 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)CalculatorMessageprotected
smessage (defined in CalculatorMessage)CalculatorMessageprotected
type() const (defined in CalculatorMessage)CalculatorMessage
libqalculate-0.9.10/docs/reference/html/doxygen.css0000644000175000017500000006241712757636734017243 00000000000000/* The standard CSS for doxygen 1.8.11 */ body, table, div, p, dl { font: 400 14px/22px Roboto,sans-serif; } /* @group Heading Levels */ h1.groupheader { font-size: 150%; } .title { font: 400 14px/28px Roboto,sans-serif; font-size: 150%; font-weight: bold; margin: 10px 2px; } h2.groupheader { border-bottom: 1px solid #879ECB; color: #354C7B; font-size: 150%; font-weight: normal; margin-top: 1.75em; padding-top: 8px; padding-bottom: 4px; width: 100%; } h3.groupheader { font-size: 100%; } h1, h2, h3, h4, h5, h6 { -webkit-transition: text-shadow 0.5s linear; -moz-transition: text-shadow 0.5s linear; -ms-transition: text-shadow 0.5s linear; -o-transition: text-shadow 0.5s linear; transition: text-shadow 0.5s linear; margin-right: 15px; } h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { text-shadow: 0 0 15px cyan; } dt { font-weight: bold; } div.multicol { -moz-column-gap: 1em; -webkit-column-gap: 1em; -moz-column-count: 3; -webkit-column-count: 3; } p.startli, p.startdd { margin-top: 2px; } p.starttd { margin-top: 0px; } p.endli { margin-bottom: 0px; } p.enddd { margin-bottom: 4px; } p.endtd { margin-bottom: 2px; } /* @end */ caption { font-weight: bold; } span.legend { font-size: 70%; text-align: center; } h3.version { font-size: 90%; text-align: center; } div.qindex, div.navtab{ background-color: #EBEFF6; border: 1px solid #A3B4D7; text-align: center; } div.qindex, div.navpath { width: 100%; line-height: 140%; } div.navtab { margin-right: 15px; } /* @group Link Styling */ a { color: #3D578C; font-weight: normal; text-decoration: none; } .contents a:visited { color: #4665A2; } a:hover { text-decoration: underline; } a.qindex { font-weight: bold; } a.qindexHL { font-weight: bold; background-color: #9CAFD4; color: #ffffff; border: 1px double #869DCA; } .contents a.qindexHL:visited { color: #ffffff; } a.el { font-weight: bold; } a.elRef { } a.code, a.code:visited, a.line, a.line:visited { color: #4665A2; } a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { color: #4665A2; } /* @end */ dl.el { margin-left: -1cm; } pre.fragment { border: 1px solid #C4CFE5; background-color: #FBFCFD; padding: 4px 6px; margin: 4px 8px 4px 2px; overflow: auto; word-wrap: break-word; font-size: 9pt; line-height: 125%; font-family: monospace, fixed; font-size: 105%; } div.fragment { padding: 4px 6px; margin: 4px 8px 4px 2px; background-color: #FBFCFD; border: 1px solid #C4CFE5; } div.line { font-family: monospace, fixed; font-size: 13px; min-height: 13px; line-height: 1.0; text-wrap: unrestricted; white-space: -moz-pre-wrap; /* Moz */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: pre-wrap; /* CSS3 */ word-wrap: break-word; /* IE 5.5+ */ text-indent: -53px; padding-left: 53px; padding-bottom: 0px; margin: 0px; -webkit-transition-property: background-color, box-shadow; -webkit-transition-duration: 0.5s; -moz-transition-property: background-color, box-shadow; -moz-transition-duration: 0.5s; -ms-transition-property: background-color, box-shadow; -ms-transition-duration: 0.5s; -o-transition-property: background-color, box-shadow; -o-transition-duration: 0.5s; transition-property: background-color, box-shadow; transition-duration: 0.5s; } div.line:after { content:"\000A"; white-space: pre; } div.line.glow { background-color: cyan; box-shadow: 0 0 10px cyan; } span.lineno { padding-right: 4px; text-align: right; border-right: 2px solid #0F0; background-color: #E8E8E8; white-space: pre; } span.lineno a { background-color: #D8D8D8; } span.lineno a:hover { background-color: #C8C8C8; } div.ah, span.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px; padding: 0.2em; border: solid thin #333; border-radius: 0.5em; -webkit-border-radius: .5em; -moz-border-radius: .5em; box-shadow: 2px 2px 3px #999; -webkit-box-shadow: 2px 2px 3px #999; -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); } div.classindex ul { list-style: none; padding-left: 0; } div.classindex span.ai { display: inline-block; } div.groupHeader { margin-left: 16px; margin-top: 12px; font-weight: bold; } div.groupText { margin-left: 16px; font-style: italic; } body { background-color: white; color: black; margin: 0; } div.contents { margin-top: 10px; margin-left: 12px; margin-right: 8px; } td.indexkey { background-color: #EBEFF6; font-weight: bold; border: 1px solid #C4CFE5; margin: 2px 0px 2px 0; padding: 2px 10px; white-space: nowrap; vertical-align: top; } td.indexvalue { background-color: #EBEFF6; border: 1px solid #C4CFE5; padding: 2px 10px; margin: 2px 0px; } tr.memlist { background-color: #EEF1F7; } p.formulaDsp { text-align: center; } img.formulaDsp { } img.formulaInl { vertical-align: middle; } div.center { text-align: center; margin-top: 0px; margin-bottom: 0px; padding: 0px; } div.center img { border: 0px; } address.footer { text-align: right; padding-right: 12px; } img.footer { border: 0px; vertical-align: middle; } /* @group Code Colorization */ 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 } blockquote { background-color: #F7F8FB; border-left: 2px solid #9CAFD4; margin: 0 24px 0 4px; padding: 0 12px 0 16px; } /* @end */ /* .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%; } .dirtab { padding: 4px; border-collapse: collapse; border: 1px solid #A3B4D7; } th.dirtab { background: #EBEFF6; font-weight: bold; } hr { height: 0px; border: none; border-top: 1px solid #4A6AAA; } hr.footer { height: 1px; } /* @group Member Descriptions */ table.memberdecls { border-spacing: 0px; padding: 0px; } .memberdecls td, .fieldtable tr { -webkit-transition-property: background-color, box-shadow; -webkit-transition-duration: 0.5s; -moz-transition-property: background-color, box-shadow; -moz-transition-duration: 0.5s; -ms-transition-property: background-color, box-shadow; -ms-transition-duration: 0.5s; -o-transition-property: background-color, box-shadow; -o-transition-duration: 0.5s; transition-property: background-color, box-shadow; transition-duration: 0.5s; } .memberdecls td.glow, .fieldtable tr.glow { background-color: cyan; box-shadow: 0 0 15px cyan; } .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { background-color: #F9FAFC; border: none; margin: 4px; padding: 1px 0 0 8px; } .mdescLeft, .mdescRight { padding: 0px 8px 4px 8px; color: #555; } .memSeparator { border-bottom: 1px solid #DEE4F0; line-height: 1px; margin: 0px; padding: 0px; } .memItemLeft, .memTemplItemLeft { white-space: nowrap; } .memItemRight { width: 100%; } .memTemplParams { color: #4665A2; white-space: nowrap; font-size: 80%; } /* @end */ /* @group Member Details */ /* Styles for detailed member documentation */ .memtemplate { font-size: 80%; color: #4665A2; font-weight: normal; margin-left: 9px; } .memnav { background-color: #EBEFF6; border: 1px solid #A3B4D7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } .mempage { width: 100%; } .memitem { padding: 0; margin-bottom: 10px; margin-right: 5px; -webkit-transition: box-shadow 0.5s linear; -moz-transition: box-shadow 0.5s linear; -ms-transition: box-shadow 0.5s linear; -o-transition: box-shadow 0.5s linear; transition: box-shadow 0.5s linear; display: table !important; width: 100%; } .memitem.glow { box-shadow: 0 0 15px cyan; } .memname { font-weight: bold; margin-left: 6px; } .memname td { vertical-align: bottom; } .memproto, dl.reflist dt { border-top: 1px solid #A8B8D9; border-left: 1px solid #A8B8D9; border-right: 1px solid #A8B8D9; padding: 6px 0px 6px 0px; color: #253555; font-weight: bold; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); background-image:url('nav_f.png'); background-repeat:repeat-x; background-color: #E2E8F2; /* opera specific markup */ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); border-top-right-radius: 4px; border-top-left-radius: 4px; /* firefox specific markup */ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; -moz-border-radius-topright: 4px; -moz-border-radius-topleft: 4px; /* webkit specific markup */ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -webkit-border-top-right-radius: 4px; -webkit-border-top-left-radius: 4px; } .memdoc, dl.reflist dd { border-bottom: 1px solid #A8B8D9; border-left: 1px solid #A8B8D9; border-right: 1px solid #A8B8D9; padding: 6px 10px 2px 10px; background-color: #FBFCFD; border-top-width: 0; background-image:url('nav_g.png'); background-repeat:repeat-x; background-color: #FFFFFF; /* opera specific markup */ border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); /* firefox specific markup */ -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; /* webkit specific markup */ -webkit-border-bottom-left-radius: 4px; -webkit-border-bottom-right-radius: 4px; -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); } dl.reflist dt { padding: 5px; } dl.reflist dd { margin: 0px 0px 10px 0px; padding: 5px; } .paramkey { text-align: right; } .paramtype { white-space: nowrap; } .paramname { color: #602020; white-space: nowrap; } .paramname em { font-style: normal; } .paramname code { line-height: 14px; } .params, .retval, .exception, .tparams { margin-left: 0px; padding-left: 0px; } .params .paramname, .retval .paramname { font-weight: bold; vertical-align: top; } .params .paramtype { font-style: italic; vertical-align: top; } .params .paramdir { font-family: "courier new",courier,monospace; vertical-align: top; } table.mlabels { border-spacing: 0px; } td.mlabels-left { width: 100%; padding: 0px; } td.mlabels-right { vertical-align: bottom; padding: 0px; white-space: nowrap; } span.mlabels { margin-left: 8px; } span.mlabel { background-color: #728DC1; border-top:1px solid #5373B4; border-left:1px solid #5373B4; border-right:1px solid #C4CFE5; border-bottom:1px solid #C4CFE5; text-shadow: none; color: white; margin-right: 4px; padding: 2px 3px; border-radius: 3px; font-size: 7pt; white-space: nowrap; vertical-align: middle; } /* @end */ /* these are for tree view inside a (index) page */ div.directory { margin: 10px 0px; border-top: 1px solid #9CAFD4; border-bottom: 1px solid #9CAFD4; width: 100%; } .directory table { border-collapse:collapse; } .directory td { margin: 0px; padding: 0px; vertical-align: top; } .directory td.entry { white-space: nowrap; padding-right: 6px; padding-top: 3px; } .directory td.entry a { outline:none; } .directory td.entry a img { border: none; } .directory td.desc { width: 100%; padding-left: 6px; padding-right: 6px; padding-top: 3px; border-left: 1px solid rgba(0,0,0,0.05); } .directory tr.even { padding-left: 6px; background-color: #F7F8FB; } .directory img { vertical-align: -30%; } .directory .levels { white-space: nowrap; width: 100%; text-align: right; font-size: 9pt; } .directory .levels span { cursor: pointer; padding-left: 2px; padding-right: 2px; color: #3D578C; } .arrow { color: #9CAFD4; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; font-size: 80%; display: inline-block; width: 16px; height: 22px; } .icon { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; height: 14px; width: 16px; display: inline-block; background-color: #728DC1; color: white; text-align: center; border-radius: 4px; margin-left: 2px; margin-right: 2px; } .icona { width: 24px; height: 22px; display: inline-block; } .iconfopen { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('folderopen.png'); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } .iconfclosed { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('folderclosed.png'); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } .icondoc { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('doc.png'); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } table.directory { font: 400 14px Roboto,sans-serif; } /* @end */ div.dynheader { margin-top: 8px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } address { font-style: normal; color: #2A3D61; } table.doxtable caption { caption-side: top; } table.doxtable { border-collapse:collapse; margin-top: 4px; margin-bottom: 4px; } table.doxtable td, table.doxtable th { border: 1px solid #2D4068; padding: 3px 7px 2px; } table.doxtable th { background-color: #374F7F; color: #FFFFFF; font-size: 110%; padding-bottom: 4px; padding-top: 5px; } table.fieldtable { /*width: 100%;*/ margin-bottom: 10px; border: 1px solid #A8B8D9; border-spacing: 0px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); } .fieldtable td, .fieldtable th { padding: 3px 7px 2px; } .fieldtable td.fieldtype, .fieldtable td.fieldname { white-space: nowrap; border-right: 1px solid #A8B8D9; border-bottom: 1px solid #A8B8D9; vertical-align: top; } .fieldtable td.fieldname { padding-top: 3px; } .fieldtable td.fielddoc { border-bottom: 1px solid #A8B8D9; /*width: 100%;*/ } .fieldtable td.fielddoc p:first-child { margin-top: 0px; } .fieldtable td.fielddoc p:last-child { margin-bottom: 2px; } .fieldtable tr:last-child td { border-bottom: none; } .fieldtable th { background-image:url('nav_f.png'); background-repeat:repeat-x; background-color: #E2E8F2; font-size: 90%; color: #253555; padding-bottom: 4px; padding-top: 5px; text-align:left; -moz-border-radius-topleft: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-left-radius: 4px; -webkit-border-top-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom: 1px solid #A8B8D9; } .tabsearch { top: 0px; left: 10px; height: 36px; background-image: url('tab_b.png'); z-index: 101; overflow: hidden; font-size: 13px; } .navpath ul { font-size: 11px; background-image:url('tab_b.png'); background-repeat:repeat-x; background-position: 0 -5px; height:30px; line-height:30px; color:#8AA0CC; border:solid 1px #C2CDE4; overflow:hidden; margin:0px; padding:0px; } .navpath li { list-style-type:none; float:left; padding-left:10px; padding-right:15px; background-image:url('bc_s.png'); background-repeat:no-repeat; background-position:right; color:#364D7C; } .navpath li.navelem a { height:32px; display:block; text-decoration: none; outline: none; color: #283A5D; font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); text-decoration: none; } .navpath li.navelem a:hover { color:#6884BD; } .navpath li.footer { list-style-type:none; float:right; padding-left:10px; padding-right:15px; background-image:none; background-repeat:no-repeat; background-position:right; color:#364D7C; font-size: 8pt; } div.summary { float: right; font-size: 8pt; padding-right: 5px; width: 50%; text-align: right; } div.summary a { white-space: nowrap; } table.classindex { margin: 10px; white-space: nowrap; margin-left: 3%; margin-right: 3%; width: 94%; border: 0; border-spacing: 0; padding: 0; } div.ingroups { font-size: 8pt; width: 50%; text-align: left; } div.ingroups a { white-space: nowrap; } div.header { background-image:url('nav_h.png'); background-repeat:repeat-x; background-color: #F9FAFC; margin: 0px; border-bottom: 1px solid #C4CFE5; } div.headertitle { padding: 5px 5px 5px 10px; } dl { padding: 0 0 0 10px; } /* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ dl.section { margin-left: 0px; padding-left: 0px; } dl.note { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #D0C000; } dl.warning, dl.attention { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #FF0000; } dl.pre, dl.post, dl.invariant { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #00D000; } dl.deprecated { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #505050; } dl.todo { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #00C0E0; } dl.test { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #3030E0; } dl.bug { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #C08050; } dl.section dd { margin-bottom: 6px; } #projectlogo { text-align: center; vertical-align: bottom; border-collapse: separate; } #projectlogo img { border: 0px none; } #projectalign { vertical-align: middle; } #projectname { font: 300% Tahoma, Arial,sans-serif; margin: 0px; padding: 2px 0px; } #projectbrief { font: 120% Tahoma, Arial,sans-serif; margin: 0px; padding: 0px; } #projectnumber { font: 50% Tahoma, Arial,sans-serif; margin: 0px; padding: 0px; } #titlearea { padding: 0px; margin: 0px; width: 100%; border-bottom: 1px solid #5373B4; } .image { text-align: center; } .dotgraph { text-align: center; } .mscgraph { text-align: center; } .diagraph { text-align: center; } .caption { font-weight: bold; } div.zoom { border: 1px solid #90A5CE; } dl.citelist { margin-bottom:50px; } dl.citelist dt { color:#334975; float:left; font-weight:bold; margin-right:10px; padding:5px; } dl.citelist dd { margin:2px 0; padding:5px 0; } div.toc { padding: 14px 25px; background-color: #F4F6FA; border: 1px solid #D8DFEE; border-radius: 7px 7px 7px 7px; float: right; height: auto; margin: 0 8px 10px 10px; width: 200px; } div.toc li { background: url("bdwn.png") no-repeat scroll 0 5px transparent; font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; margin-top: 5px; padding-left: 10px; padding-top: 2px; } div.toc h3 { font: bold 12px/1.2 Arial,FreeSans,sans-serif; color: #4665A2; border-bottom: 0 none; margin: 0; } div.toc ul { list-style: none outside none; border: medium none; padding: 0px; } div.toc li.level1 { margin-left: 0px; } div.toc li.level2 { margin-left: 15px; } div.toc li.level3 { margin-left: 30px; } div.toc li.level4 { margin-left: 45px; } .inherit_header { font-weight: bold; color: gray; cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .inherit_header td { padding: 6px 0px 2px 5px; } .inherit { display: none; } tr.heading h2 { margin-top: 12px; margin-bottom: 4px; } /* tooltip related style info */ .ttc { position: absolute; display: none; } #powerTip { cursor: default; white-space: nowrap; background-color: white; border: 1px solid gray; border-radius: 4px 4px 4px 4px; box-shadow: 1px 1px 7px gray; display: none; font-size: smaller; max-width: 80%; opacity: 0.9; padding: 1ex 1em 1em; position: absolute; z-index: 2147483647; } #powerTip div.ttdoc { color: grey; font-style: italic; } #powerTip div.ttname a { font-weight: bold; } #powerTip div.ttname { font-weight: bold; } #powerTip div.ttdeci { color: #006318; } #powerTip div { margin: 0px; padding: 0px; font: 12px/16px Roboto,sans-serif; } #powerTip:before, #powerTip:after { content: ""; position: absolute; margin: 0px; } #powerTip.n:after, #powerTip.n:before, #powerTip.s:after, #powerTip.s:before, #powerTip.w:after, #powerTip.w:before, #powerTip.e:after, #powerTip.e:before, #powerTip.ne:after, #powerTip.ne:before, #powerTip.se:after, #powerTip.se:before, #powerTip.nw:after, #powerTip.nw:before, #powerTip.sw:after, #powerTip.sw:before { border: solid transparent; content: " "; height: 0; width: 0; position: absolute; } #powerTip.n:after, #powerTip.s:after, #powerTip.w:after, #powerTip.e:after, #powerTip.nw:after, #powerTip.ne:after, #powerTip.sw:after, #powerTip.se:after { border-color: rgba(255, 255, 255, 0); } #powerTip.n:before, #powerTip.s:before, #powerTip.w:before, #powerTip.e:before, #powerTip.nw:before, #powerTip.ne:before, #powerTip.sw:before, #powerTip.se:before { border-color: rgba(128, 128, 128, 0); } #powerTip.n:after, #powerTip.n:before, #powerTip.ne:after, #powerTip.ne:before, #powerTip.nw:after, #powerTip.nw:before { top: 100%; } #powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { border-top-color: #ffffff; border-width: 10px; margin: 0px -10px; } #powerTip.n:before { border-top-color: #808080; border-width: 11px; margin: 0px -11px; } #powerTip.n:after, #powerTip.n:before { left: 50%; } #powerTip.nw:after, #powerTip.nw:before { right: 14px; } #powerTip.ne:after, #powerTip.ne:before { left: 14px; } #powerTip.s:after, #powerTip.s:before, #powerTip.se:after, #powerTip.se:before, #powerTip.sw:after, #powerTip.sw:before { bottom: 100%; } #powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { border-bottom-color: #ffffff; border-width: 10px; margin: 0px -10px; } #powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { border-bottom-color: #808080; border-width: 11px; margin: 0px -11px; } #powerTip.s:after, #powerTip.s:before { left: 50%; } #powerTip.sw:after, #powerTip.sw:before { right: 14px; } #powerTip.se:after, #powerTip.se:before { left: 14px; } #powerTip.e:after, #powerTip.e:before { left: 100%; } #powerTip.e:after { border-left-color: #ffffff; border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.e:before { border-left-color: #808080; border-width: 11px; top: 50%; margin-top: -11px; } #powerTip.w:after, #powerTip.w:before { right: 100%; } #powerTip.w:after { border-right-color: #ffffff; border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.w:before { border-right-color: #808080; border-width: 11px; top: 50%; margin-top: -11px; } @media print { #top { display: none; } #side-nav { display: none; } #nav-path { display: none; } body { overflow:visible; } h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } .summary { display: none; } .memitem { page-break-inside: avoid; } #doc-content { margin-left:0 !important; height:auto !important; width:auto !important; overflow:inherit; display:inline; } } libqalculate-0.9.10/docs/reference/html/open.png0000644000175000017500000000017312757636734016512 00000000000000PNG  IHDR BIDATx 0 ׬ՙ\39b!9{|I>$#ߴ8/z/>2[giU,/~\ 9ٸIENDB`libqalculate-0.9.10/docs/reference/html/functions_0x7e.html0000644000175000017500000001053612757636735020611 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- ~ -

libqalculate-0.9.10/docs/reference/html/arrowright.png0000644000175000017500000000034512757636735017743 00000000000000PNG  IHDRɪ|IDATx=QFDk:FPK؃=V@ճ 8SHx0bnrr{򽿾$ TP XOd6"SOB(Q)+YĈ ҪR>Vtsm9(k-@ȧ-$ b [he Kp-l|CApRG'rͭaIENDB`libqalculate-0.9.10/docs/reference/html/ExpressionItem_8h.html0000644000175000017500000000665412757636735021321 00000000000000 libqalculate-0.9.8: libqalculate/ExpressionItem.h File Reference
ExpressionItem.h File Reference

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...
 
libqalculate-0.9.10/docs/reference/html/classDataSet.html0000644000175000017500000024561012757636735020314 00000000000000 libqalculate-0.9.8: DataSet Class Reference

A data set. More...

#include <DataSet.h>

Inheritance diagram for DataSet:
MathFunction ExpressionItem

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)
 
- Public Member Functions inherited from MathFunction
 MathFunction (string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true)
 
 MathFunction (const MathFunction *function)
 
virtual int type () 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)
 
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
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
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)
 

Protected Attributes

string sfile
 
string scopyright
 
bool b_loaded
 
vector< DataProperty * > properties
 
vector< DataObject * > objects
 
- Protected Attributes inherited from MathFunction
MathFunction_p * priv
 
int argc
 
int max_argc
 
vector< string > default_values
 
size_t last_argdef_index
 
string scondition
 
- Protected Attributes inherited from ExpressionItem
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
 

Additional Inherited Members

- Protected Member Functions inherited from MathFunction
bool testArguments (MathStructure &vargs)
 
virtual MathStructure createFunctionMathStructureFromVArgs (const MathStructure &vargs)
 
virtual MathStructure createFunctionMathStructureFromSVArgs (vector< string > &svargs)
 

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

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]mstructStructure that is set with the result of the calculation.
vargsArguments passed to the mathematical function.
eoEvaluation options.
Returns
1 if the calculation was successful.

Reimplemented from MathFunction.

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.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/structEvaluationOptions-members.html0000644000175000017500000001733512757636735024322 00000000000000 libqalculate-0.9.8: Member List
EvaluationOptions Member List
libqalculate-0.9.10/docs/reference/html/classFileArgument.html0000644000175000017500000006571612757636735021360 00000000000000 libqalculate-0.9.8: FileArgument Class Reference
Inheritance diagram for FileArgument:
Argument

Public Member Functions

 FileArgument (string name_="", bool does_test=true, bool does_error=true)
 
 FileArgument (const FileArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 

Member Function Documentation

virtual Argument* FileArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

virtual string FileArgument::print ( ) const
virtual

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

Returns
Short description.

Reimplemented from Argument.

virtual string FileArgument::subprintlong ( ) const
protectedvirtual

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 bool FileArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int FileArgument::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:
libqalculate-0.9.10/docs/reference/html/functions_func_h.html0000644000175000017500000001172712757636735021273 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- h -

libqalculate-0.9.10/docs/reference/html/classDataObject-members.html0000644000175000017500000001656012757636735022417 00000000000000 libqalculate-0.9.8: Member List
DataObject Member List

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

a_properties (defined in DataObject)DataObjectprotected
b_uchanged (defined in DataObject)DataObjectprotected
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)DataObjectprotected
parent (defined in DataObject)DataObjectprotected
parentSet() const DataObject
properties (defined in DataObject)DataObjectprotected
s_nonlocalized_properties (defined in DataObject)DataObjectprotected
s_properties (defined in DataObject)DataObjectprotected
setNonlocalizedKeyProperty(DataProperty *property, string s_value)DataObject
setProperty(DataProperty *property, string s_value, int is_approximate=-1)DataObject
setUserModified(bool user_modified=true)DataObject
libqalculate-0.9.10/docs/reference/html/functions_g.html0000644000175000017500000002036512757636735020255 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- g -

libqalculate-0.9.10/docs/reference/html/classExpressionItem-members.html0000644000175000017500000005715712757636735023404 00000000000000 libqalculate-0.9.8: 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)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
category() const ExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const =0 (defined in ExpressionItem)ExpressionItempure virtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() const ExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
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 ExpressionItemvirtual
getName(size_t index) const ExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() const ExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) const ExpressionItemvirtual
hasNameCaseSensitive(const string &sname) const ExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() const ExpressionItemvirtual
isApproximate() const ExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
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)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
precision() const ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() const ExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in ExpressionItem)ExpressionItemvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() const =0ExpressionItempure 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 ExpressionItemvirtual
type() const =0ExpressionItempure virtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
libqalculate-0.9.10/docs/reference/html/classes.html0000644000175000017500000002721412757636735017374 00000000000000 libqalculate-0.9.8: Class Index
Class Index
A | B | C | D | E | F | I | K | M | N | P | S | T | U | V
  A  
CompositeUnit   ExpressionItemArgument   MathStructure   SymbolicArgument   
  D  
ExpressionName   MatrixArgument   
  T  
AliasUnit   
  F  
  N  
AliasUnit_Composite   DataObject   TextArgument   
AngleArgument   DataObjectArgument   FileArgument   Number   
  U  
Argument   DataProperty   FunctionArgument   NumberArgument   
ArgumentSet   DataPropertyArgument   
  I  
NumberPrefix   Unit   
Assumptions   DataSet   
  P  
UnitArgument   
  B  
DateArgument   IntegerArgument   UnknownVariable   
DecimalPrefix   InternalPrintStruct   ParseOptions   UserFunction   
BinaryPrefix   DynamicVariable   
  K  
PlotDataParameters   
  V  
BooleanArgument   
  E  
PlotParameters   
  C  
KnownVariable   Prefix   Variable   
Element   
  M  
PrintOptions   VariableArgument   
Calculator   EvaluationOptions   
  S  
VectorArgument   
CalculatorMessage   ExpressionItem   MathFunction   
SortOptions   
A | B | C | D | E | F | I | K | M | N | P | S | T | U | V
libqalculate-0.9.10/docs/reference/html/classDateArgument-members.html0000644000175000017500000003141412757636735022772 00000000000000 libqalculate-0.9.8: 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const DateArgumentvirtual
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 Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const DateArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const DateArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const DateArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const DateArgumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~DateArgument() (defined in DateArgument)DateArgumentvirtual
libqalculate-0.9.10/docs/reference/html/functions_d.html0000644000175000017500000001322312757636735020245 00000000000000 libqalculate-0.9.8: Class Members
Here is a list of all documented class members with links to the class documentation for each member:

- d -

libqalculate-0.9.10/docs/reference/html/Variable_8h.html0000644000175000017500000003552112757636735020063 00000000000000 libqalculate-0.9.8: libqalculate/Variable.h File Reference
Variable.h File Reference

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...
 

Macros

#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...
 

Macro Definition Documentation

#define DECLARE_BUILTIN_VARIABLE (   x)
Value:
class x : public DynamicVariable { \
private: \
void calculate() const; \
public: \
x(); \
x(const x *variable) {set(variable);} \
ExpressionItem *copy() const {return new x(this);} \
};
Abstract base class for variables with a value which is recalculated when the precision has changed...
Definition: Variable.h:325

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

libqalculate-0.9.10/docs/reference/html/classDataObject.html0000644000175000017500000005421012757636735020761 00000000000000 libqalculate-0.9.8: DataObject Class Reference

A a data set object. More...

#include <DataSet.h>

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_setData set that the object will belong to.

Member Function Documentation

void DataObject::eraseProperty ( DataProperty property)

Unset (erase value) a property.

Parameters
propertyProperty to unset.
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
propertyProperty to read.
Returns
Unparsed untranslated value or empty string if property value is not set.
const string& DataObject::getProperty ( DataProperty property,
int *  is_approximate = NULL 
)

Returns unparsed value for a property.

Parameters
propertyProperty to read.
[out]is_approximateIf 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.
string DataObject::getPropertyDisplayString ( DataProperty property)

Returns value for a property in a format suitable for display with unit appended.

Parameters
propertyProperty to read.
Returns
Value in display format 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
propertyProperty to read.
Returns
Value in input format or empty string if property value is not set.
const MathStructure* DataObject::getPropertyStruct ( DataProperty property)

Returns parsed value for a property. Parses the text string value if not parsed before

Parameters
propertyProperty to read.
Returns
Parsed value or NULL 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.
DataSet* DataObject::parentSet ( ) const

Returns the data set that the object belongs to.

Returns
Parent data set.
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
propertyProperty to set (must belong to parent data set).
s_valeValue for the property.
void DataObject::setProperty ( DataProperty property,
string  s_value,
int  is_approximate = -1 
)

Set value for a property.

Parameters
propertyProperty to set (must belong to parent data set).
s_valeValue for the property.
is_approximateIf the value is approximate. 1 for approximate, 0 for exact, -1 for property default.
void DataObject::setUserModified ( bool  user_modified = true)

Specify if the object has been modified by the end user.

Parameters
user_modifiedtrue if the object has been modified by the user.

The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/structPlotParameters-members.html0000644000175000017500000002004012757636735023564 00000000000000 libqalculate-0.9.8: Member List
PlotParameters Member List
libqalculate-0.9.10/docs/reference/html/functions_func_o.html0000644000175000017500000001022512757636735021272 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- o -

libqalculate-0.9.10/docs/reference/html/functions_func.html0000644000175000017500000001313212757636735020754 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- a -

libqalculate-0.9.10/docs/reference/html/classMathFunction.png0000644000175000017500000000164512757636735021204 00000000000000PNG  IHDR+PLTEutRNST24IDATx뒫 *OM&F3m&3^T1IjTYT\HRvgP_3JqozNkY&V]PC\Z+Ri*QI+a۲md^:uPX9SeVe G{e0*(o 6 1nLSTZ0nsLeQ۸GarXS S S S8i/p&{Іtb*m @'Іtb*m @'*{|q$/I瑫Hy$a*➟ڭT*ݧ˜G=ʏzRTII:e*^T:>2Iҁ "LByĪ>z*$i*NkEyS 8+EKq =랋˲_qZX~=U,򭾵4rwT>WJJJ\MsȲZ =_d"7a'`*.Kһ$ub*ԆHR'"Im|U{O$S=d3&IENDB`libqalculate-0.9.10/docs/reference/html/classVariableArgument-members.html0000644000175000017500000003162412757636735023645 00000000000000 libqalculate-0.9.8: Member List
VariableArgument Member List

This is the complete list of members for VariableArgument, 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const VariableArgumentvirtual
getCustomCondition() const Argument
matrixAllowed() const (defined in Argument)Argument
name() const Argument
parse(const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const VariableArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const VariableArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const VariableArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const VariableArgumentvirtual
VariableArgument(string name_="", bool does_test=true, bool does_error=true) (defined in VariableArgument)VariableArgument
VariableArgument(const VariableArgument *arg) (defined in VariableArgument)VariableArgument
zeroForbidden() const Argument
~Argument()Argumentvirtual
~VariableArgument() (defined in VariableArgument)VariableArgumentvirtual
libqalculate-0.9.10/docs/reference/html/classFileArgument.png0000644000175000017500000000071212757636735021161 00000000000000PNG  IHDRWP[PLTEutRNST2YIDATx ǃm\pTau ώM!A$y?B :w ^F+?.4utMW s_"[UM%YC]q 7v]%ٌ-u\SmWy(!I6c}[}Mf%o8Ρ'Ɂ;Xn!/ 6h}cwqw\u8׹+:pED6˹.&j،]ܛhөyF5yD{Ҟbr[e}kQ^rK'G|갾'-zJ[!8+p|;XfBfIENDB`libqalculate-0.9.10/docs/reference/html/structPlotDataParameters-members.html0000644000175000017500000000746512757636735024376 00000000000000 libqalculate-0.9.8: 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
libqalculate-0.9.10/docs/reference/html/closed.png0000644000175000017500000000020412757636734017015 00000000000000PNG  IHDR KIDATxm @!Gk7-`&sts@k}2 P%_N .:0Dk›x" ֛)x5IENDB`libqalculate-0.9.10/docs/reference/html/classUnit.html0000644000175000017500000020024112757636735017675 00000000000000 libqalculate-0.9.8: Unit Class Reference

A unit for measurement. More...

#include <Unit.h>

Inheritance diagram for Unit:
ExpressionItem AliasUnit CompositeUnit AliasUnit_Composite

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 useWithPrefixesByDefault () const
 
void setUseWithPrefixesByDefault (bool use_with_prefixes)
 
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
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
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)
 

Protected Attributes

string ssystem
 
bool b_si
 
bool b_use_with_prefixes
 
- Protected Attributes inherited from ExpressionItem
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

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::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
uUnit to convert from.
[in,out]mvalueQuantity value.
[in,out]expExponent.
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
uUnit to convert from.
[in,out]mvalueQuantity value.
Returns
true if the value was successfully converted.
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.

bool Unit::isCurrency ( ) const

Returns if the unit is a currency (Euro is base unit).

Returns
true if the unit is a currency.
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::isSIUnit ( ) const

Returns if the unit is part of the SI standard.

Returns
true if the unit is part of the SI standard.
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 CompositeUnit, and AliasUnit_Composite.

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", "CGS", etc.) the unit is part of. Setting system to "SI" (case-insensitive), is equivalent to setAsSIUnit().

void Unit::setUseWithPrefixesByDefault ( bool  use_with_prefixes)

Sets wether prefixes are approriate with this unit or not.

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 CompositeUnit, and AliasUnit.

const string& Unit::system ( ) const

Returns the system/standard that the unit is part of.

Returns
System string.
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.

bool Unit::useWithPrefixesByDefault ( ) const

Returns wether prefixes should be used with this unit or not.

Returns
true if the prefixes is appropriate for this unit.

The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/classUnknownVariable-members.html0000644000175000017500000007752012757636735023527 00000000000000 libqalculate-0.9.8: 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)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
assumptions()UnknownVariable
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
category() const ExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const (defined in UnknownVariable)UnknownVariablevirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() const ExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
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 ExpressionItemvirtual
getName(size_t index) const ExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() const ExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) const ExpressionItemvirtual
hasNameCaseSensitive(const string &sname) const ExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() const ExpressionItemvirtual
isApproximate() const ExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() const UnknownVariableinlinevirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
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)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
o_assumption (defined in UnknownVariable)UnknownVariableprotected
precision() const ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() const ExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in Variable)Variableinlinevirtual
representsComplex(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsEven(bool=false) (defined in Variable)Variableinlinevirtual
representsInteger(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsNegative(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsNonMatrix() (defined in UnknownVariable)UnknownVariablevirtual
representsNonNegative(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsNonPositive(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsNonZero(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsNumber(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsOdd(bool=false) (defined in Variable)Variableinlinevirtual
representsPositive(bool=false)UnknownVariablevirtual
representsRational(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsReal(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in Variable)Variableinlinevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in UnknownVariable)UnknownVariablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setAssumptions(Assumptions *ass)UnknownVariable
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() const UnknownVariableinlinevirtual
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 ExpressionItemvirtual
type() const Variableinlinevirtual
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)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
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)ExpressionItemvirtual
~UnknownVariable() (defined in UnknownVariable)UnknownVariablevirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-0.9.10/docs/reference/html/classBooleanArgument.png0000644000175000017500000000100312757636735021653 00000000000000PNG  IHDRpPOPLTEutRNST2IDATx]n )?rglLBlX6+{?$c %ɔ(t4}5Z 0mn?C+$5 +*p3T$ɀPBQA􅯿0c"La}U 룴Oi-ERj%ibHR's@3&;aW-IBL O#3-|<&g /%e LYBS%0e LYBSs0%0sх&Oi&9u85¸1iï+jHߛ0JQic^-:3adLk7wV]c/Րr8뫟ተ>[)9p0IP4&]!\bSz=B眛IENDB`libqalculate-0.9.10/docs/reference/html/tab_a.png0000644000175000017500000000021612757636734016615 00000000000000PNG  IHDR$[UIDATxK 0C'o([Ž%x#٩ We# 3t I 3+E~\D9wM}Y_A4Y}IENDB`libqalculate-0.9.10/docs/reference/html/classDataSet.png0000644000175000017500000000123312757636735020123 00000000000000PNG  IHDR`/QPLTEutRNST2*IDATxm | fNչ14 1ƕ%i.$ BHLqw@~rMwDVRn5c߽AbO~\IЖlރYКCA\ m8[ libqalculate-0.9.8: SymbolicArgument Class Reference

A symbolic argument. More...

#include <Function.h>

Inheritance diagram for SymbolicArgument:
Argument

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
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Argument
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 symbolic argument.

Accepts variables and symbolic structures.

Member Function Documentation

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.

virtual string SymbolicArgument::subprintlong ( ) const
protectedvirtual

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 bool SymbolicArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int SymbolicArgument::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:
libqalculate-0.9.10/docs/reference/html/classDataProperty.html0000644000175000017500000006020312757636735021376 00000000000000 libqalculate-0.9.8: DataProperty Class Reference

A data set property. More...

#include <DataSet.h>

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_nameProperty name (initial) used for reference.
s_titleDescriptive name/title.
s_descriptionDescription.

The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/classCalculator.html0000644000175000017500000117702312757636735021063 00000000000000 libqalculate-0.9.8: Calculator Class Reference

The almighty calculator class. More...

#include <Calculator.h>

Public Member Functions

UnitfindMatchingUnit (const MathStructure &mstruct)
 
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)
 
int testCondition (string expression)
 
Functions for printing expressions with the option to set a timeout or abort.
string printMathStructureTimeOut (const MathStructure &mstruct, int msecs=100000, const PrintOptions &op=default_print_options)
 
void startPrintControl (int milli_timeout=0)
 
void abortPrint (void)
 
void stopPrintControl (void)
 
bool printingAborted (void)
 
bool printingControlled (void)
 
string printingAbortedMessage (void) const
 
string timedOutString (void) const
 
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, bool keep_modifiers=false) const
 
bool hasToExpression (const string &str) 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 convertTimeOut (string str, Unit *from_unit, Unit *to_unit, int msecs, 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)
 
string temporaryCategory (void) const
 
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 hasGVFS ()
 
bool hasGnomeVFS ()
 
bool loadExchangeRates ()
 
string getExchangeRatesFileName ()
 
string getExchangeRatesUrl ()
 
time_t getExchangeRatesTime ()
 
bool fetchExchangeRates (int timeout, string wget_args)
 
bool fetchExchangeRates (int timeout=15)
 
bool checkExchangeRatesDate (unsigned int n_days=7, bool force_check=false, bool send_warning=false)
 
void setExchangeRatesWarningEnabled (bool enable)
 Enable or disable old exchange rates warning (initial state is true).
 
bool exchangeRatesWarningEnabled () const
 
bool exchangeRatesUsed () const
 Check if exchange rates has been used since resetExchangeRatesUsed() was last called.
 
void resetExchangeRatesUsed ()
 
void setExchangeRatesUsed ()
 For internal use, called by currency units.
 
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 (bool comma_as_separator=false)
 
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
 
Unitu_kelvin
 
Unitu_celsius
 
Unitu_fahrenheit
 
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
 
string expression_to_calculate
 
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
 
class Calculator_p * priv
 
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
 
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
 
time_t exchange_rates_time
 
time_t exchange_rates_check_time
 
bool b_exchange_rates_used
 
bool b_exchange_rates_warning_enabled
 
int has_gvfs
 
bool b_gnuplot_open
 
string gnuplot_cmdline
 
FILE * gnuplot_pipe
 
FILE * calculate_pipe_r
 
FILE * calculate_pipe_w
 
bool local_to
 
Assumptionsdefault_assumptions
 
vector< Variable * > deleted_variables
 
vector< MathFunction * > deleted_functions
 
vector< Unit * > deleted_units
 
bool b_save_called
 
int i_print_timeout
 
struct timeval t_print_end
 
int i_printing_aborted
 
bool b_printing_controlled
 
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

void Calculator::abort ( )

Aborts the current calculation.

void Calculator::abort_this ( )

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

void Calculator::abortPrint ( void  )

Abort formatting and printing (after startPrintControl() has been called). This function will normally be called from a thread that checks for used input or other conditions.

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.

void Calculator::addBuiltinVariables ( )

Adds builtin variables. Called automatically when the calculator is created.

size_t Calculator::addId ( MathStructure mstruct,
bool  persistent = false 
)

Stores a value with an associated id. Mainly for internal use.

Parameters
mstructThe value to store.
persistentIf false the values will be removed from storage when retrieved with getId().
Returns
Storage id.
Prefix* Calculator::addPrefix ( Prefix p)

Add a new prefix to the calculator.

bool Calculator::busy ( )

Returns true if the calculate or print thread is busy.

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]mstructMath structure to fill with the result.
strExpression.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the result of the parsing of the expression.
[out]to_structNULL or a math structure to fill with unit expression parsed after "to". If expression does not contain a "to" string, and to_struct is a unit or a symbol (a unit expression string), to_struct will be used instead.
make_to_divisionIf 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
strExpression.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the result of the parsing of the expression.
[out]to_structNULL or a math structure to fill with unit expression parsed after "to". If expression does not contain a "to" string, and to_struct is a unit or a symbol (a unit expression string), to_struct will be used instead.
make_to_divisionIf true, the expression after "to" will be interpreted as a unit epxression to convert the result to.
Returns
The result of the calculation.
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
opOperation.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL 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
fMathematical function.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL 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
opOperation.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL 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
fMathematical function.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the unevaluated result.
Returns
The first value on the stack.
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
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL 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::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
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the unevaluated result.
Returns
The first value on the stack.
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
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL 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::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
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the unevaluated result.
Returns
The first value on the stack.
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
indexIndex, starting at 1, on the RPN stack.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
Returns
true if the calculation was successfully started (and finished if msecs > 0).
bool Calculator::canFetch ( )

Checks if gvfs-copy or wget is available for downloading exchange rates from the Internet.

Returns
true if gvfs-copy or wget was found.
bool Calculator::canPlot ( )

Checks if gnuplot is available.

Returns
true if gnuplot was found.
bool Calculator::checkExchangeRatesDate ( unsigned int  n_days = 7,
bool  force_check = false,
bool  send_warning = false 
)

Check age of exchange rates on local disc.

Parameters
n_daysHow old in days exchange rates may be before exchange rates need updating
force_checkIf exchange rates date should be checked again even if found outdated within n_days before
send_warningIf the standard exchange rates warning should be sent.
Returns
false if exchange.rates need updating
void Calculator::clearBuffers ( )

Clears all stored values. Used internally after aborted calculation.

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
mstructThe value to convert.
composite_Unit expression.
eoEvaluation 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
mstructThe value to convert.
composite_Unit to convert to.
eoEvaluation options.
always_convert...
Returns
Converted value.
Assumptions* Calculator::defaultAssumptions ( )

Returns the default assumptions for objects without own assumptions (unknown variables and symbols).

void Calculator::delId ( size_t  id)

Removes and unreferences (value->unref() will be called) a value from storage. Mainly for internal use.

Parameters
idStorage id.
bool Calculator::fetchExchangeRates ( int  timeout,
string  wget_args 
)

Download current exchange rates from the Internet to local disc.

Parameters
timeoutTimeout for donwload try (only used by wget)
wget_argsExtra 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
timeoutTimeout for donwload try (only used by wget)
Returns
true if operation was successful.
Unit* Calculator::findMatchingUnit ( const MathStructure mstruct)

Used by the UI to find unit category for a mathematical expression.

BinaryPrefix* Calculator::getBestBinaryPrefix ( int  exp2,
int  exp = 1 
) const

Returns the best suited binary prefix for a value.

Parameters
exp10Base-2 exponent of the value.
expThe 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
exp10Base-2 exponent of the value.
expThe exponent of the unit.
Returns
A prefix or NULL if the unit should be left without prefix.
DecimalPrefix* Calculator::getBestDecimalPrefix ( int  exp10,
int  exp = 1,
bool  all_prefixes = true 
) const

Returns the best suited decimal prefix for a value.

Parameters
exp10Base-10 exponent of the value.
expThe exponent of the unit.
all_prefixesIf 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
exp10Base-10 exponent of the value.
expThe exponent of the unit.
all_prefixesIf 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.
const string& Calculator::getComma ( ) const

Returns the preferred comma character for separating arguments.

const string& Calculator::getDecimalPoint ( ) const

Returns the preferred decimal point character.

Unit* Calculator::getDegUnit ( )

Returns the degrees unit.

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
exp2Base-2 exponent of the requested prefix.
expThe exponent of the unit.
Returns
A prefix or NULL if not found.
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
exp10Base-10 exponent of the requested prefix.
expThe 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
oValue of the requested prefix.
expThe exponent of the unit.
Returns
A prefix or NULL if not found.
string Calculator::getExchangeRatesFileName ( )

Name of the exchange rates file on local disc.

Returns
name of local exchange rates file.
time_t Calculator::getExchangeRatesTime ( )

Modification time of the exchange rates file.

Returns
Returns exchange rates modification time.
string Calculator::getExchangeRatesUrl ( )

Url of the exchange rates file on the Internet.

Returns
Url of exchange rates file.
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
indexIndex of function.
Returns
Function for index or NULL if not found.
Unit* Calculator::getGraUnit ( )

Returns the gradians unit.

MathStructure* Calculator::getId ( size_t  id)

Returns a stored value. Mainly for internal use.

Parameters
idStorage id.
Returns
A stored value.
BinaryPrefix* Calculator::getNearestBinaryPrefix ( int  exp2,
int  exp = 1 
) const

Returns the nearest binary prefix for a value.

Parameters
exp10Base-2 exponent of the value.
expThe exponent of the unit.
Returns
A prefix or NULL if no binary prefix is available.
DecimalPrefix* Calculator::getNearestDecimalPrefix ( int  exp10,
int  exp = 1 
) const

Returns the nearest decimal prefix for a value.

Parameters
exp10Base-10 exponent of the value.
expThe exponent of the unit.
Returns
A prefix or NULL if no decimal prefix is available.
int Calculator::getPrecision ( ) const

Returns default precision for approximate calculations.

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
indexIndex 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.
Unit* Calculator::getRadUnit ( )

Returns the radians unit.

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
indexIndex of unit.
Returns
Unit for index 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
indexIndex of variable.
Returns
Variable for index or NULL if not found.
bool Calculator::hasFunction ( MathFunction f)

Checks if a function exists/is registered in the calculator.

bool Calculator::hasGnomeVFS ( )

Checks if gvfs-copy available. Deprecated: use hasGVFS() or canFetch() instead.

Returns
true if gvfs-copy was found.
bool Calculator::hasGVFS ( )

Checks if gvfs-copy available.

Returns
true if gvfs-copy was found.
bool Calculator::hasUnit ( Unit u)

Checks if a unit exists/is registered in the calculator.

bool Calculator::hasVariable ( Variable v)

Checks if a variable exists/is registered in the calculator.

int Calculator::loadDefinitions ( const char *  file_name,
bool  is_user_defs = true 
)

Load definitions from a file.

Parameters
file_nameThe path to the file to load.
is_user_defstrue if the definitions are local, false if they are global.
Returns
true if the definitions were successfully loaded.
bool Calculator::loadExchangeRates ( )

Load saved (local) currency units and exchange rates.

Returns
true if operation successful.
bool Calculator::loadGlobalCurrencies ( )

Load currencies.

Returns
true if the definitions were successfully loaded.
bool Calculator::loadGlobalDataSets ( )

Load data sets.

Returns
true if the definitions were successfully loaded.
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
filenameName of the file in the global data directory.
Returns
true if the definitions were successfully loaded.
bool Calculator::loadGlobalFunctions ( )

Load functions.

Returns
true if the definitions were successfully loaded.
bool Calculator::loadGlobalPrefixes ( )

Load prefixes.

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::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.
string Calculator::localizeExpression ( string  str) const

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

Parameters
strThe expression to localize.
Returns
A localized expression.
string Calculator::localToString ( ) const

Returns the translated text string used in expressions for converting to a specific unit expression (ex "5 meters to feet.

void Calculator::message ( MessageType  mtype,
const char *  TEMPLATE,
  ... 
)

Put a message in the message queue.

CalculatorMessage* Calculator::message ( )

Returns the first message in queue.

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
nameName.
objectObject to exclude from check.
Returns
true if the name is used.
CalculatorMessage* Calculator::nextMessage ( )

Removes the first message in queue and returns the next.

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

Parse an expression and place in a MathStructure object.

Parameters
strExpression
poParse options.
Returns
MathStructure with result of parse.
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
fMathematical function.
strArguments.
poParse options.
persistentIf false the values will be removed from storage when retrieved with getId().
Returns
Storage id.
void Calculator::prefixNameChanged ( Prefix p,
bool  new_item = false 
)

Used internally.

string Calculator::printMathStructureTimeOut ( const MathStructure mstruct,
int  msecs = 100000,
const PrintOptions op = default_print_options 
)

Calls MathStructure::format(po) and MathStructure::print(po). The process is aborted after msecs milliseconds.

void Calculator::reset ( )

Unloads all non-builtin variables, functions and units.

void Calculator::resetFunctions ( )

Unloads all non-builtin functions.

void Calculator::resetUnits ( )

Unloads all non-builtin units.

void Calculator::resetVariables ( )

Unloads all non-builtin variables.

void Calculator::restoreState ( )

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

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
mstructValue.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions 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
strExpression.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the result of the parsing of the expression.
[out]to_structNULL or a math structure to fill with unit expression parsed after "to".
make_to_divisionIf 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
mstructValue.
evalIf 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
strExpression.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the result of the parsing of the expression.
[out]to_structNULL or a math structure to fill with unit expression parsed after "to".
make_to_divisionIf true, the expression after "to" will be interpreted as a unit epxression to convert the result to.
bool Calculator::saveDefinitions ( )

Save local definitions to ~/.qalculate/definitions/

Returns
true if definitions was successfully saved.
void Calculator::saveState ( )

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

bool Calculator::separateToExpression ( string &  str,
string &  to_str,
const EvaluationOptions eo,
bool  keep_modifiers = false 
) const

Split an expression string after and before " to ".

Parameters
[out]strThe expression. Will be set to the string before " to ".
[out]to_strWill be set to the string after " to ".
eoOptions 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.
void Calculator::setDefaultAssumptions ( Assumptions ass)

Set assumptions for objects without own assumptions (unknown variables and symbols).

void Calculator::setLocale ( )

Sets argument separator and decimal sign from the current locale. Mainly for internal use.

void Calculator::setPrecision ( int  precision = DEFAULT_PRECISION)

Set default precision for approximate calculations.

Parameters
precisionPrecision.
void Calculator::startPrintControl ( int  milli_timeout = 0)

Called before formatting and printing a MathStructure (using MathStructure::format() and MathStructure::print()) or a Number (using Number::print) to be able to abort the process. Always use Calculator::abortPrint() after finishing.

Parameters
msecsThe maximum time for formatting printing in milliseconds. If msecs <= 0 the time will be unlimited.
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.

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::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.

void Calculator::stopPrintControl ( void  )

Always call this function after Calculator::startPrintControl() after formatting and printing has finished.

void Calculator::terminateThreads ( )

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

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

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

Parameters
strThe expression to unlocalize.
Returns
An unlocalized expression.
void Calculator::unsetLocale ( )

Resets argument separator and decimal sign. Mainly for internal use.

void Calculator::useDecimalPoint ( bool  comma_as_separator = false)

Use point as decimal separator. To use comma as an ignored separator in numbers, must be invoked with comma_as_separator = true, before using ParseOptions::comma_as_separator.

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.

The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/classBinaryPrefix.png0000644000175000017500000000066512757636735021210 00000000000000PNG  IHDRRP:ҢPLTEutRNST2DIDATx] )?6`KZaT :631 QRq1*<'/r;Bprgݦ:IENDB`libqalculate-0.9.10/docs/reference/html/classUnitArgument.png0000644000175000017500000000070612757636735021224 00000000000000PNG  IHDRWP[PLTEutRNST2UIDATxan ǃ ^VQYyjBg~#$WH2]DAnuu:u94q ## q3=L$53w$o^Wc"ܺz[7mx<|'\V$y=&3V7Ik\oIr}ORJ fu-"]^}]?l0\3\fg9Α>D6\k3A5\]e{\umMت~}E7Wc"\kAmyfҶ;ts 0kR~Пn [k"" EtIENDB`libqalculate-0.9.10/docs/reference/html/classAliasUnit-members.html0000644000175000017500000011506712757636735022312 00000000000000 libqalculate-0.9.8: 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)Unitvirtual
addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
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)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
b_si (defined in Unit)Unitprotected
b_use_with_prefixes (defined in Unit)Unitprotected
baseExponent(int exp=1) const (defined in AliasUnit)AliasUnitvirtual
baseUnit() const (defined in AliasUnit)AliasUnitvirtual
category() const ExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
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)AliasUnitvirtual
convertFromBaseUnit(MathStructure &mvalue) const (defined in AliasUnit)AliasUnitvirtual
convertFromBaseUnit() const (defined in AliasUnit)AliasUnitvirtual
convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnitvirtual
convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnitvirtual
convertToBaseUnit(MathStructure &mvalue) const (defined in AliasUnit)AliasUnitvirtual
convertToBaseUnit() const (defined in AliasUnit)AliasUnitvirtual
convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnitvirtual
copy() const (defined in AliasUnit)AliasUnitvirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() const ExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
expression() const (defined in AliasUnit)AliasUnitvirtual
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 ExpressionItemvirtual
firstBaseExponent() const (defined in AliasUnit)AliasUnitvirtual
firstBaseUnit() const (defined in AliasUnit)AliasUnitvirtual
getName(size_t index) const ExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() const ExpressionItemvirtual
hasComplexExpression() const (defined in AliasUnit)AliasUnitvirtual
hasComplexRelationTo(Unit *u) const (defined in AliasUnit)AliasUnitvirtual
hasName(const string &sname, bool case_sensitive=true) const ExpressionItemvirtual
hasNameCaseSensitive(const string &sname) const ExpressionItemvirtual
i_exp (defined in AliasUnit)AliasUnitprotected
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
inverseExpression() const (defined in AliasUnit)AliasUnitvirtual
isActive() const ExpressionItemvirtual
isApproximate() const ExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isChildOf(Unit *u) const AliasUnitvirtual
isCurrency() const Unit
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isParentOf(Unit *u) const AliasUnitvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
isSIUnit() const Unit
isUsedByOtherUnits() const (defined in Unit)Unitvirtual
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)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
o_unit (defined in AliasUnit)AliasUnitprotected
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)Unitvirtual
precision() const ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 Unitvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() const ExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in AliasUnit)AliasUnitvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setAsSIUnit()Unit
setBaseUnit(Unit *alias) (defined in AliasUnit)AliasUnitvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setExponent(int exp) (defined in AliasUnit)AliasUnitvirtual
setExpression(string relation)AliasUnitvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setInverseExpression(string inverse)AliasUnitvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setSystem(string s_system)Unit
setTitle(string title_)ExpressionItemvirtual
setUseWithPrefixesByDefault(bool use_with_prefixes)Unit
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)Unitvirtual
sinverse (defined in AliasUnit)AliasUnitprotected
ssystem (defined in Unit)Unitprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() const AliasUnitvirtual
svalue (defined in AliasUnit)AliasUnitprotected
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 ExpressionItemvirtual
type() const Unitvirtual
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)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
useWithPrefixesByDefault() const Unit
v_refs (defined in ExpressionItem)ExpressionItemprotected
~AliasUnit() (defined in AliasUnit)AliasUnitvirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~Unit() (defined in Unit)Unitvirtual
libqalculate-0.9.10/docs/reference/html/classBooleanArgument.html0000644000175000017500000006650412757636735022054 00000000000000 libqalculate-0.9.8: BooleanArgument Class Reference

A boolean argument. More...

#include <Function.h>

Inheritance diagram for BooleanArgument:
Argument

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
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Argument
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 boolean argument.

Accepts zero or one.

Member Function Documentation

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.

virtual string BooleanArgument::subprintlong ( ) const
protectedvirtual

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 bool BooleanArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int BooleanArgument::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:
libqalculate-0.9.10/docs/reference/html/functions_t.html0000644000175000017500000001725512757636735020276 00000000000000 libqalculate-0.9.8: Class Members libqalculate-0.9.10/docs/reference/html/classArgumentSet.png0000644000175000017500000000072412757636735021040 00000000000000PNG  IHDRTP$PLTEutRNST2cIDATxݒ 7aItoh !TU}PUUߜ:~* GIөgwڵ=eQ12O#p0vg9ѲJI.ooܘ?ݯכ}f߅!Z+VU}a_O OU7o!m/o_}G_(s fY(o $""A|Pߴ,Ϗ.3=U ZʞPqJ{rc D/ٮ[9 ?G$2{5CKtZ]h 7]ڋoa1Gj_˖5K]b\Uj>>߼8gJLIENDB`libqalculate-0.9.10/docs/reference/html/bc_s.png0000644000175000017500000000124412757636734016457 00000000000000PNG  IHDR_ kIDATxkQϝ̤I&m&156*nąܸR,4 +H(Ub1J.(EmߏhJmKS'C(х & r3g(z&_9}՟@mu ` h`ԯ &~M4%3?h)\Yi>Jb @giވkg\轭EUv+?E"pB\Y&$vM+Dn)}:Xo 3گ'.f0u9Ljf6%3Gf#sm(,k*ʒJJˢou_~ r]%%mnu]zr5[ưXeI||5?>|B"'IENDB`libqalculate-0.9.10/docs/reference/html/folderclosed.png0000644000175000017500000000115012757636735020213 00000000000000PNG  IHDR}\/IDATx]MO@~uؐlp]#]PYEC\9y`xC &=qvZv3m؃vLN}}ޝZA@n ONp xKxj8s _[D'yye+ 7#rNlk* 0Ь_d_(Öz=xvhzP-䍒̪u$\DJcB4.:Ϗ-}LE #gN;B6䬜@p&h>p9EEάʑ"un$R"?{<%PNt$߶+^<"2Dqq\ҙaA"ԵP}#Ez{.8i p(ADwDE߂z;Kק8t q:uvvݛvEn{MFXgfZ֝*ߩ:jYq#3SWr'  IENDB`libqalculate-0.9.10/docs/reference/html/classDataProperty-members.html0000644000175000017500000004055012757636735023031 00000000000000 libqalculate-0.9.8: 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)DataPropertyprotected
b_brackets (defined in DataProperty)DataPropertyprotected
b_case (defined in DataProperty)DataPropertyprotected
b_hide (defined in DataProperty)DataPropertyprotected
b_key (defined in DataProperty)DataPropertyprotected
b_uchanged (defined in DataProperty)DataPropertyprotected
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)DataPropertyprotected
name_is_ref (defined in DataProperty)DataPropertyprotected
nameIsReference(size_t index=1) const (defined in DataProperty)DataProperty
names (defined in DataProperty)DataPropertyprotected
parent (defined in DataProperty)DataPropertyprotected
parentSet() const (defined in DataProperty)DataProperty
propertyType() const (defined in DataProperty)DataProperty
ptype (defined in DataProperty)DataPropertyprotected
sdescr (defined in DataProperty)DataPropertyprotected
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)DataPropertyprotected
sunit (defined in DataProperty)DataPropertyprotected
title(bool return_name_if_no_title=true) const (defined in DataProperty)DataProperty
usesBrackets() const (defined in DataProperty)DataProperty
libqalculate-0.9.10/docs/reference/html/Number_8h.html0000644000175000017500000001040012757636735017553 00000000000000 libqalculate-0.9.8: libqalculate/Number.h File Reference
Number.h File Reference
#include <libqalculate/includes.h>
#include <cln/cln.h>

Classes

class  Number
 A number. More...
 

Macros

#define EQUALS_PRECISION_DEFAULT   -1
 
#define EQUALS_PRECISION_LOWEST   -2
 
#define EQUALS_PRECISION_HIGHEST   -3
 
libqalculate-0.9.10/docs/reference/html/functions_func_k.html0000644000175000017500000001023012757636735021262 00000000000000 libqalculate-0.9.8: Class Members - Functions
 

- k -

libqalculate-0.9.10/docs/reference/html/folderopen.png0000644000175000017500000000112512757636735017705 00000000000000PNG  IHDR}\IDATx]?oP9i4i;iiZ7`b٬,HU'$*T]TDP6w};C; aӝߟjAInS}9Hӎ|? =_Ɗue*;YEsYBėsٌ ɫYq !Gǿv̇خ F}qb]70)d-}PfY{4@}2ԗNIǃc%UImcƝ>xt9$ OVE*Û#׈r@l$PrHaa dZrqIoT\,tj2FAxv-Lp׌p TI/ \sf; jViTo^cpb]€<a՜y9:+,E f6NEKU}^;nZuUS4 ѬbN.kjT% iV )GJ@TxIENDB`libqalculate-0.9.10/docs/reference/html/classDecimalPrefix.html0000644000175000017500000005161412757636735021502 00000000000000 libqalculate-0.9.8: DecimalPrefix Class Reference

A decimal (metric) prefix. More...

#include <Prefix.h>

Inheritance diagram for DecimalPrefix:
Prefix

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
 
- Public Member Functions inherited from Prefix
 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
 

Protected Attributes

int exp
 
- Protected Attributes inherited from Prefix
string l_name
 
string s_name
 
string u_name
 

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
exp10Exponent for the value.
long_nameLong name.
short_nameShort name.
unicode_nameUnicode name.

Member Function Documentation

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

Returns the exponent.

Parameters
iexpExponent of the unit.
Returns
The exponent of the prefix.
Number DecimalPrefix::exponent ( const Number nexp) const

Returns the exponent.

Parameters
nexpExponent of the unit.
Returns
The exponent of the prefix.
void DecimalPrefix::setExponent ( int  iexp)

Sets the exponent of the prefix.

Parameters
iexpNew exponent for the 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.

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

Returns the value of the prefix.

Parameters
nexpThe 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
iexpThe 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.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/functions_func_t.html0000644000175000017500000001620112757636735021277 00000000000000 libqalculate-0.9.8: Class Members - Functions libqalculate-0.9.10/docs/reference/html/doc.png0000644000175000017500000000135212757636735016317 00000000000000PNG  IHDR}\IDATxMOS[sa?-XZ(PD4 AWbu`b 77wHFCԁ/`voAPqP@ 980 +y^Z9SW\83g3'Nçl_bpV"ֆXd]3xM[1W *PGz/Eg{ aoV:这1$RW,@56-,m/蹖 r5T*S(Vf89u գwa=<{ҡUr+dDF$`zNܮ0Q3~_^N=vpTLT}kqm<?ZhX_ݥ[) `ga_*2`'=F2EP l=8Wv%THqɿ<"GxH{#֫aJmKsVءM^ T ݛr߽m_?Wİ#uIENDB`libqalculate-0.9.10/docs/reference/html/files.html0000644000175000017500000001213412757636735017034 00000000000000 libqalculate-0.9.8: File List
File List
Here is a list of all documented files with brief descriptions:
libqalculate-0.9.10/docs/reference/html/classSymbolicArgument.png0000644000175000017500000000103312757636735022060 00000000000000PNG  IHDRuP PLTEutRNST2IDATx钃 #o%ݪ^06#_^.fX%'${к?>\?c׫גk2akИ2IZubj&m$i=_|ϚVV9ai5UTDٕjLHV9s6=4$rZrε}HR#I=1_ IsC{)A{jxX2=V +@O' Гaɰqι\̰nk(-{ޙSN54 Y?ZEkjCF)EPhrgZGW1S| |5q!a<)A_(g| Ykٚ+pǬXV%[owY 5g5UTDiBoйt`|'*KГ:qۯIENDB`libqalculate-0.9.10/docs/reference/html/classMatrixArgument.html0000644000175000017500000007065312757636735021741 00000000000000 libqalculate-0.9.8: MatrixArgument Class Reference

A matrix argument. More...

#include <Function.h>

Inheritance diagram for MatrixArgument:
Argument

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
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Protected Attributes

bool b_square
 
- Protected Attributes inherited from Argument
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 matrix argument.

Member Function Documentation

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.

virtual string MatrixArgument::subprintlong ( ) const
protectedvirtual

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 bool MatrixArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int MatrixArgument::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:
libqalculate-0.9.10/docs/reference/html/classKnownVariable-members.html0000644000175000017500000010344112757636735023154 00000000000000 libqalculate-0.9.8: 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)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_expression (defined in KnownVariable)KnownVariableprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculated_precision (defined in KnownVariable)KnownVariableprotected
category() const ExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const (defined in KnownVariable)KnownVariablevirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() const ExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
expression() const KnownVariablevirtual
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 ExpressionItemvirtual
get()KnownVariablevirtual
getName(size_t index) const ExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() const ExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) const ExpressionItemvirtual
hasNameCaseSensitive(const string &sname) const ExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() const ExpressionItemvirtual
isApproximate() const ExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isExpression() const KnownVariablevirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() const KnownVariableinlinevirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
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)KnownVariableprotected
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)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
precision() const ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() const ExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in KnownVariable)KnownVariablevirtual
representsComplex(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsEven(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsInteger(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNegative(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonMatrix() (defined in KnownVariable)KnownVariablevirtual
representsNonNegative(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonPositive(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonZero(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNumber(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsOdd(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsPositive(bool=false)KnownVariablevirtual
representsRational(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsReal(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in KnownVariable)KnownVariablevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in KnownVariable)KnownVariablevirtual
set(const MathStructure &o)KnownVariablevirtual
set(string expression_)KnownVariablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
sexpression (defined in KnownVariable)KnownVariableprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() const KnownVariableinlinevirtual
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 ExpressionItemvirtual
type() const Variableinlinevirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
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)ExpressionItemvirtual
~KnownVariable() (defined in KnownVariable)KnownVariablevirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-0.9.10/docs/reference/html/classDataPropertyArgument.html0000644000175000017500000007131512757636735023107 00000000000000 libqalculate-0.9.8: DataPropertyArgument Class Reference

Data property function argument. More...

#include <DataSet.h>

Inheritance diagram for DataPropertyArgument:
Argument

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)
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 

Protected Member Functions

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

Protected Attributes

DataSeto_data
 
- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 

Detailed Description

Data property function argument.

Member Function Documentation

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.

virtual string DataPropertyArgument::subprintlong ( ) const
protectedvirtual

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 bool DataPropertyArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

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.


The documentation for this class was generated from the following file:
libqalculate-0.9.10/docs/reference/html/classDataObjectArgument-members.html0000644000175000017500000003350512757636735024120 00000000000000 libqalculate-0.9.8: 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)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const DataObjectArgumentvirtual
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)DataObjectArgumentprotected
parse(const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const DataObjectArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subprintlong() const DataObjectArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const DataObjectArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const DataObjectArgumentvirtual
zeroForbidden() const Argument
~Argument()Argumentvirtual
~DataObjectArgument() (defined in DataObjectArgument)DataObjectArgument
libqalculate-0.9.10/docs/reference/html/classVectorArgument-members.html0000644000175000017500000003613712757636735023366 00000000000000 libqalculate-0.9.8: 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)VectorArgumentprotected
b_error (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() const VectorArgumentvirtual
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 Argumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const Argumentvirtual
print() const VectorArgumentvirtual
printlong() const Argument
rationalPolynomial() const Argument
reoccuringArguments() const (defined in VectorArgument)VectorArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
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)Argumentprotected
subargs (defined in VectorArgument)VectorArgumentprotected
subprintlong() const VectorArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) const VectorArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const Argument
tests() const Argument
type() const VectorArgumentvirtual
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()Argumentvirtual
~VectorArgument() (defined in VectorArgument)VectorArgumentvirtual
libqalculate-0.9.10/docs/reference/html/classCompositeUnit-members.html0000644000175000017500000011343612757636735023221 00000000000000 libqalculate-0.9.8: 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)Unitvirtual
add(Unit *u, int exp=1, Prefix *prefix=NULL)CompositeUnitvirtual
addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
b_si (defined in Unit)Unitprotected
b_use_with_prefixes (defined in Unit)Unitprotected
baseExponent(int exp=1) const (defined in Unit)Unitvirtual
baseUnit() const (defined in Unit)Unitvirtual
category() const ExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clear()CompositeUnitvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
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 CompositeUnitvirtual
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)Unitvirtual
convertFromBaseUnit(MathStructure &mvalue) const (defined in Unit)Unitvirtual
convertFromBaseUnit() const (defined in Unit)Unitvirtual
convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in Unit)Unitvirtual
convertToBaseUnit(MathStructure &mvalue) const (defined in Unit)Unitvirtual
convertToBaseUnit() const (defined in Unit)Unitvirtual
copy() const (defined in CompositeUnit)CompositeUnitvirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
countUnits() const CompositeUnitvirtual
del(size_t index) (defined in CompositeUnit)CompositeUnitvirtual
description() const ExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
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)CompositeUnitvirtual
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 ExpressionItemvirtual
generateMathStructure(bool make_division=false, bool set_null_prefixes=false) const CompositeUnitvirtual
get(size_t index, int *exp=NULL, Prefix **prefix=NULL) const CompositeUnitvirtual
getName(size_t index) const ExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() const ExpressionItemvirtual
hasComplexRelationTo(Unit *u) const (defined in Unit)Unitvirtual
hasName(const string &sname, bool case_sensitive=true) const ExpressionItemvirtual
hasNameCaseSensitive(const string &sname) const ExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() const ExpressionItemvirtual
isApproximate() const ExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isChildOf(Unit *u) const Unitvirtual
isCurrency() const Unit
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isParentOf(Unit *u) const Unitvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
isSIUnit() const Unit
isUsedByOtherUnits() const (defined in Unit)Unitvirtual
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)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
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)Unitvirtual
precision() const ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 ExpressionItemvirtual
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 CompositeUnitvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() const ExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in CompositeUnit)CompositeUnitvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setAsSIUnit()Unit
setBaseExpression(string base_expression_) (defined in CompositeUnit)CompositeUnitvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setExponent(size_t index, int exp) (defined in CompositeUnit)CompositeUnitvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setPrefix(size_t index, Prefix *prefix) (defined in CompositeUnit)CompositeUnitvirtual
setRegistered(bool is_registered)ExpressionItem
setSystem(string s_system)Unit
setTitle(string title_)ExpressionItemvirtual
setUseWithPrefixesByDefault(bool use_with_prefixes)Unit
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)Unitvirtual
sshort (defined in CompositeUnit)CompositeUnitprotected
ssystem (defined in Unit)Unitprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() const CompositeUnitvirtual
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 ExpressionItemvirtual
type() const Unitvirtual
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)CompositeUnitprotected
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
useWithPrefixesByDefault() const Unit
v_refs (defined in ExpressionItem)ExpressionItemprotected
~CompositeUnit() (defined in CompositeUnit)CompositeUnitvirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~Unit() (defined in Unit)Unitvirtual
libqalculate-0.9.10/docs/reference/html/classAngleArgument.html0000644000175000017500000007142312757636735021517 00000000000000 libqalculate-0.9.8: AngleArgument Class Reference
Inheritance diagram for AngleArgument:
Argument

Public Member Functions

 AngleArgument (string name_="", bool does_test=true, bool does_error=true)
 
 AngleArgument (const AngleArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
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
 
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
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 

Member Function Documentation

virtual Argument* AngleArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

virtual void AngleArgument::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
mstructMathematical structure to set with the parsed expression.
strExpression.
poParse options.

Reimplemented from Argument.

virtual string AngleArgument::print ( ) const
virtual

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

Returns
Short description.

Reimplemented from Argument.

virtual string AngleArgument::subprintlong ( ) const
protectedvirtual

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 bool AngleArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

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

Parameters
valueValue to test.
eoEvaluation 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 int AngleArgument::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:
libqalculate-0.9.10/docs/Makefile.in0000644000175000017500000004656112757636731014216 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 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_CLAGS = @CLN_CLAGS@ 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@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ 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_build_prefix = @top_build_prefix@ 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/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 $(am__aclocal_m4_deps): 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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; \ ($(am__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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ 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 || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: 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: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am 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-am uninstall uninstall-am .PRECIOUS: Makefile # 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.10/docs/Makefile.am0000644000175000017500000000007212705146643014157 00000000000000# # docs/Makefile.am for qalculate # SUBDIRS = reference libqalculate-0.9.10/libqalculate/0000755000175000017500000000000012757636737013735 500000000000000libqalculate-0.9.10/libqalculate/Prefix.cc0000644000175000017500000001040612706146341015377 00000000000000/* Qalculate (library) Copyright (C) 2003-2006, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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.10/libqalculate/support.h0000644000175000017500000000120712715271142015515 00000000000000#ifndef SUPPORT_H #define SUPPORT_H #ifdef HAVE_CONFIG_H # include #endif /* * Standard gettext macros. */ #ifdef ENABLE_NLS # include # undef _ # define _(String) dgettext (GETTEXT_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.10/libqalculate/ExpressionItem.h0000644000175000017500000003363012706146173016771 00000000000000/* Qalculate Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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.10/libqalculate/Calculator.h0000644000175000017500000014335312744162777016122 00000000000000/* Qalculate Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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 expression, * 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.9 * ]) * 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 class Calculate_p; /// 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; class Calculator_p *priv; 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; 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; time_t exchange_rates_time, exchange_rates_check_time; bool b_exchange_rates_used, b_exchange_rates_warning_enabled; int has_gvfs; bool b_gnuplot_open; string gnuplot_cmdline; FILE *gnuplot_pipe, *calculate_pipe_r, *calculate_pipe_w; bool local_to; Assumptions *default_assumptions; vector deleted_variables; vector deleted_functions; vector deleted_units; bool b_save_called; int i_print_timeout; struct timeval t_print_end; int i_printing_aborted; bool b_printing_controlled; 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, *u_kelvin, *u_celsius, *u_fahrenheit; 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; string expression_to_calculate; 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". If expression does not contain a "to" string, and to_struct is a unit or a symbol (a unit expression string), to_struct will be used instead. * @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". If expression does not contain a "to" string, and to_struct is a unit or a symbol (a unit expression string), to_struct will be used instead. * @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); int testCondition(string expression); //@} /** @name Functions for printing expressions with the option to set a timeout or abort. */ //@{ /** Calls MathStructure::format(po) and MathStructure::print(po). The process is aborted after msecs milliseconds. */ string printMathStructureTimeOut(const MathStructure &mstruct, int msecs = 100000, const PrintOptions &op = default_print_options); /** Called before formatting and printing a MathStructure (using MathStructure::format() and MathStructure::print()) * or a Number (using Number::print) to be able to abort the process. Always use Calculator::abortPrint() after finishing. * * @param msecs The maximum time for formatting printing in milliseconds. If msecs <= 0 the time will be unlimited. */ void startPrintControl(int milli_timeout = 0); /** Abort formatting and printing (after startPrintControl() has been called). * This function will normally be called from a thread that checks for used input or other conditions. */ void abortPrint(void); /** Always call this function after Calculator::startPrintControl() after formatting and printing has finished. */ void stopPrintControl(void); bool printingAborted(void); bool printingControlled(void); string printingAbortedMessage(void) const; string timedOutString(void) const; //@} /** @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, bool keep_modifiers = false) const; bool hasToExpression(const string &str) 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 convertTimeOut(string str, Unit *from_unit, Unit *to_unit, int msecs, 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); //@} /** Used by the UI to find unit category for a mathematical expression.*/ Unit *findMatchingUnit(const MathStructure &mstruct); /** @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); string temporaryCategory(void) const; 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 gvfs-copy or wget is available for downloading exchange rates from the Internet. * * @returns true if gvfs-copy or wget was found. */ bool canFetch(); /** Checks if gvfs-copy available. * * @returns true if gvfs-copy was found. */ bool hasGVFS(); /** Checks if gvfs-copy available. Deprecated: use hasGVFS() or canFetch() instead. * * * @returns true if gvfs-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(); /** Modification time of the exchange rates file. * * @returns Returns exchange rates modification time. */ time_t getExchangeRatesTime(); /** 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); /** Check age of exchange rates on local disc. * * @param n_days How old in days exchange rates may be before exchange rates need updating * @param force_check If exchange rates date should be checked again even if found outdated within n_days before * @param send_warning If the standard exchange rates warning should be sent. * @returns false if exchange.rates need updating */ bool checkExchangeRatesDate(unsigned int n_days = 7, bool force_check = false, bool send_warning = false); /// Enable or disable old exchange rates warning (initial state is true). void setExchangeRatesWarningEnabled(bool enable); bool exchangeRatesWarningEnabled() const; /// Check if exchange rates has been used since resetExchangeRatesUsed() was last called bool exchangeRatesUsed() const; void resetExchangeRatesUsed(); /// For internal use, called by currency units void setExchangeRatesUsed(); //@} /** @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(); /** Use point as decimal separator. * To use comma as an ignored separator in numbers, must be invoked with comma_as_separator = true, before using ParseOptions::comma_as_separator. */ void useDecimalPoint(bool comma_as_separator = false); /** 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.10/libqalculate/Makefile.in0000644000175000017500000006127512757636731015727 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(libqalculateinclude_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libqalculateincludedir)" 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) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libqalculate_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libqalculate_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libqalculate_la_SOURCES) DIST_SOURCES = $(libqalculate_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(libqalculateinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 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_CLAGS = @CLN_CLAGS@ 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@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ 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_build_prefix = @top_build_prefix@ 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@ AM_CPPFLAGS = \ -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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libqalculate/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libqalculate/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 $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libqalculate.la: $(libqalculate_la_OBJECTS) $(libqalculate_la_DEPENDENCIES) $(EXTRA_libqalculate_la_DEPENDENCIES) $(AM_V_CXXLD)$(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@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libqalculateincludeHEADERS: $(libqalculateinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(libqalculateinclude_HEADERS)'; test -n "$(libqalculateincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libqalculateincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libqalculateincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libqalculateincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libqalculateincludedir)" || exit $$?; \ done uninstall-libqalculateincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(libqalculateinclude_HEADERS)'; test -n "$(libqalculateincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libqalculateincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 html-am: info: info-am info-am: install-data-am: install-libqalculateincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am 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 tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-libqalculateincludeHEADERS .PRECIOUS: Makefile # 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.10/libqalculate/BuiltinFunctions.cc0000644000175000017500000041677012735461237017465 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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 #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(93555); 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, bool) const {return vargs.size() > 0 && vargs[0].isNumber() && vargs[0].number().isPositive();} bool RandFunction::representsNonNegative(const MathStructure&, bool) 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(); s2date(vargs[0].symbol(), gtime); 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(); s2date(vargs[0].symbol(), gtime); 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(); s2date(str, gtime); 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()))); if(i > std::numeric_limits::max()) { return 0; } else if(i < std::numeric_limits::min()) { return 0; } GDate *gtime = g_date_new(); g_date_set_time_t(gtime, cln::cl_I_to_long(i)); 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 = new UserFunction("", "Generated MathFunction", vargs[0].symbol()); MathStructure args = vargs[1]; mstruct = f.MathFunction::calculate(args, eo); if(mstruct.isFunction() && mstruct.function() == &f) mstruct.setUndefined(); 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) { CALCULATOR->error(false, _("The %s function is incomplete, unreliable and unstable. Use at your own risk and avoid complex expressions."), preferredDisplayName().name.c_str(), NULL); 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; CALCULATOR->error(false, _("Unable to integrate the expression."), NULL); return -1; } } if(!vargs[2].isUndefined() && vargs[2] != CALCULATOR->v_undef) { if(!vargs[3].isUndefined() && vargs[3] != CALCULATOR->v_undef) { CALCULATOR->error(true, _("Both the lower and upper limit must be set to get the definite integral."), NULL); mstruct = vargs[0]; return -1; } if(mstruct.containsFunction(this, false, true, true) > 0) { CALCULATOR->error(false, _("Unable to integrate the expression."), NULL); mstruct = vargs[0]; return -1; } 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 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.10/libqalculate/util.h0000644000175000017500000000617512734741163014775 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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 s2date(string str, void *gtime); 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 getOldLocalDir(); string getLocalDir(); string getLocalDataDir(); string getLocalTmpDir(); bool move_file(const char *from_file, const char *to_file); #endif libqalculate-0.9.10/libqalculate/Number.cc0000644000175000017500000030253312724060562015377 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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 format_number_string(string cl_str, int base, BaseDisplay base_display, bool show_neg, bool format_base_two = true) { if(format_base_two && 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(show_neg) { 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; } string printCL_I(cl_I integ, int base = 10, bool display_sign = true, BaseDisplay base_display = BASE_DISPLAY_NORMAL, bool lower_case = false) { bool is_neg = minusp(integ); if(is_neg) { integ = -integ; } if(base == BASE_ROMAN_NUMERALS) { if(!zerop(integ) && integ < 10000) { string str; int value = 0; try { value = cl_I_to_int(integ); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } if(is_neg) { 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; } string cl_str; cl_print_flags flags; flags.rational_base = base; if(integ > LLONG_MAX) { int i_step = 1000; if(base < 8) i_step = 100; cl_I i_div = cln::expt_pos(cl_I(base), cl_I(i_step)); string str, stream_str; cl_I_div_t i_remdiv; while(true) { ostringstream stream; try { i_remdiv = cln::floor2(integ, i_div); if(!zerop(i_remdiv.remainder)) { cln::print_integer(stream, flags, i_remdiv.remainder); } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } integ = i_remdiv.quotient; if(cln::zerop(integ)) { cl_str = stream.str() + cl_str; break; } else { str = ""; stream_str = stream.str(); str.resize((size_t) i_step - stream_str.length(), '0'); str += stream_str; cl_str = str + cl_str; } if(CALCULATOR->printingAborted()) { return CALCULATOR->printingAbortedMessage(); } } } else { ostringstream stream; try { cln::print_integer(stream, flags, integ); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } 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(cl_str[cl_str.length() - 1] == '.') { cl_str.erase(cl_str.length() - 1, 1); } return format_number_string(cl_str, base, base_display, is_neg && display_sign); } 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++; } try { 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); } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } 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 { size_t index_colon = index; Number divisor(1, 1); Number num_temp; value = 0; i_precision = -1; index = 0; while(index_colon < number.size()) { num_temp.set(number.substr(index, index_colon - index), po); if(!num_temp.isZero()) { num_temp.divide(divisor); add(num_temp); } index = index_colon + 1; index_colon = number.find(":", index); divisor.multiply(Number(60, 1)); } num_temp.set(number.substr(index), po); if(!num_temp.isZero()) { num_temp.divide(divisor); add(num_temp); } return; /*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; try { i = cln::round1(cln::realpart(value)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } 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; try { value = cln::logand(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } setPrecisionAndApproximateFrom(o); return true; } bool Number::bitOr(const Number &o) { if(!o.isInteger() || !isInteger()) return false; try { value = cln::logior(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } setPrecisionAndApproximateFrom(o); return true; } bool Number::bitXor(const Number &o) { if(!o.isInteger() || !isInteger()) return false; try { value = cln::logxor(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } setPrecisionAndApproximateFrom(o); return true; } bool Number::bitNot() { if(!isInteger()) return false; try { value = cln::lognot(cln::numerator(cln::rational(cln::realpart(value)))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } return true; } bool Number::bitEqv(const Number &o) { if(!o.isInteger() || !isInteger()) return false; try { value = cln::logeqv(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } setPrecisionAndApproximateFrom(o); return true; } bool Number::shiftLeft(const Number &o) { if(!o.isInteger() || !isInteger() || o.isNegative()) return false; cln::cl_I intval; try { intval = cln::numerator(cln::rational(cln::realpart(value))); intval << cln::numerator(cln::rational(cln::realpart(o.internalNumber()))); value = intval; } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } setPrecisionAndApproximateFrom(o); return true; } bool Number::shiftRight(const Number &o) { if(!o.isInteger() || !isInteger() || o.isNegative()) return false; cln::cl_I intval; try { intval = cln::numerator(cln::rational(cln::realpart(value))); intval >> cln::numerator(cln::rational(cln::realpart(o.internalNumber()))); value = intval; } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } setPrecisionAndApproximateFrom(o); return true; } bool Number::shift(const Number &o) { if(!o.isInteger() || !isInteger()) return false; try { value = cln::ash(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } setPrecisionAndApproximateFrom(o); return true; } bool Number::hasRealPart() const { if(isInfinite()) return true; bool b = false; try { b = !cln::zerop(cln::realpart(value)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } return b; } bool Number::hasImaginaryPart() const { if(isInfinite()) return false; bool b = false; try { b = !cln::zerop(cln::imagpart(value)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } return b; } 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()) { bool b = false; try { if(PRECISION < cln::float_format_lfloat_min) { b = cln::zerop(cln::truncate2(MIN_PRECISION_FLOAT_RE(value)).remainder); } else { b = cln::zerop(cln::truncate2(REAL_PRECISION_FLOAT_RE(value)).remainder); } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } if(b) { cln::cl_N new_value; try { new_value = cln::round1(cln::realpart(value)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return; } value = new_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 hasImaginaryPart(); } 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; bool b = false; try { b = cln::zerop(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } return b; } 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; bool b = false; try { b = cln::zerop(cln::realpart(value)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } return b && cln::imagpart(value) == 1; } bool Number::isMinusOne() const { if(isInfinite()) return false; return value == -1; } bool Number::isMinusI() const { if(isInfinite()) return false; bool b = false; try { b = cln::zerop(cln::realpart(value)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } return b && 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()) { bool b_zero = false; try { if(PRECISION < cln::float_format_lfloat_min) { b_zero = MIN_PRECISION_FLOAT_RE(value + 1) == cln::cl_float(1, cln::float_format(cln::float_format_lfloat_min + 1)); } else { b_zero = REAL_PRECISION_FLOAT_RE(value + 1) == cln::cl_float(1, cln::float_format(PRECISION + 1)); } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } return b_zero; } 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; }*/ try { 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; } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } 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; } } cln::cl_N new_value; try { new_value = value + o.internalNumber(); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; 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; } } cln::cl_N new_value; try { new_value = value - o.internalNumber(); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; 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; } cln::cl_N new_value; try { new_value = value * o.internalNumber(); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; 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; } cln::cl_N new_value; try { new_value = value / o.internalNumber(); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; removeFloatZeroPart(); setPrecisionAndApproximateFrom(o); return true; } bool Number::recip() { if(isZero()) { //division by zero!!! //setInfinity(); //return true; return false; } if(isInfinite()) { clear(); return true; } cln::cl_N new_value; try { new_value = cln::recip(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_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; } else if(o.isComplex()) { CALCULATOR->error(false, _("The result of 0^i is possibly undefined"), NULL); } else { return true; } } cln::cl_N new_value = value; bool neg = false; if(isNegative() && !o.isComplex() && !o.isApproximateType() && !o.numeratorIsEven() && !o.denominatorIsEven()) { neg = true; new_value = cln::abs(new_value); } cln::cl_RA dmax = 1; dmax = dmax / 10; if(o.isRational() && isRational() && (!try_exact || (cln::abs(new_value) <= 1 + dmax && cln::abs(new_value) >= 1 - dmax)) && new_value != 1 && new_value != -1 && (cln::numerator(cln::rational(cln::realpart(o.internalNumber()))) > 10000 || cln::numerator(cln::rational(cln::realpart(o.internalNumber()))) < -10000)) { try { new_value = cln::expt(cln::cl_float(cln::realpart(new_value)), cln::cl_float(cln::realpart(o.internalNumber()))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } } else { try { new_value = cln::expt(new_value, o.internalNumber()); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } } if(neg) { try { new_value = -new_value; } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } } value = new_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; } cln::cl_N new_value; try { new_value = cln::square(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; return true; } bool Number::negate() { if(isInfinite()) { b_pinf = !b_pinf; b_minf = !b_minf; return true; } cln::cl_N new_value; try { new_value = -value; } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_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;} try { value = cln::complex(-cln::realpart(value), cln::imagpart(value)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } } } 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; cln::cl_N new_value; try { new_value = cln::round1(cln::realpart(value)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; if(b_approx) { if(isInteger()) { bool b_zero = false; try { b_zero = cln::zerop(cln::rem(cln::realpart(value), 10)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } if(!b_zero) { i_precision = -1; b_approx = false; } } else { i_precision = -1; b_approx = false; } } return true; } bool Number::floor() { if(isInfinite() || isComplex()) return false; //if(b_approx && !isInteger()) b_approx = false; cln::cl_N new_value; try { new_value = cln::floor1(cln::realpart(value)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; return true; } bool Number::ceil() { if(isInfinite() || isComplex()) return false; //if(b_approx && !isInteger()) b_approx = false; cln::cl_N new_value; try { new_value = cln::ceiling1(cln::realpart(value)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; return true; } bool Number::trunc() { if(isInfinite() || isComplex()) return false; //if(b_approx && !isInteger()) b_approx = false; cln::cl_N new_value; try { new_value = cln::truncate1(cln::realpart(value)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_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; cln::cl_N new_value; try { new_value = cln::round1(cln::realpart(value), cln::realpart(o.internalNumber())); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; 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; cln::cl_N new_value; try { new_value = cln::floor1(cln::realpart(value), cln::realpart(o.internalNumber())); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; 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; cln::cl_N new_value; try { new_value = cln::ceiling1(cln::realpart(value), cln::realpart(o.internalNumber())); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; 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; cln::cl_N new_value; try { new_value = cln::truncate1(cln::realpart(value), cln::realpart(o.internalNumber())); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; setPrecisionAndApproximateFrom(o); return true; } bool Number::mod(const Number &o) { if(isInfinite() || o.isInfinite()) return false; if(isComplex() || o.isComplex()) return false; cln::cl_N new_value; try { new_value = cln::mod(cln::realpart(value), cln::realpart(o.internalNumber())); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; setPrecisionAndApproximateFrom(o); return true; } bool Number::frac() { if(isInfinite() || isComplex()) return false; cln::cl_N new_value; try { cl_N whole_value = cln::truncate1(cln::realpart(value)); new_value = value - whole_value; } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; return true; } bool Number::rem(const Number &o) { if(isInfinite() || o.isInfinite()) return false; if(isComplex() || o.isComplex()) return false; cln::cl_N new_value; try { new_value = cln::rem(cln::realpart(value), cln::realpart(o.internalNumber())); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; setPrecisionAndApproximateFrom(o); return true; } bool Number::smod(const Number &o) { if(!isInteger() || !o.isInteger()) return false; cln::cl_N new_value; try { const cln::cl_I b2 = cln::ceiling1(cln::numerator(cln::rational(cln::realpart(o.internalNumber()))) >> 1) - 1; new_value = cln::mod(cln::numerator(cln::rational(cln::realpart(value))) + b2, cln::numerator(cln::rational(cln::realpart(o.internalNumber())))) - b2; } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; setPrecisionAndApproximateFrom(o); return true; } bool Number::irem(const Number &o) { if(o.isZero()) return false; if(!isInteger() || !o.isInteger()) return false; cln::cl_N new_value; try { new_value = cln::rem(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; return true; } bool Number::irem(const Number &o, Number &q) { if(o.isZero()) return false; if(!isInteger() || !o.isInteger()) return false; try { 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; } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } return true; } bool Number::iquo(const Number &o) { if(o.isZero()) return false; if(!isInteger() || !o.isInteger()) return false; cln::cl_N new_value; try { new_value = cln::truncate1(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; return true; } bool Number::iquo(const Number &o, Number &r) { if(o.isZero()) return false; if(!isInteger() || !o.isInteger()) return false; try { 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; } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } return true; } bool Number::isqrt() { if(isInteger()) { cln::cl_N new_value; try { cln::cl_I iroot; cln::isqrt(cln::numerator(cln::rational(cln::realpart(value))), &iroot); new_value = iroot; } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; 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; } cln::cl_N new_value; try { new_value = cln::zeta(i); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; return true; } bool Number::sin() { if(isInfinite()) return false; if(isZero()) return true; cln::cl_N new_value; try { new_value = cln::sin(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::asin() { if(isInfinite()) return false; if(isZero()) return true; cln::cl_N new_value; try { new_value = cln::asin(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::sinh() { if(isInfinite()) return true; if(isZero()) return true; cln::cl_N new_value; try { new_value = cln::sinh(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::asinh() { if(isInfinite()) return true; if(isZero()) return true; cln::cl_N new_value; try { new_value = cln::asinh(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::cos() { if(isInfinite()) return false; if(isZero() && !isApproximate()) { set(1); return true; } cln::cl_N new_value; try { new_value = cln::cos(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::acos() { if(isInfinite()) return false; if(isOne() && !isApproximate()) { clear(); return true; } cln::cl_N new_value; try { new_value = cln::acos(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::cosh() { if(isInfinite()) { //setInfinity(); //return true; return false; } if(isZero() && !isApproximate()) { set(1); return true; } cln::cl_N new_value; try { new_value = cln::cosh(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::acosh() { if(isPlusInfinity() || isInfinity()) return true; if(isMinusInfinity()) return false; cln::cl_N new_value; try { new_value = cln::acosh(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; removeFloatZeroPart(); testApproximate(); testInteger(); return true; } bool Number::tan() { if(isInfinite()) return false; if(isZero()) return true; cln::cl_N new_value; try { new_value = cln::tan(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_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; } cln::cl_N new_value; try { new_value = cln::atan(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_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; cln::cl_N new_value; try { new_value = cln::tanh(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_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; } cln::cl_N new_value; try { new_value = cln::atanh(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_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; } cln::cl_N new_value; try { new_value = cln::log(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_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; } cln::cl_N new_value; if(!isApproximate() && !o.isApproximate() && isFraction()) { try { new_value = -cln::log(cln::recip(value), o.internalNumber()); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } } else { try { new_value = cln::log(value, o.internalNumber()); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } } value = new_value; removeFloatZeroPart(); setPrecisionAndApproximateFrom(o); testApproximate(); testInteger(); return true; } bool Number::exp() { if(isInfinity()) return false; if(isPlusInfinity()) return true; if(isMinusInfinity()) { clear(); return true; } cln::cl_N new_value; try { new_value = cln::exp(value); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_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) { try { w = cln::ln(x) - cln::ln(cln::ln(x)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } } cln::cl_RA wPrec; try { wPrec = cln::expt(cln::cl_I(10), -(PRECISION + 2)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } cln::cl_N new_value = value; while(true) { try { cln::cl_R wTimesExpW = w * cln::exp(w); cln::cl_R wPlusOneTimesExpW = (w + 1) * cln::exp(w); if(wPrec > cln::abs((x - wTimesExpW) / wPlusOneTimesExpW)) { new_value = w; break; } w = w - (wTimesExpW - x) / (wPlusOneTimesExpW - (w + 2) * (wTimesExpW - x) / (2 * w + 2)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } } value = new_value; 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; } cln::cl_N new_value; try { cl_I num = cln::numerator(cln::rational(cln::realpart(value))); cl_I num_o = cln::numerator(cln::rational(cln::realpart(o.internalNumber()))); new_value = cln::gcd(num, num_o); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; setPrecisionAndApproximateFrom(o); return true; } bool Number::lcm(const Number &o) { if(isInteger() && o.isInteger()) { cln::cl_N new_value; try { new_value = cln::lcm(cln::numerator(cln::rational(cln::realpart(value))), cln::numerator(cln::rational(cln::realpart(o.internalNumber())))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; 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_N new_value = value; try { cln::cl_I i = cln::numerator(cln::rational(cln::realpart(new_value))); i = cln::minus1(i); for(; !cln::zerop(i); i = cln::minus1(i)) { new_value = new_value * i; } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; 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_N new_value = value; try { cln::cl_I i = cln::numerator(cln::rational(cln::realpart(new_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) { new_value = new_value * i; } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; 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_N new_value = value; try { 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) { new_value = new_value * i; } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } value = new_value; 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 { cln::cl_N new_value; cl_I im; cl_I ik; try { ik = cln::numerator(cln::rational(cln::realpart(k.internalNumber()))); im = cln::numerator(cln::rational(cln::realpart(m.internalNumber()))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } if(im > long(INT_MAX) || ik > long(INT_MAX)) { ik = cln::minus1(ik); Number k_fac(k); try { k_fac.factorial(); cl_I ithis = im; for(; !cln::zerop(ik); ik = cln::minus1(ik)) { im = cln::minus1(im); ithis = ithis * im; } new_value = ithis; } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } clear(); value = new_value; divide(k_fac); } else { try { new_value = cln::binomial(cl_I_to_uint(im), cl_I_to_uint(ik)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } clear(); value = new_value; } setPrecisionAndApproximateFrom(m); setPrecisionAndApproximateFrom(k); } return true; } bool Number::factorize(vector &factors) { if(isZero() || !isInteger()) return false; cl_I inr; try { inr = cln::numerator(cln::rational(cln::realpart(value))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); return false; } 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++) { bool b_zero = false; try { b_zero = cln::zerop(cln::mod(inr, PRIMES[prime_index])); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } if(b_zero) { try { inr = cln::exquo(inr, PRIMES[prime_index]); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } 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) { bool b_zero = false; try { b_zero = cln::zerop(cln::mod(inr, last_prime)); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } pthread_testcancel(); if(b_zero) { try { inr = cln::exquo(inr, last_prime); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } 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(CALCULATOR->printingAborted()) return CALCULATOR->printingAbortedMessage(); 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_DEGREE, po.can_display_unicode_string_arg))) { str += SIGN_DEGREE; } 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); bool rerun = false; bool exact = true; integer_rerun: string mpz_str = printCL_I(ivalue, base, false, BASE_DISPLAY_NONE, po.lower_case_numbers); if(CALCULATOR->printingAborted()) return CALCULATOR->printingAbortedMessage(); 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; bool b_zero = true; try { b_zero = cln::zerop(ivalue); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } if(!rerun && !b_zero) { 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) { try { 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; } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } } else if(precision2 < 0 && (expo > 0 || isApproximate() || (ips.parent_approximate && po.restrict_to_parent_precision))) { precision2 = -precision2; try { cln::cl_RA v = ivalue; int p2_cd = precision2; cln::cl_I i_exp; if(p2_cd > 1000) { i_exp = cln::expt_pos(cln::cl_I(base), 1000); while(p2_cd >= 1000) { v = v / i_exp; p2_cd -= 1000; if(CALCULATOR->printingAborted()) return CALCULATOR->printingAbortedMessage(); } } i_exp = cln::expt_pos(cln::cl_I(base), p2_cd); v = v / i_exp; cln::cl_RA_div_t div = cln::floor2(v); 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; } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } } } 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); } } if(ips.minus) *ips.minus = neg; str = format_number_string(mpz_str, base, po.base_display, !ips.minus && neg); 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(exact && 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 && (!exact || isApproximate() || (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, remainder = 0, remainder2 = 0, exp = 0; cln::cl_I_div_t div; try { d = cln::denominator(cln::rational(cln::realpart(value))); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } bool neg = cln::minusp(cln::realpart(value)); try { if(neg) { num = -cln::numerator(cln::rational(cln::realpart(value))); } else { num = cln::numerator(cln::rational(cln::realpart(value))); } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } int l10 = 0; try { div = cln::truncate2(num, d); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } try { remainder = div.remainder; num = div.quotient; } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } bool exact = false; try { exact = cln::zerop(remainder); } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } 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(CALCULATOR->printingAborted()) return CALCULATOR->printingAbortedMessage(); 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(); try { 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; } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } 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); } try { 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; } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } if(CALCULATOR->printingAborted()) return CALCULATOR->printingAbortedMessage(); l10++; remainder = remainder2; if(try_infinite_series && !exact) { for(size_t i = 0; i < remainders.size(); i++) { if(CALCULATOR->printingAborted()) return CALCULATOR->printingAbortedMessage(); if(remainders[i] == remainder) { infinite_series = true; try_infinite_series = false; break; } } } if(started) { precision2--; } } remainders.clear(); if(!exact && !infinite_series) { try { 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); } } } catch(runtime_exception &e) { CALCULATOR->error(true, _("CLN Exception: %s"), e.what()); } } 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(CALCULATOR->printingAborted()) return CALCULATOR->printingAbortedMessage(); 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; } bool has_decimal = false; if(l10 > 0) { l10 = str.length() - l10; if(l10 < 1) { str.insert(str.begin(), 1 - l10, '0'); l10 = 1; } str.insert(l10, po.decimalpoint()); has_decimal = true; 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); has_decimal = false; } } int decimals = 0; if(l10 > 0) { decimals = str.length() - l10 - 1; } if(str.empty()) { str = "0"; } if(exact && min_decimals > decimals) { if(decimals <= 0) { str += po.decimalpoint(); decimals = 0; has_decimal = true; } for(; decimals < min_decimals; decimals++) { str += "0"; } } if(str[str.length() - 1] == po.decimalpoint()[0]) { str.erase(str.end() - 1); has_decimal = false; } 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(); has_decimal = true; } for(; precision > 0 && (!po.use_max_decimals || po.max_decimals < 0 || po.max_decimals > decimals); precision--) { decimals++; str += "0"; } } str = format_number_string(str, base, po.base_display, !ips.minus && neg, !has_decimal); 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); } } if(ips.minus) *ips.minus = neg; 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.10/libqalculate/includes.h0000644000175000017500000006456512752061565015636 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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 */ #include #include #include #include #include #include #include #include #include #include #include #include #include /// \cond using namespace std; /// \endcond 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_all_units; /// 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_prefixes_for_currencies; /// Use prefixes for all units (even imperial and similar ones). 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_all_units(false), 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; typedef enum { /// The default adaptive mode works as the "parse implicit multiplication first" mode, unless spaces are found (1/5x = 1/(5*x), but 1/5 x = (1/5)*x). In the adaptive mode unit expressions are parsed separately (5 m/5 m/s = (5*m)/(5*(m/s)) = 1 s). PARSING_MODE_ADAPTIVE, /// In the "parse implicit multiplication first" mode, implicit multiplication is parsed before explicit multiplication (12/2(1+2) = 12/(2*3) = 2, 5x/5y = (5*x)/(5*y) = x/y). PARSING_MODE_IMPLICIT_MULTIPLICATION_FIRST, /// In the conventional mode implicit multiplication does not differ from explicit multiplication (12/2(1+2) = 12/2*3 = 18, 5x/5y = 5*x/5*y = xy). PARSING_MODE_CONVENTIONAL } ParsingMode; /// 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; /// If true commas will ignored if another character is the default decimal sign, to allow commas to be used as thousand separator. You also need to call CALCULATOR->useDecimalPoint(true). Default: false bool comma_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; /// Convert degree Celsius and Fahrenheit to Kelvin already when parsing the expression. Turn off when parsing unit expression to convert to. Default: true bool convert_temperature_units; /// Parsing mode. Default: PARSING_MODE_ADAPTIVE ParsingMode parsing_mode; 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), convert_temperature_units(true), parsing_mode(PARSING_MODE_ADAPTIVE) {} } 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 int 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 Default: STRUCTURING_NONE 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_DEGREE "°" #define SIGN_POWER_0 "⁰" #define SIGN_POWER_1 "¹" #define SIGN_POWER_2 "²" #define SIGN_POWER_3 "³" #define SIGN_POWER_4 "³" #define SIGN_POWER_5 "⁴" #define SIGN_POWER_6 "⁶" #define SIGN_POWER_7 "⁷" #define SIGN_POWER_8 "⁸" #define SIGN_POWER_9 "⁹" #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.10/libqalculate/Makefile.am0000644000175000017500000000146112711115417015664 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@ AM_CPPFLAGS = \ -I../ \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ @GLIB_CFLAGS@ libqalculate-0.9.10/libqalculate/Number.h0000644000175000017500000002657412707707760015262 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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.10/libqalculate/Function.h0000644000175000017500000006206512737642712015610 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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; class MathFunction_p; /// 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: MathFunction_p *priv; int argc; int max_argc; vector default_values; 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.10/libqalculate/Variable.h0000644000175000017500000003073212706146445015542 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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.10/libqalculate/BuiltinFunctions.h0000644000175000017500000002501212735461163017306 00000000000000 /* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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&, bool) const;\ bool representsNonNegative(const MathStructure&, bool) 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.10/libqalculate/Calculator.cc0000644000175000017500000114255512757104631016251 00000000000000/* Qalculate Copyright (C) 2008 Hanna Knutsson (hanna_k@fmgirl.com) 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 //#include #include using namespace cln; #if HAVE_UNORDERED_MAP # include #elif defined(__GNUC__) # ifndef __has_include # define __has_include(x) 0 # endif # if (defined(__clang__) && __has_include()) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) # include namespace Sgi = std; # define unordered_map std::tr1::unordered_map # else # 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 # define unordered_map Sgi::hash_map # endif #else // ... there are other compilers, right? namespace Sgi = std; # define unordered_map Sgi::hash_map #endif #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->setAborted(); if(CALCULATOR->tmp_parsedstruct) CALCULATOR->tmp_parsedstruct->setAborted(); //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->setAborted(); 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; } class Calculator_p { public: unordered_map id_structs; unordered_map ids_p; vector freed_ids; size_t ids_i; }; Calculator::Calculator() { #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); #endif priv = new Calculator_p; setlocale(LC_ALL, ""); has_gvfs = -1; exchange_rates_time = 0; exchange_rates_check_time = 0; b_exchange_rates_warning_enabled = true; b_exchange_rates_used = false; i_printing_aborted = 0; b_printing_controlled = false; i_print_timeout = 0; setPrecision(DEFAULT_PRECISION); addStringAlternative(SIGN_POWER_0, "^(0)"); addStringAlternative(SIGN_POWER_1, "^(1)"); addStringAlternative(SIGN_POWER_2, "^(2)"); addStringAlternative(SIGN_POWER_3, "^(3)"); addStringAlternative(SIGN_POWER_4, "^(4)"); addStringAlternative(SIGN_POWER_5, "^(5)"); addStringAlternative(SIGN_POWER_6, "^(6)"); addStringAlternative(SIGN_POWER_7, "^(7)"); addStringAlternative(SIGN_POWER_8, "^(8)"); addStringAlternative(SIGN_POWER_9, "^(9)"); //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(); char *current_lc_numeric = setlocale(LC_NUMERIC, ""); if(current_lc_numeric) saved_locale = strdup(current_lc_numeric); else saved_locale = NULL; struct lconv *lc = localeconv(); if(!lc) { setlocale(LC_NUMERIC, "C"); lc = localeconv(); } #ifdef HAVE_STRUCT_LCONV_INT_N_CS_PRECEDES place_currency_code_before = lc->int_p_cs_precedes; #else place_currency_code_before = 1; #endif #ifdef HAVE_STRUCT_LCONV_INT_P_CS_PRECEDES place_currency_code_before_negative = lc->int_n_cs_precedes; #else place_currency_code_before_negative = 1; #endif 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 "); priv->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"); } Calculator::~Calculator() { closeGnuplot(); delete priv; } 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() { if(saved_locale) 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(bool use_comma_as_separator) { DOT_STR = "."; DOT_S = "."; if(use_comma_as_separator) { COMMA_STR = ";"; COMMA_S = ";"; } else { 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(priv->freed_ids.size() > 0) { id = priv->freed_ids.back(); priv->freed_ids.pop_back(); } else { priv->ids_i++; id = priv->ids_i; } priv->ids_p[id] = persistent; priv->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(priv->freed_ids.size() > 0) { id = priv->freed_ids.back(); priv->freed_ids.pop_back(); } else { priv->ids_i++; id = priv->ids_i; } priv->ids_p[id] = persistent; priv->id_structs[id] = new MathStructure(); f->parse(*priv->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(priv->freed_ids.size() > 0) { id = priv->freed_ids.back(); priv->freed_ids.pop_back(); } else { priv->ids_i++; id = priv->ids_i; } priv->ids_p[id] = persistent; priv->id_structs[id] = new MathStructure(); f->parse(*priv->id_structs[id], str, po); priv->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(priv->freed_ids.size() > 0) { id = priv->freed_ids.back(); priv->freed_ids.pop_back(); } else { priv->ids_i++; id = priv->ids_i; } priv->ids_p[id] = persistent; priv->id_structs[id] = new MathStructure(); f_vector->args(str, *priv->id_structs[id], po); return id; } MathStructure *Calculator::getId(size_t id) { if(priv->id_structs.find(id) != priv->id_structs.end()) { if(priv->ids_p[id]) { return new MathStructure(*priv->id_structs[id]); } else { MathStructure *mstruct = priv->id_structs[id]; priv->freed_ids.push_back(id); priv->id_structs.erase(id); priv->ids_p.erase(id); return mstruct; } } return NULL; } void Calculator::delId(size_t id) { if(priv->ids_p.find(id) != priv->ids_p.end()) { priv->freed_ids.push_back(id); priv->id_structs[id]->unref(); priv->id_structs.erase(id); priv->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("", SIGN_INFINITY, mstruct, "Infinity", false, true)); v_inf->addName("infinity"); 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("", 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)); u_kelvin = addUnit(new Unit(_("Temperature"), "K", "kelvins", "kelvin", "Kelvin", false, true, true)); u_kelvin->setAsSIUnit(); u_celsius = addUnit(new AliasUnit(_("Temperature"), "oC", "", "celsius", "Degree Celsius", u_kelvin, "\\x+273.15", 1, "\\x-273.15", false, true, true)); u_fahrenheit = addUnit(new AliasUnit(_("Temperature"), "oF", "", "fahrenheit", "Degree Fahrenheit", u_kelvin, "(\\x+459.67)*5/9", 1, "(\\x*9/5)-459.67", 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(unordered_map::iterator it = priv->ids_p.begin(); it != priv->ids_p.end(); ++it) { if(!it->second) { priv->freed_ids.push_back(it->first); priv->id_structs.erase(it->first); priv->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(/* Solaris 2.6 needs a cast */ (void*) PTHREAD_CANCELED); } bool Calculator::busy() { return b_busy; } void Calculator::terminateThreads() { if(!calculate_thread_stopped) { pthread_cancel(calculate_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) { if(po.comma_as_separator) { 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), SPACE); ui = str.find(COMMA, ui + strlen(SPACE)); } } } 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_SET, 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->setAborted(); return false; } return true; } bool Calculator::hasToExpression(const string &str) const { return str.rfind(_(" to ")) != string::npos || str.rfind(" to ") != string::npos; } bool Calculator::separateToExpression(string &str, string &to_str, const EvaluationOptions &eo, bool keep_modifiers) 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); } else 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); } else { return false; } remove_blank_ends(to_str); if(!keep_modifiers && !to_str.empty() && (to_str[0] == '0' || to_str[0] == '?')) { to_str = to_str.substr(1, str.length() - 1); 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, true); Unit *u = NULL; if(to_struct) { if(str2.empty()) { if(to_struct->isSymbolic() && !to_struct->symbol().empty()) { str2 = to_struct->symbol(); remove_blank_ends(str2); } else if(to_struct->isUnit()) { u = to_struct->unit(); } } to_struct->setUndefined(); } 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() || u) { if(!u) u = getUnit(str2); EvaluationOptions eo2 = eo; eo2.keep_prefixes = (str2[0] != '?'); if(str2[0] == '?' || str2[0] == '0') { str2 = str2.substr(1, str2.length() - 1); remove_blank_ends(str2); if(str2.empty()) return mstruct; } if(u) { if(to_struct) to_struct->set(u); return convert(mstruct, u, eo2, false); } 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, eo2, false); } CompositeUnit cu("", "temporary_composite_convert", "", str2); if(to_struct) to_struct->set(cu.generateMathStructure(make_to_division)); if(cu.countUnits() > 0) { mstruct = convertToCompositeUnit(mstruct, &cu, eo2, false); return mstruct; } } 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) { startPrintControl(msecs); MathStructure mstruct2(mstruct); mstruct2.format(); string print_result = mstruct2.print(po); stopPrintControl(); return print_result; } MathStructure Calculator::convert(double value, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo) { MathStructure mstruct(value); mstruct *= from_unit; mstruct.eval(eo); mstruct.convert(to_unit, true); mstruct.divide(to_unit, true); mstruct.eval(eo); return mstruct; } MathStructure Calculator::convertTimeOut(string str, Unit *from_unit, Unit *to_unit, int msecs, const EvaluationOptions &eo) { MathStructure mstruct; parse(&mstruct, str, eo.parse_options); mstruct *= from_unit; 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 = PROC_NO_COMMAND; 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(); mstruct.setAborted(); return mstruct; } mstruct.convert(to_unit, true); mstruct.divide(to_unit, true); saveState(); b_busy = true; fwrite(&b_parse, sizeof(bool), 1, calculate_pipe_w); x = (void*) &mstruct; fwrite(&x, sizeof(void*), 1, calculate_pipe_w); fflush(calculate_pipe_w); while(msecs > 0 && b_busy) { nanosleep(&rtime, NULL); msecs -= 1; } if(had_msecs && b_busy) { abort(); mstruct.setAborted(); } return mstruct; } 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) { CompositeUnit *cu = NULL; if(to_unit->subtype() == SUBTYPE_COMPOSITE_UNIT) cu = (CompositeUnit*) to_unit; if(cu && cu->countUnits() == 0) return mstruct; MathStructure mstruct_new(mstruct); //bool b_simple = !cu && (to_unit->subtype() != SUBTYPE_ALIAS_UNIT || (((AliasUnit*) to_unit)->baseUnit()->subtype() != SUBTYPE_COMPOSITE_UNIT && ((AliasUnit*) to_unit)->baseExponent() == 1)); if(!mstruct_new.isPower() && !mstruct_new.isUnit() && !mstruct_new.isMultiplication()) { if(mstruct_new.size() > 0) { for(size_t i = 0; i < mstruct_new.size(); i++) { if(!mstruct_new.isFunction() || !mstruct_new.function()->getArgumentDefinition(i + 1) || mstruct_new.function()->getArgumentDefinition(i + 1)->type() != ARGUMENT_TYPE_ANGLE) { 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 { if(cu && cu->countUnits() > 1 && (cu->find(u_celsius) != 0 || cu->find(u_fahrenheit) != 0)) { CALCULATOR->error(true, _("Cannot convert to unit expression that includes degrees Celsius or Fahrenheit in addition to other units, prefixes or exponents."), NULL); return mstruct_new; } else if(to_unit == u_celsius || to_unit == u_fahrenheit || (cu && (cu->get(1) == u_fahrenheit || cu->get(1) == u_celsius))) { if(cu) { int exp = 1; Prefix *p = NULL; cu->get(1, &exp, &p); if(exp != 1 || (p != NULL && p != decimal_null_prefix)) { CALCULATOR->error(true, _("Cannot convert to unit expression that includes degrees Celsius or Fahrenheit in addition to other units, prefixes or exponents."), NULL); return mstruct_new; } } Unit *u = NULL; if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isUnit()) { if(u) { CALCULATOR->error(true, _("Cannot convert the expression to degrees Celsius or Fahrenheit."), NULL); return mstruct_new; } u = mstruct[i].unit(); } else if(mstruct[i].isUnit_exp()) { CALCULATOR->error(true, _("Cannot convert the expression to degrees Celsius or Fahrenheit."), NULL); return mstruct_new; } } } else if(!mstruct.isUnit() && mstruct.isUnit_exp()) { CALCULATOR->error(true, _("Cannot convert the expression to degrees Celsius or Fahrenheit."), NULL); return mstruct_new; } } EvaluationOptions eo2 = eo; eo2.keep_prefixes = true; bool b = false; if(mstruct_new.convert(to_unit, true, NULL, false, eo2, eo.keep_prefixes ? decimal_null_prefix : NULL) || always_convert) { b = true; } else { CompositeUnit *cu2 = cu; if(to_unit->subtype() == SUBTYPE_ALIAS_UNIT && ((AliasUnit*) to_unit)->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { cu2 = (CompositeUnit*) ((AliasUnit*) to_unit)->baseUnit(); } if(cu2) { switch(mstruct_new.type()) { case STRUCT_UNIT: { if(cu2->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() && cu2->containsRelativeTo(mstruct_new.getChild(i)->unit())) { b = true; } if(mstruct_new.getChild(i)->isPower() && mstruct_new.getChild(i)->base()->isUnit() && cu2->containsRelativeTo(mstruct_new.getChild(i)->base()->unit())) { b = true; } } break; } case STRUCT_POWER: { if(mstruct_new.base()->isUnit() && cu2->containsRelativeTo(mstruct_new.base()->unit())) { b = true; } break; } default: {} } } } if(b) { eo2.sync_units = true; eo2.keep_prefixes = false; mstruct_new.divide(MathStructure(to_unit, NULL)); mstruct_new.eval(eo2); if(cu) { MathStructure mstruct_cu(cu->generateMathStructure(false, eo.keep_prefixes)); Prefix *p = NULL; size_t i = 1; Unit *u = cu->get(i, NULL, &p); while(u) { mstruct_new.setPrefixForUnit(u, p); i++; u = cu->get(i, NULL, &p); } mstruct_new.multiply(mstruct_cu); } else { mstruct_new.multiply(MathStructure(to_unit, eo.keep_prefixes ? decimal_null_prefix : NULL)); } eo2.sync_units = false; eo2.keep_prefixes = true; mstruct_new.eval(eo2); return mstruct_new; } } 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.keep_prefixes = false; //eo2.calculate_functions = false; mstruct_new.eval(eo2); return mstruct_new; } Unit *Calculator::findMatchingUnit(const MathStructure &mstruct) { switch(mstruct.type()) { case STRUCT_POWER: { if(mstruct.base()->isUnit() && mstruct.base()->unit()->subtype() != SUBTYPE_COMPOSITE_UNIT && mstruct.exponent()->isNumber() && mstruct.exponent()->number().isInteger()) { Unit *u_base = mstruct.base()->unit(); if(u_base->subtype() == SUBTYPE_ALIAS_UNIT) { if(((AliasUnit*) u_base)->baseExponent() == 1) return u_base; else u_base = u_base->baseUnit(); } int exp = mstruct.exponent()->number().intValue(); for(size_t i = 0; i < units.size(); i++) { Unit *u = units[i]; if(u->subtype() == SUBTYPE_ALIAS_UNIT && u->baseUnit() == u_base && ((AliasUnit*) u)->baseExponent() == exp) { return u; } } } return findMatchingUnit(mstruct[0]); } case STRUCT_UNIT: { return mstruct.unit(); } case STRUCT_MULTIPLICATION: { if(mstruct.size() == 2 && !mstruct[0].isUnit_exp()) { return findMatchingUnit(mstruct[1]); } CompositeUnit *cu = new CompositeUnit("", "temporary_find_matching_unit"); for(size_t i = 1; i <= mstruct.countChildren(); i++) { if(mstruct.getChild(i)->isUnit()) { cu->add(mstruct.getChild(i)->unit()->baseUnit()); } else if(mstruct.getChild(i)->isPower() && mstruct.getChild(i)->base()->isUnit() && mstruct.getChild(i)->exponent()->isNumber() && mstruct.getChild(i)->exponent()->number().isInteger()) { cu->add(mstruct.getChild(i)->base()->unit()->baseUnit(), mstruct.getChild(i)->exponent()->number().intValue()); } } if(cu->countUnits() == 1) { int exp = 1; Unit *u_base = cu->get(1, &exp); if(exp == 1) return u_base; for(size_t i = 0; i < units.size(); i++) { Unit *u = units[i]; if(u->subtype() == SUBTYPE_ALIAS_UNIT && u->baseUnit() == u_base && ((AliasUnit*) u)->baseExponent() == exp) { return u; } } } if(cu->countUnits() > 1) { for(size_t i = 0; i < units.size(); i++) { Unit *u = units[i]; if(u->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) u)->countUnits() == cu->countUnits()) { bool b = true; for(size_t i2 = 1; i2 <= cu->countUnits(); i2++) { int exp1 = 1, exp2 = 1; Unit *ui1 = cu->get(i2, &exp1); Unit *ui2 = ((CompositeUnit*) u)->get(i2, &exp2); if(ui1 != ui2->baseUnit() || exp1 != exp2) { b = false; break; } } if(b) { delete cu; return u; } } } } } delete cu; break; } default: { for(size_t i = 0; i < mstruct.size(); i++) { Unit *u = findMatchingUnit(mstruct[i]); if(u) return u; } break; } } return NULL; } 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; } 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); } if(!u2->isRegistered()) delete 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()); Unit *u = getBestUnit(cu); mstruct_new = convert(mstruct_new, u, eo, true); if(!u->isRegistered()) delete u; 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: { Unit *u = getBestUnit(mstruct.unit()); MathStructure mstruct_new = convert(mstruct, u, eo, true); if(!u->isRegistered()) delete u; return mstruct_new; } 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) { Unit *u = getBestUnit(cu); mstruct_new = convert(mstruct_new, u, eo, true); if(!u->isRegistered()) delete u; } 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) { return convert(mstruct, cu, eo, always_convert); } MathStructure Calculator::convert(const MathStructure &mstruct, string composite_, const EvaluationOptions &eo) { remove_blank_ends(composite_); if(composite_.empty()) return mstruct; EvaluationOptions eo2 = eo; eo2.keep_prefixes = (composite_[0] != '?'); if(composite_[0] == '0' || composite_[0] == '?') { composite_ = composite_.substr(1, composite_.length() - 1); if(composite_.empty()) return mstruct; } Unit *u = getUnit(composite_); if(u) return convert(mstruct, u, eo2, true); 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, eo2, true); CompositeUnit cu("", "temporary_composite_convert", "", composite_); return convertToCompositeUnit(mstruct, &cu, eo2, true); } 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() == 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_not_in(NUMBERS, name_[0]); } bool Calculator::functionNameIsValid(const string &name_) { return name_.find_first_of(ILLEGAL_IN_NAMES) == string::npos && is_not_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); remove_blank_ends(str); remove_duplicate_blanks(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); } } //remove spaces in numbers size_t space_i = str.find(SPACE_CH, 0); while(space_i != string::npos) { if(is_in(NUMBERS DOT, str[space_i + 1]) && is_in(NUMBERS DOT, str[space_i - 1])) { str.erase(space_i, 1); space_i--; } space_i = str.find(SPACE_CH, space_i + 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(ILLEGAL_IN_NAMES, 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, b_comma_before = false, b_power_before = false; //bool b_space_first = false; size_t i5 = 1; int arg_i = f->args(); 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 if(i5 == 2 && po.parsing_mode == PARSING_MODE_CONVENTIONAL && !b_power_before) b = true; else i5++; } else if(c == RIGHT_PARENTHESIS_CH) { if(i5 <= 2) b = true; else i5--; } else if(c == POWER_CH) { if(i5 < 2) i5 = 2; b_power_before = true; } else if(!b_comma_before && !b_power_before && c == ' ' && arg_i <= 1) { //if(i5 < 2) b_space_first = true; if(i5 == 2) b = true; } else if(!b_comma_before && i5 == 2 && arg_i <= 1 && is_in(OPERATORS, c) && c != POWER_CH) { b = true; } else if(c == COMMA_CH) { if(i5 == 2) arg_i--; b_comma_before = true; if(i5 < 2) i5 = 2; } else if(i5 < 2) { i5 = 2; } if(c != COMMA_CH && c != ' ') b_comma_before = false; if(c != POWER_CH && c != ' ') b_power_before = false; } 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]) && (str.length() == str_index + name_length + 1 || is_not_in(NUMBERS, str[str_index + name_length + 1])) && !((Unit*) object)->isCurrency()) { if(str_index + name_length + 1 == str.length()) { str.insert(str_index + name_length, 1, POWER_CH); } else { str.insert(str_index + name_length + 1, 1, RIGHT_PARENTHESIS_CH); str.insert(str_index + name_length, 1, POWER_CH); str.insert(str_index, 1, LEFT_PARENTHESIS_CH); str_index++; } }*/ 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); } if(parseoptions.convert_temperature_units && (object == u_celsius || object == u_fahrenheit)) { int i_depth = 0; int i6 = str_index - 1; int b_nonspace = 0; bool b_minus = false; for(; i6 >= 0; i6--) { if(i_depth == 0 && is_in(OPERATORS LEFT_PARENTHESIS VECTOR_WRAPS COMMAS, str[i6]) && (b_nonspace == 0 || str[i6] != POWER_CH)) { if(str[i6] == MINUS_CH && (i6 == 0 || str.find_last_not_of(SPACE_CH, i6 - 1) == string::npos)) { i6--; b_minus = TRUE; } break; } if(((i_depth == 0 && b_nonspace == 0) || i_depth == 1) && str[i6] == ID_WRAP_RIGHT_CH && i6 > 1) { size_t i7 = str.find_last_of(ID_WRAP_LEFT_CH, i6 - 2); if(i7 != string::npos) { int id = s2i(str.substr(i7 + 1, i6 - i7 - 1)); MathStructure *m_temp = NULL; if(priv->id_structs.find(id) != priv->id_structs.end()) m_temp = priv->id_structs[id]; if(m_temp && m_temp->isUnit()) { if(i_depth == 0) break; if(b_nonspace == 1 && str[i6 + 1] == RIGHT_PARENTHESIS_CH) { i6++; i_depth = 0; b_nonspace = 0; break; } else if(b_nonspace == 3 && str[i6 + 1] == RIGHT_PARENTHESIS_CH && str[i6 + 2] == POWER_CH && is_not_in(OPERATORS SPACES, str[i6 + 3])) { i6 += 3; i_depth = 0; b_nonspace = 0; break; } } } } if(is_not_in(SPACES, str[i6])) b_nonspace++; if(str[i6] == LEFT_PARENTHESIS_CH) i_depth--; else if(str[i6] == RIGHT_PARENTHESIS_CH) i_depth++; } i6++; if(object == u_fahrenheit) { if(b_minus && i6 != 0) { str.insert(i6, PLUS); str_index++; i6++; } if(b_nonspace > 0) { str.insert(i6, LEFT_PARENTHESIS LEFT_PARENTHESIS LEFT_PARENTHESIS); str_index += 3; stmp = RIGHT_PARENTHESIS; } else { str.insert(i6, LEFT_PARENTHESIS LEFT_PARENTHESIS); str_index += 2; stmp += "1"; } stmp += LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(addId(new MathStructure(u_kelvin, p))); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; stmp += "+459.67"; stmp += LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(addId(new MathStructure(u_kelvin, p))); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; stmp += RIGHT_PARENTHESIS; stmp += "*5/9"; stmp += RIGHT_PARENTHESIS; } else { if(b_minus && i6 != 0) { str.insert(i6, PLUS); str_index++; i6++; } if(b_nonspace > 0) { str.insert(i6, LEFT_PARENTHESIS LEFT_PARENTHESIS); str_index += 2; stmp = RIGHT_PARENTHESIS; } else { str.insert(i6, LEFT_PARENTHESIS); str_index++; if(!b_minus) stmp = "1"; } stmp += LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(addId(new MathStructure(u_kelvin, p))); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; stmp += "+273.15"; stmp += LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(addId(new MathStructure(u_kelvin, p))); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; stmp += RIGHT_PARENTHESIS; } str.replace(str_index, name_length, stmp); str_index += stmp.length(); } else { 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 if(po.parsing_mode != PARSING_MODE_ADAPTIVE) { remove_blanks(str); } else { //remove spaces between next to operators (except '/') and before/after parentheses space_i = str.find(SPACE_CH, 0); while(space_i != string::npos) { if((str[space_i + 1] != DIVISION_CH && is_in(OPERATORS RIGHT_PARENTHESIS, str[space_i + 1])) || (str[space_i - 1] != DIVISION_CH && is_in(OPERATORS LEFT_PARENTHESIS, str[space_i - 1]))) { str.erase(space_i, 1); space_i--; } space_i = str.find(SPACE_CH, space_i + 1); } } 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; } 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++; } } 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); } } 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(po.rpn) remove_blanks(str); 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(!po.rpn && po.parsing_mode == PARSING_MODE_ADAPTIVE && (i = str.find(DIVISION_CH, 1)) != string::npos && i + 1 != str.length()) { while(i != string::npos && i + 1 != str.length()) { bool b = false; if(i > 2 && i < str.length() - 3 && str[i + 1] == ID_WRAP_LEFT_CH) { i2 = i; b = true; bool had_unit = false; MathStructure *m_temp = NULL, *m_temp2 = NULL; while(b) { b = false; size_t i4 = i2; if(i2 > 2 && str[i2 - 1] == ID_WRAP_RIGHT_CH) { b = true; } else if(i2 > 4 && str[i2 - 3] == ID_WRAP_RIGHT_CH && str[i2 - 2] == POWER_CH && is_in(NUMBERS, str[i2 - 1])) { b = true; i4 -= 2; } if(!b) break; i2 = str.rfind(ID_WRAP_LEFT_CH, i4 - 2); m_temp = NULL; if(i2 != string::npos) { int id = s2i(str.substr(i2 + 1, (i4 - 1) - (i2 + 1))); if(priv->id_structs.find(id) != priv->id_structs.end()) m_temp = priv->id_structs[id]; } if(!m_temp || !m_temp->isUnit()) break; had_unit = true; } i3 = i; b = had_unit; had_unit = false; while(b) { size_t i4 = i3; i3 = str.find(ID_WRAP_RIGHT_CH, i4 + 2); m_temp2 = NULL; if(i3 != string::npos) { int id = s2i(str.substr(i4 + 2, (i3 - 1) - (i4 + 1))); if(priv->id_structs.find(id) != priv->id_structs.end()) m_temp2 = priv->id_structs[id]; } if(!m_temp2 || !m_temp2->isUnit()) { b = false; break; } had_unit = true; b = false; if(i3 < str.length() - 3 && str[i3 + 1] == ID_WRAP_LEFT_CH) { b = true; } else if(i3 < str.length() - 5 && str[i3 + 3] == ID_WRAP_LEFT_CH && str[i3 + 1] == POWER_CH && is_in(NUMBERS, str[i3 + 2])) { b = true; i3 += 2; } } b = had_unit; if(b) { if(i3 < str.length() - 2 && str[i3 + 1] == POWER_CH && is_in(NUMBERS, str[i3 + 2])) i3 += 2; if(i3 == str.length() - 1 || (str[i3 + 1] != POWER_CH && str[i3 + 1] != DIVISION_CH)) { MathStructure *mstruct2 = new MathStructure(); str2 = str.substr(i2, i - i2); parseAdd(str2, mstruct2, po); str2 = str.substr(i + 1, i3 - i); parseAdd(str2, mstruct2, po, OPERATION_DIVIDE); str2 = ID_WRAP_LEFT; str2 += i2s(addId(mstruct2)); str2 += ID_WRAP_RIGHT; str.replace(i2, i3 - i2 + 1, str2); } else { b = false; } } } if(!b) { i2 = str.find_last_not_of(NUMBERS PLUS MINUS EXPS, i - 1); if(i2 == string::npos || (i2 != i - 1 && str[i2] == MULTIPLICATION_2_CH)) b = true; i2 = str.rfind(MULTIPLICATION_2_CH, i - 1); if(i2 == string::npos) b = true; if(b) { i3 = str.find_first_of(MULTIPLICATION_2 MULTIPLICATION DIVISION, i + 1); if(i3 == string::npos || i3 == i + 1 || str[i3] != MULTIPLICATION_2_CH) b = false; if(i3 < str.length() + 1 && (str[i3 + 1] == DIVISION_CH || str[i3 + 1] == MULTIPLICATION_CH || str[i3 + 1] == POWER_CH)) b = false; } if(b) { if(i3 != string::npos) str[i3] = MULTIPLICATION_CH; if(i2 != string::npos) str[i2] = MULTIPLICATION_CH; } else { if(str[i + 1] == MULTIPLICATION_2_CH) { str.erase(i + 1, 1); } if(str[i - 1] == MULTIPLICATION_2_CH) { str.erase(i - 1, 1); i--; } } } i = str.find(DIVISION_CH, i + 1); } } if(po.parsing_mode == PARSING_MODE_ADAPTIVE && !po.rpn) remove_blanks(str); if(po.parsing_mode == PARSING_MODE_CONVENTIONAL) { if((i = str.find(ID_WRAP_RIGHT_CH, 1)) != string::npos && i + 1 != str.length()) { while(i != string::npos && i + 1 != str.length()) { if(is_in(NUMBERS ID_WRAP_LEFT, str[i + 1])) { str.insert(i + 1, 1, MULTIPLICATION_CH); i++; } i = str.find(ID_WRAP_RIGHT_CH, i + 1); } } if((i = str.find(ID_WRAP_LEFT_CH, 1)) != string::npos) { while(i != string::npos) { if(is_in(NUMBERS, str[i - 1])) { str.insert(i, 1, MULTIPLICATION_CH); i++; } i = str.find(ID_WRAP_LEFT_CH, i + 1); } } } 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(ID_WRAP_RIGHT_CH, 1)) != string::npos && i + 1 != str.length()) { bool b = false; while(i != string::npos && i + 1 != str.length()) { if(str[i + 1] != POWER_CH) { str2 = str.substr(0, i + 1); 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(ID_WRAP_RIGHT_CH, 1); } else { i = str.find(ID_WRAP_RIGHT_CH, i + 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(ID_WRAP_LEFT_CH, 1)) != string::npos) { bool b = false; while(i != string::npos) { if(str[i - 1] != POWER_CH) { str2 = str.substr(0, i); str = str.substr(i, str.length() - i); if(b) { parseAdd(str2, mstruct, po, OPERATION_MULTIPLY); } else { parseAdd(str2, mstruct, po); b = true; } i = str.find(ID_WRAP_LEFT_CH, 1); } else { i = str.find(ID_WRAP_LEFT_CH, i + 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() { gchar *dirname = g_build_filename(PACKAGE_DATA_DIR, "qalculate", NULL); gchar *filename = g_build_filename(dirname, "prefixes.xml", NULL); bool b = true; if(!loadDefinitions(filename, false)) { b = false; } g_free(filename); filename = g_build_filename(dirname, "currencies.xml", NULL); if(!loadDefinitions(filename, false)) { b = false; } g_free(filename); filename = g_build_filename(dirname, "units.xml", NULL); if(!loadDefinitions(filename, false)) { b = false; } g_free(filename); filename = g_build_filename(dirname, "functions.xml", NULL); if(!loadDefinitions(filename, false)) { b = false; } g_free(filename); filename = g_build_filename(dirname, "datasets.xml", NULL); if(!loadDefinitions(filename, false)) { b = false; } g_free(filename); filename = g_build_filename(dirname, "variables.xml", NULL); if(!loadDefinitions(filename, false)) { b = false; } g_free(filename); g_free(dirname); return b; } bool Calculator::loadGlobalDefinitions(string filename) { gchar *filepath = g_build_filename(PACKAGE_DATA_DIR, "qalculate", filename.c_str(), NULL); bool b = loadDefinitions(filepath, false); g_free(filepath); return b; } 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() { gchar *homedir = g_build_filename(getLocalDataDir().c_str(), "definitions", NULL); if(!g_file_test(homedir, G_FILE_TEST_IS_DIR)) { gchar *homedir_old = g_build_filename(getOldLocalDir().c_str(), "definitions", NULL); if(g_file_test(homedir_old, G_FILE_TEST_IS_DIR)) { if(!g_file_test(getLocalDataDir().c_str(), G_FILE_TEST_IS_DIR)) { mkdir(getLocalDataDir().c_str(), S_IRWXU); } if(mkdir(homedir, S_IRWXU) == 0) { list eps_old; struct dirent *ep_old; DIR *dp_old = opendir(homedir_old); if(dp_old) { while((ep_old = readdir(dp_old))) { #ifdef _DIRENT_HAVE_D_TYPE if(ep_old->d_type != DT_DIR) { #endif if(strcmp(ep_old->d_name, "..") != 0 && strcmp(ep_old->d_name, ".") != 0 && strcmp(ep_old->d_name, "datasets") != 0) { eps_old.push_back(ep_old->d_name); } #ifdef _DIRENT_HAVE_D_TYPE } #endif } closedir(dp_old); } for(list::iterator it = eps_old.begin(); it != eps_old.end(); ++it) { gchar *old_filename = g_build_filename(homedir_old, (*it).c_str(), NULL); gchar *new_filename = g_build_filename(homedir, (*it).c_str(), NULL); move_file(old_filename, new_filename); g_free(old_filename); g_free(new_filename); } if(rmdir(homedir_old) == 0) { rmdir(getOldLocalDir().c_str()); } } } g_free(homedir_old); } list eps; struct dirent *ep; DIR *dp = opendir(homedir); 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) { gchar *filename = g_build_filename(homedir, (*it).c_str(), NULL); loadDefinitions(filename, true); g_free(filename); } g_free(homedir); 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; \ ref_names[i].suffix = enameptr->suffix; \ 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; \ ename.case_sensitive = enameptr->case_sensitive; \ 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, use_with_prefixes = false, use_with_prefixes_set = 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, 8}; 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; use_with_prefixes_set = 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(!xmlStrcmp(child->name, (const xmlChar*) "use_with_prefixes")) { XML_GET_TRUE_FROM_TEXT(child, use_with_prefixes) use_with_prefixes_set = true; } 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(use_with_prefixes_set) { u->setUseWithPrefixesByDefault(use_with_prefixes); } 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; use_with_prefixes_set = 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(child2, 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(!xmlStrcmp(child->name, (const xmlChar*) "use_with_prefixes")) { XML_GET_TRUE_FROM_TEXT(child, use_with_prefixes) use_with_prefixes_set = true; } 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); if(use_with_prefixes_set) { au->setUseWithPrefixesByDefault(use_with_prefixes); } 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 if(!xmlStrcmp(child->name, (const xmlChar*) "use_with_prefixes")) { XML_GET_TRUE_FROM_TEXT(child, use_with_prefixes) use_with_prefixes_set = true; } 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(use_with_prefixes_set) { cu->setUseWithPrefixesByDefault(use_with_prefixes); }*/ 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; use_with_prefixes_set = 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 if(!xmlStrcmp(child->name, (const xmlChar*) "use_with_prefixes")) { XML_GET_TRUE_FROM_TEXT(child, use_with_prefixes) use_with_prefixes_set = true; } else ITEM_READ_NAME(unitNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(use_with_prefixes_set) { u->setUseWithPrefixesByDefault(use_with_prefixes); } 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() { mkdir(getLocalDataDir().c_str(), S_IRWXU); gchar *homedir = g_build_filename(getLocalDataDir().c_str(), "definitions", NULL); mkdir(homedir, S_IRWXU); bool b = true; gchar *filename = g_build_filename(homedir, "functions.xml", NULL); if(!saveFunctions(filename)) { b = false; } g_free(filename); filename = g_build_filename(homedir, "units.xml", NULL); if(!saveUnits(filename)) { b = false; } g_free(filename); filename = g_build_filename(homedir, "variables.xml", NULL); if(!saveVariables(filename)) { b = false; } g_free(filename); filename = g_build_filename(homedir, "datasets.xml", NULL); if(!saveDataSets(filename)) { b = false; } g_free(filename); if(!saveDataObjects()) { b = false; } g_free(homedir); 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 += ',';\ } string Calculator::temporaryCategory() const { return _("Temporary"); } 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]->isSIUnit() || !units[i]->useWithPrefixesByDefault()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "use_with_prefixes", units[i]->useWithPrefixesByDefault() ? (xmlChar*) "true" : (xmlChar*) "false"); } 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; } void Calculator::startPrintControl(int milli_timeout) { b_printing_controlled = true; i_printing_aborted = 0; i_print_timeout = milli_timeout; if(i_print_timeout > 0) { gettimeofday(&t_print_end, NULL); long int usecs = t_print_end.tv_usec + (long int) milli_timeout * 1000; t_print_end.tv_usec = usecs % 1000000; t_print_end.tv_sec += usecs / 1000000; } } void Calculator::abortPrint() { i_printing_aborted = 1; } bool Calculator::printingAborted() { if(!b_printing_controlled) return false; if(i_printing_aborted > 0) return true; if(i_print_timeout > 0) { struct timeval tv; gettimeofday(&tv, NULL); if(tv.tv_sec > t_print_end.tv_sec || (tv.tv_sec == t_print_end.tv_sec && tv.tv_usec > t_print_end.tv_usec)) { i_printing_aborted = 2; return true; } } return false; } string Calculator::printingAbortedMessage() const { if(i_printing_aborted == 2) return _("timed out"); return _("aborted"); } string Calculator::timedOutString() const { return _("timed out"); } bool Calculator::printingControlled() { return b_printing_controlled; } void Calculator::stopPrintControl() { b_printing_controlled = false; i_printing_aborted = 0; i_print_timeout = 0; } bool Calculator::loadExchangeRates() { xmlDocPtr doc = NULL; xmlNodePtr cur; xmlChar *value; string currency, rate; gchar *filename = g_build_filename(getLocalDataDir().c_str(), "eurofxref-daily.xml", NULL); if(g_file_test(filename, G_FILE_TEST_EXISTS)) { doc = xmlParseFile(filename); } else { gchar *filename_old = g_build_filename(getOldLocalDir().c_str(), "eurofxref-daily.xml", NULL); if(g_file_test(filename_old, G_FILE_TEST_EXISTS)) { doc = xmlParseFile(filename_old); if(doc) { mkdir(getLocalDataDir().c_str(), S_IRWXU); move_file(filename_old, filename); rmdir(getOldLocalDir().c_str()); } } g_free(filename_old); } if(!doc) { g_free(filename); return false; } cur = xmlDocGetRootElement(doc); if(cur == NULL) { xmlFreeDoc(doc); g_free(filename); 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); struct stat stats; if(stat(filename, &stats) == 0) { if(exchange_rates_time >= stats.st_mtime) { struct utimbuf new_times; struct tm *temptm = localtime(&exchange_rates_time); if(temptm) { struct tm extm = *temptm; time_t time_now = time(NULL); struct tm *newtm = localtime(&time_now); if(newtm && newtm->tm_mday != extm.tm_mday) { newtm->tm_hour = extm.tm_hour; newtm->tm_min = extm.tm_min; newtm->tm_sec = extm.tm_sec; exchange_rates_time = mktime(newtm); } else { time(&exchange_rates_time); } } else { time(&exchange_rates_time); } new_times.modtime = exchange_rates_time; utime(filename, &new_times); } else { exchange_rates_time = stats.st_mtime; if(exchange_rates_time > exchange_rates_check_time) exchange_rates_check_time = exchange_rates_time; } } g_free(filename); return true; } bool Calculator::hasGVFS() { if(has_gvfs >= 0) return has_gvfs > 0; gchar *gstr = g_find_program_in_path("gvfs-copy"); if(gstr) { g_free(gstr); has_gvfs = 1; return true; } g_free(gstr); has_gvfs = 0; return has_gvfs > 0; } bool Calculator::hasGnomeVFS() { return hasGVFS(); } bool Calculator::canFetch() { if(hasGVFS()) 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() { gchar *filename = g_build_filename(getLocalDataDir().c_str(), "eurofxref-daily.xml", NULL); string str = filename; g_free(filename); return str; } time_t Calculator::getExchangeRatesTime() { return exchange_rates_time; } string Calculator::getExchangeRatesUrl() { return "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"; } bool Calculator::fetchExchangeRates(int timeout, string wget_args) { int status = 0; mkdir(getLocalDataDir().c_str(), S_IRWXU); string cmdline; gchar *filename = g_build_filename(getLocalDataDir().c_str(), "eurofxref-daily.xml", NULL); if(hasGVFS()) { cmdline = "gvfs-copy http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"; cmdline += " "; cmdline += filename; } else { cmdline = "wget"; cmdline += " "; cmdline += "--timeout="; cmdline += i2s(timeout); cmdline += " "; cmdline += wget_args; cmdline += " "; cmdline += "--output-document="; cmdline += filename; cmdline += " "; cmdline += "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"; } g_free(filename); 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(unsigned int n_days, bool force_check, bool send_warning) { if(exchange_rates_time > 0 && ((!force_check && exchange_rates_check_time > 0 && difftime(time(NULL), exchange_rates_check_time) < 86400 * n_days) || difftime(time(NULL), exchange_rates_time) < (86400 * n_days) + 3600)) return true; time(&exchange_rates_check_time); if(send_warning) error(false, _("It has been %s day(s) since the exchange rates last were updated."), i2s((int) floor(difftime(time(NULL), exchange_rates_time) / 86400)).c_str(), NULL); return false; } void Calculator::setExchangeRatesWarningEnabled(bool enable) { b_exchange_rates_warning_enabled = enable; } bool Calculator::exchangeRatesWarningEnabled() const { return b_exchange_rates_warning_enabled; } bool Calculator::exchangeRatesUsed() const { return b_exchange_rates_used; } void Calculator::resetExchangeRatesUsed() { b_exchange_rates_used = false; } void Calculator::setExchangeRatesUsed() { b_exchange_rates_used = true; if(b_exchange_rates_warning_enabled) checkExchangeRatesDate(7, false, true); } 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 homedir = getLocalTmpDir(); 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.rfind("."); 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 += ","; } string filename = "gnuplot_data"; filename += i2s(i + 1); gchar *filepath = g_build_filename(homedir.c_str(), filename.c_str(), NULL); plot += "\""; plot += filepath; plot += "\""; g_free(filepath); 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 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()) { string filename = "gnuplot_data"; filename += i2s(serie + 1); gchar *filepath = g_build_filename(homedir.c_str(), filename.c_str(), NULL); FILE *fdata = fopen(filepath, "w+"); if(!fdata) { error(true, _("Could not create temporary file %s"), filepath, NULL); g_free(filepath); return false; } plot_data = ""; int non_numerical = 0, non_real = 0; string str = ""; startPrintControl(5000); 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(printingAborted()) { fclose(fdata); g_free(filepath); error(true, _("It took too long to generate the plot data."), NULL); stopPrintControl(); return false; } } stopPrintControl(); 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); g_free(filepath); } } 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.10/libqalculate/util.cc0000644000175000017500000004732512734741231015131 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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 #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, void *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); if(equalsIgnoreCase(str, _("today")) || equalsIgnoreCase(str, "today") || equalsIgnoreCase(str, _("now")) || equalsIgnoreCase(str, "now")) { g_date_set_time_t((GDate*) gtime, time(NULL)); return true; } else if(equalsIgnoreCase(str, _("tomorrow")) || equalsIgnoreCase(str, "tomorrow")) { g_date_set_time_t((GDate*) gtime, time(NULL)); g_date_add_days((GDate*) gtime, 1); return true; } else if(equalsIgnoreCase(str, _("yesterday")) || equalsIgnoreCase(str, "yesterday")) { g_date_set_time_t((GDate*) gtime, time(NULL)); g_date_subtract_days((GDate*) gtime, 1); return true; } g_date_set_parse((GDate*) gtime, str.c_str()); return g_date_valid((GDate*) 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_t(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(); int week = -1; if(s2date(str, gtime)) { 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(); int day = -1; if(s2date(str, gtime)) { 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(); int day = -1; if(s2date(str, gtime)) { 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); GDate *gtime = g_date_new(); if(s2date(str, gtime)) { /* 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 getOldLocalDir() { gchar *gstr = g_build_filename(g_get_home_dir(), ".qalculate", NULL); string homedir = gstr; g_free(gstr); return homedir; } string getLocalDir() { gchar *gstr = g_build_filename(g_get_user_config_dir(), "qalculate", NULL); string confdir = gstr; g_free(gstr); return confdir; } string getLocalDataDir() { gchar *gstr = g_build_filename(g_get_user_data_dir(), "qalculate", NULL); string datadir = gstr; g_free(gstr); return datadir; } string getLocalTmpDir() { gchar *gstr = g_build_filename(g_get_tmp_dir(), "qalculate", NULL); string tmpdir = gstr; g_free(gstr); return tmpdir; } bool move_file(const char *from_file, const char *to_file) { ifstream source(from_file); if(source.fail()) { source.close(); return false; } ofstream dest(to_file); if(dest.fail()) { source.close(); dest.close(); return false; } dest << source.rdbuf(); source.close(); dest.close(); struct stat stats_from; if(stat(from_file, &stats_from) == 0) { struct utimbuf to_times; to_times.actime = stats_from.st_atime; to_times.modtime = stats_from.st_mtime; utime(to_file, &to_times); } remove(from_file); return true; } libqalculate-0.9.10/libqalculate/Function.cc0000644000175000017500000016520112747054073015740 00000000000000/* Qalculate Copyright (C) 2008 Hanna Knutsson (hanna_k@fmgirl.com) 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" #if HAVE_UNORDERED_MAP # include #elif defined(__GNUC__) # ifndef __has_include # define __has_include(x) 0 # endif # if (defined(__clang__) && __has_include()) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) # include namespace Sgi = std; # define unordered_map std::tr1::unordered_map # else # 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 # define unordered_map Sgi::hash_map # endif #else // ... there are other compilers, right? namespace Sgi = std; # define unordered_map Sgi::hash_map #endif class MathFunction_p { public: unordered_map argdefs; }; 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) { priv = new MathFunction_p; 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) { priv = new MathFunction_p; set(function); } MathFunction::MathFunction() { priv = new MathFunction_p; argc = 0; max_argc = 0; last_argdef_index = 0; } MathFunction::~MathFunction() { clearArgumentDefinitions(); delete priv; } 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 = priv->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 = priv->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(priv->argdefs.find(index) != priv->argdefs.end()) { return priv->argdefs[index]; } return NULL; } void MathFunction::clearArgumentDefinitions() { for(unordered_map::iterator it = priv->argdefs.begin(); it != priv->argdefs.end(); ++it) { delete it->second; } priv->argdefs.clear(); last_argdef_index = 0; setChanged(true); } void MathFunction::setArgumentDefinition(size_t index, Argument *argdef) { if(priv->argdefs.find(index) != priv->argdefs.end()) { delete priv->argdefs[index]; } priv->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(unordered_map::iterator it = priv->argdefs.begin(); it != priv->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 && priv->argdefs.find(last) != priv->argdefs.end()) { for(size_t i = last + 1; i <= vargs.size(); i++) { if(!priv->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.precision() < 1)) mstruct.setPrecision(precision(), true); if(isApproximate()) mstruct.setApproximate(true, true); 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(), true); if(isApproximate()) mstruct.setApproximate(true, true); } else { CALCULATOR->parse(&mstruct, sformula_calc, po); if(precision() > 0) mstruct.setPrecision(precision(), true); if(isApproximate()) mstruct.setApproximate(true, true); } 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); if(po.angle_unit != ANGLE_UNIT_NONE) { if(mstruct->contains(CALCULATOR->getDegUnit(), false, true, true) > 0) return; if(mstruct->contains(CALCULATOR->getGraUnit(), false, true, true) > 0) return; if(mstruct->contains(CALCULATOR->getRadUnit(), false, true, true) > 0) return; } 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.10/libqalculate/DataSet.cc0000644000175000017500000010454412712157616015502 00000000000000/* Qalculate (library) Copyright (C) 2004-2006, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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 #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) { if(file_name) { } else if(sfile.empty()) { return false; } else if(sfile.find(G_DIR_SEPARATOR_S) != string::npos) { bool b = loadObjects(file_name, false); size_t i = sfile.find_last_of(G_DIR_SEPARATOR_S); if(i != sfile.length() - 1) { gchar *filepath = g_build_filename(getLocalDataDir().c_str(), "definitions", "datasets", sfile.substr(i + 1, sfile.length() - (i + 1)).c_str(), NULL); if(loadObjects(filepath, true)) { b = true; } else { gchar *filepath_old = g_build_filename(getOldLocalDir().c_str(), "definitions", "datasets", sfile.substr(i + 1, sfile.length() - (i + 1)).c_str(), NULL); if(loadObjects(filepath_old, true)) { b = true; mkdir(getLocalDataDir().c_str(), S_IRWXU); gchar *dir = g_build_filename(getLocalDataDir().c_str(), "definitions", NULL); mkdir(dir, S_IRWXU); g_free(dir); dir = g_build_filename(getLocalDataDir().c_str(), "definitions", "datasets", NULL); mkdir(dir, S_IRWXU); g_free(dir); move_file(filepath_old, filepath); dir = g_build_filename(getOldLocalDir().c_str(), "definitions", "datasets", NULL); rmdir(dir); g_free(dir); dir = g_build_filename(getOldLocalDir().c_str(), "definitions", NULL); rmdir(dir); g_free(dir); } g_free(filepath_old); } g_free(filepath); } return b; } else { gchar *filepath = g_build_filename(PACKAGE_DATA_DIR, "qalculate", sfile.c_str(), NULL); bool b = loadObjects(filepath, false); g_free(filepath); filepath = g_build_filename(getLocalDataDir().c_str(), "definitions", "datasets", sfile.c_str(), NULL); if(loadObjects(filepath, true)) { b = true; } else { gchar *filepath_old = g_build_filename(getOldLocalDir().c_str(), "definitions", "datasets", sfile.c_str(), NULL); if(loadObjects(filepath_old, true)) { b = true; mkdir(getLocalDataDir().c_str(), S_IRWXU); gchar *dir = g_build_filename(getLocalDataDir().c_str(), "definitions", NULL); mkdir(dir, S_IRWXU); g_free(dir); dir = g_build_filename(getLocalDataDir().c_str(), "definitions", "datasets", NULL); mkdir(dir, S_IRWXU); g_free(dir); move_file(filepath_old, filepath); dir = g_build_filename(getOldLocalDir().c_str(), "definitions", "datasets", NULL); rmdir(dir); g_free(dir); dir = g_build_filename(getOldLocalDir().c_str(), "definitions", NULL); rmdir(dir); g_free(dir); } g_free(filepath_old); } g_free(filepath); 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(file_name); if(doc == NULL) { if(!is_user_defs && !isLocal()) { CALCULATOR->error(true, _("Unable to load data objects in %s."), file_name, 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."), file_name, 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."), file_name, 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) { mkdir(getLocalDataDir().c_str(), S_IRWXU); gchar *gstr = g_build_filename(getLocalDataDir().c_str(), "definitions", NULL); mkdir(gstr, S_IRWXU); gchar *gstr2 = g_build_filename(gstr, "datasets", NULL); mkdir(filename.c_str(), S_IRWXU); gchar *gstr3 = g_build_filename(gstr, sfile.c_str(), NULL); filename = gstr3; g_free(gstr); g_free(gstr2); g_free(gstr3); } 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.10/libqalculate/DataSet.h0000644000175000017500000002353212706146130015331 00000000000000/* Qalculate (library) Copyright (C) 2004-2006, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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 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.10/libqalculate/qalculate.h0000644000175000017500000000147112705172321015755 00000000000000/* Qalculate Copyright (C) 2003-2005 Hanna Knutsson (hanna_k@fmgirl.com) 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.10/libqalculate/Unit.cc0000644000175000017500000006774012735460416015102 00000000000000/* Qalculate (libary) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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; b_use_with_prefixes = false; } Unit::Unit() { b_si = false; b_use_with_prefixes = 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; b_use_with_prefixes = 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; b_use_with_prefixes = true; } else if(ssystem == "CGS" || ssystem == "cgs" || ssystem == "Cgs") { b_si = false; b_use_with_prefixes = true; } else { b_si = false; } setChanged(true); } } const string &Unit::system() const { return ssystem; } bool Unit::useWithPrefixesByDefault() const { return b_use_with_prefixes; } void Unit::setUseWithPrefixesByDefault(bool use_with_prefixes) { b_use_with_prefixes = use_with_prefixes; } 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() && u->isCurrency() && ((isBuiltin() && this != CALCULATOR->u_euro) || (u->isBuiltin() && u != CALCULATOR->u_euro))) { CALCULATOR->setExchangeRatesUsed(); } 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); if(precision() > 0 && (mvalue.precision() < 1 || precision() < mvalue.precision())) mvalue.setPrecision(precision(), true); if(isApproximate()) mvalue.setApproximate(true, true); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, svalue, po); if(precision() > 0) { if(mstruct->isNumber()) { if(mstruct->number().precision() < 1 || precision() < mstruct->number().precision()) { mstruct->number().setPrecision(precision()); mstruct->numberUpdated(); } } else if(mstruct->isMultiplication() && mstruct->getChild(1)->isNumber()) { if(mstruct->getChild(1)->number().precision() < 1 || precision() < mstruct->getChild(1)->number().precision()) { mstruct->getChild(1)->number().setPrecision(precision()); mstruct->getChild(1)->numberUpdated(); mstruct->childUpdated(1); } } else if(mstruct->precision() < 1 || precision() < mstruct->precision()) { mstruct->setPrecision(precision(), true); } } else if(isApproximate() && !mstruct->isApproximate()) { mstruct->setApproximate(true, true); } 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); if(precision() > 0 && (mvalue.precision() < 1 || precision() < mvalue.precision())) mvalue.setPrecision(precision(), true); if(isApproximate()) mvalue.setApproximate(true, true); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, sinverse, po); if(precision() > 0) { if(mstruct->isNumber()) { if(mstruct->number().precision() < 1 || precision() < mstruct->number().precision()) { mstruct->number().setPrecision(precision()); mstruct->numberUpdated(); } } else if(mstruct->isMultiplication() && mstruct->getChild(1)->isNumber()) { if(mstruct->getChild(1)->number().precision() < 1 || precision() < mstruct->getChild(1)->number().precision()) { mstruct->getChild(1)->number().setPrecision(precision()); mstruct->getChild(1)->numberUpdated(); mstruct->childUpdated(1); } } else if(mstruct->precision() < 1 || precision() < mstruct->precision()) { mstruct->setPrecision(precision(), true); } } else if(isApproximate() && !mstruct->isApproximate()) { mstruct->setApproximate(true, true); } if(!mexp.isOne()) mstruct->raise(mexp); mvalue.multiply_nocopy(mstruct, true); } } 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); int y_id = -1; stmp2 += i2s(x_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\x", stmp2, stmp); if(svalue.find("\\y") != string::npos) { stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; 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); if(y_id < 0) { mvalue.raise(mexp); } else { CALCULATOR->delId(y_id); } if(precision() > 0 && (mvalue.precision() < 1 || precision() < mvalue.precision())) mvalue.setPrecision(precision(), true); if(isApproximate()) mvalue.setApproximate(true, true); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, svalue, po); if(precision() > 0) { if(mstruct->isNumber()) { if(mstruct->number().precision() < 1 || precision() < mstruct->number().precision()) { mstruct->number().setPrecision(precision()); mstruct->numberUpdated(); } } else if(mstruct->isMultiplication() && mstruct->getChild(1)->isNumber()) { if(mstruct->getChild(1)->number().precision() < 1 || precision() < mstruct->getChild(1)->number().precision()) { mstruct->getChild(1)->number().setPrecision(precision()); mstruct->getChild(1)->numberUpdated(); mstruct->childUpdated(1); } } else if(mstruct->precision() < 1 || precision() < mstruct->precision()) { mstruct->setPrecision(precision(), true); } } else if(isApproximate() && !mstruct->isApproximate()) { mstruct->setApproximate(true, true); } if(!mexp.isOne()) mstruct->raise(mexp); mvalue.multiply_nocopy(mstruct, true); } 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, bool set_null_prefixes) const { MathStructure mstruct; bool has_p = set_null_prefixes; if(!set_null_prefixes) { 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 = true; po.convert_temperature_units = 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 if(mstruct[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(mstruct[i][i2].isUnit()) { add(mstruct[i][i2].unit(), 1, mstruct[i][i2].prefix()); } else if(mstruct[i][i2].isPower() && mstruct[i][i2][0].isUnit() && mstruct[i][i2][1].isInteger()) { add(mstruct[i][i2][0].unit(), mstruct[i][i2][1].number().intValue(), mstruct[i][i2][0].prefix()); } else { had_errors = true; } } } 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.10/libqalculate/ExpressionItem.cc0000644000175000017500000003670312721111646017125 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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; if(!b_approx) i_precision = -1; 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.10/libqalculate/Variable.cc0000644000175000017500000003165012725757017015704 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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); } bool set_precision_of_numbers(MathStructure &mstruct, int i_prec) { if(mstruct.isNumber()) { if(i_prec < 1) { if(!mstruct.number().isApproximate()) { mstruct.number().setApproximate(); mstruct.numberUpdated(); } } else if(mstruct.number().precision() < 1 || mstruct.number().precision() < i_prec) { mstruct.number().setPrecision(i_prec); mstruct.numberUpdated(); } return true; } bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(set_precision_of_numbers(mstruct[i], i_prec)) { mstruct.childUpdated(i + 1); b = true; } } return b; } 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) { if(mstruct->precision() < 1 || precision() < mstruct->precision()) { if(!set_precision_of_numbers(*mstruct, precision())) mstruct->setPrecision(precision(), true); } } else if(isApproximate()) { if(!mstruct->isApproximate()) { if(!set_precision_of_numbers(*mstruct, precision())) mstruct->setApproximate(true, true); } } } 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.10/libqalculate/MathStructure.cc0000644000175000017500000163220612757115743016775 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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 #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 REDUCE(v_size) {vector v_tmp; v_tmp.resize(SIZE, 0); for(size_t v_index = v_size; v_index < v_order.size(); v_index++) {v_subs[v_order[v_index]]->unref(); v_subs[v_order[v_index]] = NULL; v_tmp[v_order[v_index]] = 1;} v_order.resize(v_size); for(vector::iterator v_it = v_subs.begin(); v_it != v_subs.end();) {if(*v_it == NULL) v_it = v_subs.erase(v_it); else ++v_it;} size_t i_change = 0; for(size_t v_index = 0; v_index < v_tmp.size(); v_index++) {if(v_tmp[v_index] == 1) i_change++; v_tmp[v_index] = i_change;} for(size_t v_index = 0; v_index < v_order.size(); v_index++) v_order[v_index] -= v_tmp[v_index];} #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; o_variable = NULL; o_function = NULL; o_unit = NULL; o_prefix = 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; if(o_function) o_function->ref(); 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_function) o.function()->ref(); if(o.functionValue()) function_value = new MathStructure(*o.functionValue()); break; } case STRUCT_VARIABLE: { o_variable = o.variable(); if(o_variable) o_variable->ref(); break; } case STRUCT_UNIT: { o_unit = o.unit(); o_prefix = o.prefix(); if(o_unit) o_unit->ref(); 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_function) o_function->ref(); if(o.functionValue()) { function_value = (MathStructure*) o.functionValue(); function_value->ref(); } break; } case STRUCT_VARIABLE: { o_variable = o.variable(); if(o_variable) o_variable->ref(); break; } case STRUCT_UNIT: { o_unit = o.unit(); o_prefix = o.prefix(); if(o_unit) o_unit->ref(); 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, preserve_precision); } 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) { if (sym == "undefined") { setUndefined(true); return; } 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; if(o_function) o_function->ref(); 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; if(o_unit) o_unit->ref(); m_type = STRUCT_UNIT; } void MathStructure::set(Variable *o, bool preserve_precision) { clear(preserve_precision); o_variable = o; if(o_variable) o_variable->ref(); 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::setAborted(bool preserve_precision) { clear(preserve_precision); m_type = STRUCT_SYMBOLIC; s_sym = _("aborted"); } 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; } if(o_function) o_function->unref(); o_function = NULL; if(o_variable) o_variable->unref(); o_variable = NULL; if(o_unit) o_unit->unref(); 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; } Unit *MathStructure::unit_exp_unit() const { if(isUnit()) return o_unit; if(isPower() && CHILD(0).isUnit()) return CHILD(0).unit(); return NULL; } Prefix *MathStructure::prefix() const { return o_prefix; } Prefix *MathStructure::unit_exp_prefix() const { if(isUnit()) return o_prefix; if(isPower() && CHILD(0).isUnit()) return CHILD(0).prefix(); return NULL; } 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) { if(f) f->ref(); if(o_function) o_function->unref(); o_function = f; } void MathStructure::setUnit(Unit *u) { if(u) u->ref(); if(o_unit) o_unit->unref(); o_unit = u; } void MathStructure::setVariable(Variable *v) { if(v) v->ref(); if(o_variable) o_variable->unref(); 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::isAborted() const {return m_type == STRUCT_SYMBOLIC && s_sym == _("aborted");} 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, bool recursive) { b_approx = is_approx; if(b_approx) { if(i_precision < 1) i_precision = PRECISION; } else { i_precision = -1; } if(recursive) { if(m_type == STRUCT_NUMBER) { o_number.setApproximate(is_approx); } for(size_t i = 0; i < SIZE; i++) { CHILD(i).setApproximate(is_approx, true); } } } bool MathStructure::isApproximate() const { return b_approx; } int MathStructure::precision() const { return i_precision; } void MathStructure::setPrecision(int prec, bool recursive) { i_precision = prec; if(i_precision > 0) b_approx = true; if(recursive) { if(m_type == STRUCT_NUMBER) { o_number.setPrecision(prec); } for(size_t i = 0; i < SIZE; i++) { CHILD(i).setPrecision(prec, 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: { Prefix *p1 = (o_prefix == NULL || o_prefix == CALCULATOR->decimal_null_prefix || o_prefix == CALCULATOR->binary_null_prefix) ? NULL : o_prefix; Prefix *p2 = (o.prefix() == NULL || o.prefix() == CALCULATOR->decimal_null_prefix || o.prefix() == CALCULATOR->binary_null_prefix) ? NULL : o.prefix(); return o_unit == o.unit() && p1 == p2; } 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; } int compare_check_incompability(MathStructure *mtest) { int incomp = 0; int unit_term_count = 0; int not_unit_term_count = 0; int compat_count = 0; bool b_not_number = false; for(size_t i = 0; i < mtest->size(); i++) { if((*mtest)[i].containsType(STRUCT_UNIT, false, true, true) > 0) { unit_term_count++; for(size_t i2 = i + 1; i2 < mtest->size(); i2++) { int b_test = (*mtest)[i].isUnitCompatible((*mtest)[i2]); if(b_test == 0) { incomp = 1; } else if(b_test > 0) { compat_count++; } } if(!b_not_number && !(*mtest)[i].representsNumber(true)) { b_not_number = true; } } else if((*mtest)[i].containsRepresentativeOfType(STRUCT_UNIT, true, true) == 0) { not_unit_term_count++; } else if(!b_not_number && !(*mtest)[i].representsNumber(true)) { b_not_number = true; } } if(b_not_number && unit_term_count > 0) { incomp = -1; } else if(unit_term_count > 0) { if((int) mtest->size() - (unit_term_count + not_unit_term_count) >= unit_term_count - compat_count + (not_unit_term_count > 0)) { incomp = -1; } else if(not_unit_term_count > 0) { incomp = 1; } } return incomp; } 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); int incomp = 0; if(mtest.isAddition()) { incomp = compare_check_incompability(&mtest); } if(incomp > 0) return COMPARISON_RESULT_NOT_EQUAL; if(incomp == 0) { if(mtest.isZero()) return COMPARISON_RESULT_EQUAL; if(mtest.representsPositive(true)) return COMPARISON_RESULT_LESS; if(mtest.representsNegative(true)) return COMPARISON_RESULT_GREATER; if(mtest.representsNonZero(true)) return COMPARISON_RESULT_NOT_EQUAL; if(mtest.representsNonPositive(true)) return COMPARISON_RESULT_EQUAL_OR_LESS; if(mtest.representsNonNegative(true)) return COMPARISON_RESULT_EQUAL_OR_GREATER; } else { bool a_pos = representsPositive(true); bool a_nneg = a_pos || representsNonNegative(true); bool a_neg = !a_nneg && representsNegative(true); bool a_npos = !a_pos && (a_neg || representsNonPositive(true)); bool b_pos = o.representsPositive(true); bool b_nneg = b_pos || o.representsNonNegative(true); bool b_neg = !b_nneg && o.representsNegative(true); bool b_npos = !b_pos && (b_neg || o.representsNonPositive(true)); if(a_pos && b_npos) return COMPARISON_RESULT_NOT_EQUAL; if(a_npos && b_pos) return COMPARISON_RESULT_NOT_EQUAL; if(a_nneg && b_neg) return COMPARISON_RESULT_NOT_EQUAL; if(a_neg && b_nneg) return COMPARISON_RESULT_NOT_EQUAL; } 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); int incomp = 0; if(mtest.isAddition()) { incomp = compare_check_incompability(&mtest); } if(incomp > 0) return COMPARISON_RESULT_NOT_EQUAL; if(incomp == 0) { if(mtest.isZero()) return COMPARISON_RESULT_EQUAL; if(mtest.representsPositive(true)) return COMPARISON_RESULT_LESS; if(mtest.representsNegative(true)) return COMPARISON_RESULT_GREATER; if(mtest.representsNonZero(true)) return COMPARISON_RESULT_NOT_EQUAL; if(mtest.representsNonPositive(true)) return COMPARISON_RESULT_EQUAL_OR_LESS; if(mtest.representsNonNegative(true)) return COMPARISON_RESULT_EQUAL_OR_GREATER; } else { bool a_pos = representsPositive(true); bool a_nneg = a_pos || representsNonNegative(true); bool a_neg = !a_nneg && representsNegative(true); bool a_npos = !a_pos && (a_neg || representsNonPositive(true)); bool b_pos = o.representsPositive(true); bool b_nneg = b_pos || o.representsNonNegative(true); bool b_neg = !b_nneg && o.representsNegative(true); bool b_npos = !b_pos && (b_neg || o.representsNonPositive(true)); if(a_pos && b_npos) return COMPARISON_RESULT_NOT_EQUAL; if(a_npos && b_pos) return COMPARISON_RESULT_NOT_EQUAL; if(a_nneg && b_neg) return COMPARISON_RESULT_NOT_EQUAL; if(a_neg && b_nneg) return COMPARISON_RESULT_NOT_EQUAL; } 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(); return eo.allow_complex && 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 != 0) { 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 == 0 && 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 == 0 && do_append) { transform(STRUCT_MULTIPLICATION); for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } return 1; } } default: { if(eo.expand == 0) 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 == 0) { 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)) { if(mstruct[0].isUnit() && mstruct[0].prefix()) CHILD(0).setPrefix(mstruct[0].prefix()); 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(); b = eo.allow_complex; 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 || containsType(STRUCT_UNIT, true, true) == 0 || (CHILD(0).isUnit() && CHILD(0).unit() == CALCULATOR->u_rad)) && !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 || containsType(STRUCT_UNIT, true, true) == 0 || (isUnit() && unit() == CALCULATOR->u_rad)) && !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.containsType(STRUCT_UNIT, true, true) == 0 || (mstruct.isUnit() && mstruct.unit() == CALCULATOR->u_rad)) && mstruct.representsNonMatrix()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } if(equals(mstruct)) { if(mstruct.isUnit() && mstruct.prefix()) o_prefix = mstruct.prefix(); 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; } } } if(o_number.isRational() && !o_number.isInteger() && !o_number.isZero()) { if(o_number.numeratorIsOne()) { mstruct.number().negate(); o_number.recip(); return 0; } else { Number den = o_number.denominator(); Number exp2 = mstruct.number(); exp2.negate(); o_number = o_number.numerator(); transform(STRUCT_MULTIPLICATION); CHILD(0).calculateRaise(mstruct, eo, this, 0); APPEND(den); CHILD(1).calculateRaise(exp2, eo, this, 1); calculateMultiplyIndex(0, eo, true, mparent, index_this); evalSort(); 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 != 0 && !mstruct.number().isZero()) { bool b = true; bool neg = mstruct.number().isNegative(); Number m(mstruct.number()); m.setNegative(false); if(eo.expand < 0 && SIZE > 1) { Number num_max; switch(SIZE) { case 14: {} case 13: {} case 12: {} case 11: {} case 10: {num_max.set(2, 1); break;} case 9: {} case 8: {num_max.set(3, 1); break;} case 7: {num_max.set(4, 1); break;} case 6: {num_max.set(5, 1); break;} case 5: {num_max.set(7, 1); break;} case 4: {num_max.set(12, 1); break;} case 3: {num_max.set(28, 1); break;} case 2: {num_max.set(150, 1); break;} default: { b = false; break; } } if(b && m.isGreaterThan(num_max)) { b = false; } } if(b) { 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: { bool isResistance = false; switch (CHILD(0).type()) { case STRUCT_MULTIPLICATION: { if(CHILD(0)[1] != 0 && CHILD(0)[1].unit() && CHILD(0)[1].unit()->name().find("ohm") != string::npos) { isResistance = true; } break; } case STRUCT_UNIT: { if (CHILD(0).unit() && CHILD(0).unit()->name().find("ohm") != string::npos) { isResistance = true; } break; } default: {} } if (isResistance) { MathStructure mstruct; for (size_t i = 0; i < SIZE; i++) { MathStructure mtemp(CHILD(i)); mtemp.inverse(); mstruct += mtemp; } mstruct.inverse(); clear(); set(mstruct); break; } 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; bool mtest_new = false; 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); mtest_new = true; } } else { mtest = &CHILD(0); mtest->ref(); } int incomp = 0; if(mtest->isAddition()) { incomp = compare_check_incompability(mtest); } if(incomp < 0) { if(mtest_new && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { bool a_pos = CHILD(0).representsPositive(true); bool a_nneg = a_pos || CHILD(0).representsNonNegative(true); bool a_neg = !a_nneg && CHILD(0).representsNegative(true); bool a_npos = !a_pos && (a_neg || CHILD(0).representsNonPositive(true)); bool b_pos = CHILD(1).representsPositive(true); bool b_nneg = b_pos || CHILD(1).representsNonNegative(true); bool b_neg = !b_nneg && CHILD(1).representsNegative(true); bool b_npos = !b_pos && (b_neg || CHILD(1).representsNonPositive(true)); if((a_pos && b_npos) || (a_npos && b_pos) || (a_nneg && b_neg) || (a_neg && b_nneg)) { incomp = 1; } } else { mtest->unref(); break; } } switch(ct_comp) { case COMPARISON_EQUALS: { if(incomp > 0) { 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 > 0) { 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 > 0) { } 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 > 0) { } 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 > 0) { } 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 > 0) { } 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; 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--; break; } } } else { if(compare_delete(mnum[i], mden, erase1, erase2, eo)) { if(erase1) mnum.delChild(i + 1); if(erase2) mden.set(1, 1); 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); break; } } } else { if(compare_delete(mnum, mden, erase1, erase2, eo)) { if(erase1) mnum.set(1, 1); if(erase2) mden.set(1, 1); } } 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); } if(eo.expand != 0 && !containsType(STRUCT_COMPARISON, true, true, true)) { unformat(eo); eo3.expand = -1; 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 != 0 || (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, const sym_desc_vec &sym_stats, size_t var_i, 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, const sym_desc_vec &sym_stats, size_t var_i, 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, const sym_desc_vec &sym_stats, size_t var_i); 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, const sym_desc_vec &sym_stats, size_t var_i, const EvaluationOptions &eo) { if(var_i >= sym_stats.size()) return false; 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, sym_stats, var_i, 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_stats2; get_symbol_stats(mnum, mden[i], sym_stats2); if(!divide_in_z(qbar, mden[i], mquotient, sym_stats2, 0, eo)) return false; qbar = mquotient; } return true; } const MathStructure &xvar = sym_stats[var_i].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, sym_stats, var_i + 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, const sym_desc_vec &sym_stats, size_t var_i, const EvaluationOptions &eo) { if(var_i >= sym_stats.size()) return false; const MathStructure &xvar = sym_stats[var_i].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, NULL, NULL, 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, sym_stats, var_i, 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, sym_stats, var_i + 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 &sym_stats, size_t var_i) { if(var_i >= sym_stats.size()) return false; 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 = sym_stats[var_i].sym; Number nr_gc; integer_content(m1, nr_gc); Number nr_rgc; integer_content(m2, nr_rgc); // std::cout << " ic1: " << nr_gc.print() << " ic2: " << nr_rgc.print() << std::endl; nr_gc.gcd(nr_rgc); nr_rgc = nr_gc; nr_rgc.recip(); // std::cout << "HEUR nr_gc: " << nr_gc.print() << " nr_rgc: " << nr_rgc.print() << std::endl; MathStructure p(m1); p.calculateMultiply(nr_rgc, eo); MathStructure q(m2); q.calculateMultiply(nr_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, sym_stats, var_i + 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, sym_stats, var_i, eo) && divide_in_z(q, mgcd, cb ? *cb : dummy, sym_stats, var_i, eo)) { mgcd.calculateMultiply(nr_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); if(sym_stats.empty()) return false; size_t var_i = 0; const MathStructure &xvar = sym_stats[var_i].sym; Number ldeg_a(sym_stats[var_i].ldeg_a); Number ldeg_b(sym_stats[var_i].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(sym_stats[var_i].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(sym_stats[var_i].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, sym_stats, var_i)) { sr_gcd(m1, m2, mresult, sym_stats, var_i, 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]); b_pow = false; } 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, bool merge_precision) { if(index > 0 && index <= SIZE) { CHILD(index - 1).set(o, merge_precision); CHILD_UPDATED(index - 1); } } void MathStructure::setChild_nocopy(MathStructure *o, size_t index, bool merge_precision) { if(index > 0 && index <= SIZE) { MathStructure *o_prev = v_subs[v_order[index - 1]]; if(merge_precision) { if(!o->isApproximate() && o_prev->isApproximate()) o->setApproximate(true); if(o_prev->precision() > 0 && (o->precision() < 1 || o_prev->precision() < o->precision())) o->setPrecision(o_prev->precision()); } o_prev->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; } bool use_prefix_with_unit(Unit *u, const PrintOptions &po) { if(po.prefix) return true; if(u->isCurrency()) return po.use_prefixes_for_currencies; if(po.use_prefixes_for_all_units) return true; return u->useWithPrefixesByDefault(); } bool use_prefix_with_unit(const MathStructure &mstruct, const PrintOptions &po) { if(mstruct.isUnit()) return use_prefix_with_unit(mstruct.unit(), po); if(mstruct.isUnit_exp()) return use_prefix_with_unit(mstruct[0].unit(), po); return false; } bool has_prefix(const MathStructure &mstruct) { if(mstruct.isUnit()) return mstruct.prefix() != NULL; for(size_t i = 0; i < mstruct.size(); i++) { if(has_prefix(mstruct[i])) return true; } 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).unit_exp_prefix()) { b = false; return; } if(!b) { if(use_prefix_with_unit(CHILD(i2), po)) { b = true; if(i > i2) {i = i2; b_im = false;} } 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].unit_exp_prefix()) { b = false; return; } if(!b) { if(use_prefix_with_unit(CHILD(i2)[0][i3], po)) { 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) { 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() && !CHILD(i)[1].number().isZero()) { if(b_im && munit->isPower()) { if((*munit)[1].isNumber() && (*munit)[1].number().isInteger() && !(*munit)[1].number().isZero()) { 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() && use_prefix_with_unit(CHILD(i2)[0], po)) { 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()) { bool b_break = false; for(size_t im2 = 0; im2 < CHILD(i2)[0].size(); im2++) { if(CHILD(i2)[0][im2].isUnit_exp() && use_prefix_with_unit(CHILD(i2)[0][im2], po) && (CHILD(i2)[0][im2].isUnit() || (CHILD(i2)[0][im2][1].isNumber() && (CHILD(i2)[0][im2][1].number().isPositive() || (!b && 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(); } b_break = true; 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; } } if(b_break) break; } } } } else if(exp.isNegative() && b) { bool had_unit = false; for(size_t i2 = i + 1; i2 < SIZE; i2++) { bool b3 = false; if(CHILD(i2).isPower() && CHILD(i2)[1].isNumber() && CHILD(i2)[1].number().isPositive()) { if(CHILD(i2)[0].isUnit()) { if(!use_prefix_with_unit(CHILD(i2)[0], po)) { had_unit = true; } else { munit2 = &CHILD(i2); if(munit2->prefix() || !CHILD(i2)[1].number().isInteger()) { break; } b3 = true; exp2 = exp; exp = CHILD(i2)[1].number(); } } else if(CHILD(i2)[0].isMultiplication()) { bool b_break = false; 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().isPositive() && CHILD(i2)[0][im2][1].number().isInteger()))) { if(!use_prefix_with_unit(CHILD(i2)[0][im2], po)) { had_unit = true; } else { 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(); } b_break = true; if(munit2->prefix() || !CHILD(i2)[1].number().isInteger()) { break; } exp2 = exp; exp = CHILD(i2)[1].number(); exp *= exp_multi; b3 = true; break; } } } if(b_break) break; } } else if(CHILD(i2).isUnit()) { if(!use_prefix_with_unit(CHILD(i2), po)) { had_unit = true; } else { if(CHILD(i2).prefix()) break; 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; } had_unit = false; break; } } if(had_unit && !po.use_denominator_prefix) b = false; } 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() && CHILD(0).number().isLessThanOrEqualTo(Number(1, 1, 1000)) && CHILD(0).number().isGreaterThanOrEqualTo(Number(1, 1, -1000)) && 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.use_unit_prefixes) && (po.prefix != CALCULATOR->decimal_null_prefix && po.prefix != CALCULATOR->binary_null_prefix)) { 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() && !CHILD(0).prefix() && !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: { if(po.prefix || !has_prefix(*this)) { 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(CALCULATOR->printingAborted()) print_str = CALCULATOR->printingAbortedMessage(); 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::setPrefixForUnit(Unit *u, Prefix *new_prefix) { if(m_type == STRUCT_UNIT && o_unit == u) { if(o_prefix != new_prefix) { Number new_value(1, 1); if(o_prefix) new_value = o_prefix->value(); if(new_prefix) new_value.divide(new_prefix->value()); o_prefix = new_prefix; multiply(new_value); return true; } return false; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).setPrefixForUnit(u, new_prefix)) { CHILD_UPDATED(i); b = true; } } return b; } bool MathStructure::convert(Unit *u, bool convert_complex_relations, bool *found_complex_relations, bool calculate_new_functions, const EvaluationOptions &feo, Prefix *new_prefix) { bool b = false; if(m_type == STRUCT_UNIT && o_unit == u) { if((new_prefix || o_prefix) && o_prefix != new_prefix) { Number new_value(1, 1); if(o_prefix) new_value = o_prefix->value(); if(new_prefix) new_value.divide(new_prefix->value()); o_prefix = new_prefix; multiply(new_value); return true; } return false; } if(u->subtype() == SUBTYPE_COMPOSITE_UNIT && !(m_type == STRUCT_UNIT && o_unit->baseUnit() == u)) { return convert(((CompositeUnit*) u)->generateMathStructure(false, true), 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, new_prefix); return true; } MathStructure *exp = new MathStructure(1, 1); MathStructure *mstruct = new MathStructure(1, 1); if(o_prefix) { mstruct->set(o_prefix->value()); } if(u->convert(o_unit, *mstruct, *exp)) { o_unit = u; o_prefix = new_prefix; if(new_prefix) { divide(new_prefix->value()); } 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; bool b_p = false; if(CHILD(b_c).isPower()) { if(CHILD(b_c)[0].testDissolveCompositeUnit(u)) { convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix); return true; } exp = CHILD(b_c)[1]; u2 = CHILD(b_c)[0].unit(); if(CHILD(b_c)[0].prefix()) b_p = true; } else { if(CHILD(b_c).testDissolveCompositeUnit(u)) { convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix); return true; } u2 = CHILD(b_c).unit(); if(CHILD(b_c).prefix()) b_p = true; } size_t efc = 0, mfc = 0; if(calculate_new_functions) { efc = exp.countFunctions(); mfc = mstruct.countFunctions(); } if(u->convert(u2, mstruct, exp)) { if(b_p) { unformat(); return convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix); } 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, new_prefix); return true; } MathStructure exp(CHILD(1)); MathStructure mstruct(1, 1); if(CHILD(0).prefix()) { mstruct.set(CHILD(0).prefix()->value()); mstruct.raise(exp); } 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, new_prefix)) { 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, new_prefix)) { 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, new_prefix)) { 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, feo.keep_prefixes ? unit_mstruct.prefix() : NULL)) 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::containsFunction(MathFunction *f, bool structural_only, bool check_variables, bool check_functions) const { if(m_type == STRUCT_FUNCTION && o_function == f) return 1; if(structural_only) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsFunction(f)) return 1; } } else { int ret = 0; if(m_type != STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).containsFunction(f, 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().containsFunction(f, structural_only, check_variables, check_functions); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->containsFunction(f, 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)) { if(mtype == STRUCT_UNIT) return -1; return mtype == 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 - 1, 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) { simplify(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).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.10/libqalculate/MathStructure.h0000644000175000017500000011273212725563031016623 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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(); 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); /** Mark that calculation was aborted. * * @param preserve_precision Preserve the current precision. */ void setAborted(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; Unit *unit_exp_unit() const; Prefix *prefix() const; Prefix *unit_exp_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, bool merge_precision = false); void setChild_nocopy(MathStructure *o, size_t index = 1, bool merge_precision = false); 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 isAborted() 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 recuresive = false); bool isApproximate() const; void setPrecision(int prec, bool recursive = false); 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 setPrefixForUnit(Unit *u, Prefix *new_prefix); 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, Prefix *new_prefix = NULL); 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; int containsFunction(MathFunction *f, bool structural_only = true, 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.10/libqalculate/Unit.h0000644000175000017500000003103512711552604014723 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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; bool b_use_with_prefixes; 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", "CGS", 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 wether prefixes should be used with this unit or not. * * @returns true if the prefixes is appropriate for this unit. */ bool useWithPrefixesByDefault() const; /** Sets wether prefixes are approriate with this unit or not. */ void setUseWithPrefixesByDefault(bool use_with_prefixes); /** 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, bool set_null_prefixes = false) const; virtual void setBaseExpression(string base_expression_); /** Removes all sub/base units. */ virtual void clear(); }; #endif libqalculate-0.9.10/libqalculate/Prefix.h0000644000175000017500000001664512706146356015262 00000000000000/* Qalculate (library) Copyright (C) 2003-2006, 2008, 2016 Hanna Knutsson (hanna_k@fmgirl.com) 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.10/NEWS0000644000175000017500000000001512705146643011667 00000000000000see changeloglibqalculate-0.9.10/ltmain.sh0000644000175000017500000117077112757636727013050 00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 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. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6 package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 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. # 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 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES 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, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do 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 # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >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 "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # 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 "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 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. # 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 3 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, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --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 --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message 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. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # 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= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE 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. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # 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 () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` 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 "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # 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. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # 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 func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # 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= pie_flag= 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) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append 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,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append 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. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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 no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock 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 yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; 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." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/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." $opt_dry_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 func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/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." $opt_dry_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 func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [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: $progname [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 -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler 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: $progname [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: $progname [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: $progname [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 following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [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 -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -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 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -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 -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -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] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) 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: $progname [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." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" 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 -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # 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 else 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 else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" 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" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; 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. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append 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 -e "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. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_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 test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append 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 func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_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 func_basename "$file" destfile=$func_basename_result 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 func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "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) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # 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/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) 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*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; 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 "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # 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. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd 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 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac 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_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= 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 func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result 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 func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_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've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # 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. sed_quote_subst='$sed_quote_subst' # Be 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 variables: generated_by_libtool_version='$macro_version' 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 file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED '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 \"\$file\" | $SED '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 \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ 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 "\ # 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 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} 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 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #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 # define FOPEN_WB "wb" # 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 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ 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]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); 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 = (size_t) (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 (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); 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 (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); 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 * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } 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 (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" 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 func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append 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 dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; 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 func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" 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 # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir 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 func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework 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*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # 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-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext 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 ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append 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 dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; 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 func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" 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. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'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\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. 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 $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; 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 $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append 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 notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; 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 .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # 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 yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else 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 use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # 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 func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" 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. func_append dlprefiles " $lib $dependency_libs" else func_append 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 func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && 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 func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; 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 prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || 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 *"$absdir:"*) ;; *) func_append 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && 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 built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; 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 lib = "$linkmode" && test yes = "$hardcode_into_libs"; 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 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* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' 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 prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; 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 (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; 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 elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; 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 yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; 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 [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; 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 prog = "$linkmode"; 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 unsupported != "$hardcode_direct"; 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 yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; 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 cannot 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 yes = "$module"; 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 no = "$build_old_libs"; 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 lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # 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 "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=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 "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # 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 func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; 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 test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # 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=$1 number_minor=$2 number_revision=$3 # # 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 # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; 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]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; 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]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; 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]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" 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 func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result 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 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; 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 no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; 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 | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "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 func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; 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 "*) ;; *) func_append 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 "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-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 yes = "$build_libtool_need_lc"; then func_append 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. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi 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 "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append 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 ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append 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 func_append 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 ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; 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 ;; esac ;; 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 with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; 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 no = "$build_old_libs"; 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 no = "$allow_undefined"; 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 no = "$build_old_libs"; 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 # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; 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 " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append 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 yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append 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 "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append 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 relink = "$opt_mode" || 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 shift realname=$1 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 func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "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" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && 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 : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # 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 func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result 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~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "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 $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } 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\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && 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 fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( 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 relink = "$opt_mode"; then $opt_dry_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 func_show_eval '${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 func_show_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 yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_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= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${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" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; 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 "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append 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 "*) ;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append 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 yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } 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 func_append 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 func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; 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 "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "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}\" || $lt_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 func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result 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 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # 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 func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$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 eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$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= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "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}\" || $lt_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 func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; 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 "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; 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) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # 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' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_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 no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false 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) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; 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 $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where 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 build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: libqalculate-0.9.10/COPYING0000644000175000017500000004311012705146643012226 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.10/config.sub0000755000175000017500000010622312461125176013160 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-12-03' # 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 3 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, see . # # 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # 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. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # 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 1992-2014 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-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) 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 | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -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*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -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 \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | 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 \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-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-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | 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-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | 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-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # 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 ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; 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 | 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 ;; dicos) basic_machine=i686-pc os=-dicos ;; 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*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 ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-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 ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; 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 ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; 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 ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; 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 | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) 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 | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) 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 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; 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 ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; 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 ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-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[24]aeb | 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. -auroraux) os=-auroraux ;; -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* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -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* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -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* | -es* | -tirtos*) # 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 ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -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 ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) 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 ;; 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 ;; -cnk*|-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.10/INSTALL0000644000175000017500000002202412705146643012225 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.10/po-defs/0000755000175000017500000000000012757636740012622 500000000000000libqalculate-0.9.10/po-defs/Makefile.in0000644000175000017500000003225012757636731014611 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@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 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in ChangeLog DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 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_CLAGS = @CLN_CLAGS@ 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@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ 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_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ 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_build_prefix = @top_build_prefix@ 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu po-defs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu po-defs/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 $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: 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 "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am 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 \ cscopelist-am ctags-am 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 \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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.10/po-defs/Makefile.am0000644000175000017500000000011212705146643014557 00000000000000# # po-defs/Makefile.am for qalculate # EXTRA_DIST = \ POTFILES.in *.po libqalculate-0.9.10/po-defs/POTFILES.in0000644000175000017500000000036212705146643014307 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.10/po-defs/ChangeLog0000644000175000017500000000000012705146643014271 00000000000000libqalculate-0.9.10/po-defs/zh_CN.po0000644000175000017500000047424412724334520014103 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: 2016-06-03 15:10+0200\n" "PO-Revision-Date: 2007-08-04 23:40+0800\n" "Last-Translator: Roy Qu \n" "Language-Team: Simplified Chinese\n" "Language: \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 "Currency" msgstr "货币" #: ../data/currencies.xml.in.h:2 msgid "European Euros" msgstr "欧元" #: ../data/currencies.xml.in.h:3 msgid "ar:EUR,au:€,euro,p:euros" msgstr "ar:EUR,au:€,欧元" #: ../data/currencies.xml.in.h:4 msgid "U.S. Dollars" msgstr "美元" #: ../data/currencies.xml.in.h:5 msgid "a:$,ar:USD,dollar,p:dollars" msgstr "a:$,ar:USD,美元" #: ../data/currencies.xml.in.h:6 msgid "Japanese Yen" msgstr "日元" #: ../data/currencies.xml.in.h:7 msgid "ar:JPY,au:¥,yen" msgstr "ar:JPY,au:¥,日元" #: ../data/currencies.xml.in.h:8 msgid "Danish Kroner" msgstr "丹麦Kroner" #: ../data/currencies.xml.in.h:9 msgid "ar:DKK" msgstr "" #: ../data/currencies.xml.in.h:10 msgid "British Pounds" msgstr "英镑" #: ../data/currencies.xml.in.h:11 msgid "ar:GBP,au:£" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:12 msgid "Thai Baht" msgstr "泰国Bat" #: ../data/currencies.xml.in.h:13 msgid "ar:THB" msgstr "" #: ../data/currencies.xml.in.h:14 msgid "Swedish Krona" msgstr "瑞典克郎" #: ../data/currencies.xml.in.h:15 msgid "ar:SEK" msgstr "" #: ../data/currencies.xml.in.h:16 msgid "Swiss Francs" msgstr "瑞士法郎" #: ../data/currencies.xml.in.h:17 msgid "ar:CHF" msgstr "" #: ../data/currencies.xml.in.h:18 msgid "Icelandic Krona" msgstr "冰岛克朗" #: ../data/currencies.xml.in.h:19 msgid "ar:ISK" msgstr "" #: ../data/currencies.xml.in.h:20 msgid "Norwegian Kroner" msgstr "挪威Kroner" #: ../data/currencies.xml.in.h:21 msgid "ar:NOK" msgstr "" #: ../data/currencies.xml.in.h:22 msgid "Bulgarian Lev" msgstr "保加利亚列弗" #: ../data/currencies.xml.in.h:23 msgid "lev,ar:BGN" msgstr "" #: ../data/currencies.xml.in.h:24 msgid "Russian Ruble" msgstr "俄罗斯卢布" #: ../data/currencies.xml.in.h:25 msgid "ar:RUB,au:₽,ruble" msgstr "ar:RUB,au:₽,卢布" #: ../data/currencies.xml.in.h:26 msgid "Philippine Peso" msgstr "" #: ../data/currencies.xml.in.h:27 msgid "ar:PHP,au:₱" msgstr "" #: ../data/currencies.xml.in.h:28 msgid "Malaysian Ringgit" msgstr "马来西亚林吉特" #: ../data/currencies.xml.in.h:29 msgid "ar:MYR" msgstr "" #: ../data/currencies.xml.in.h:30 msgid "Croatian Kuna" msgstr "克罗地亚" #: ../data/currencies.xml.in.h:31 msgid "ar:HRK" msgstr "" #: ../data/currencies.xml.in.h:32 msgid "Yuan Renminbi (PR China)" msgstr "人民币元" #: ../data/currencies.xml.in.h:33 msgid "ar:CNY" msgstr "" #: ../data/currencies.xml.in.h:34 msgid "Indonesian Rupiah" msgstr "印尼卢比" #: ../data/currencies.xml.in.h:35 msgid "ar:IDR,rupiah" msgstr "a:IDR" #: ../data/currencies.xml.in.h:36 msgid "Czech Koruna" msgstr "捷克克朗" #: ../data/currencies.xml.in.h:37 msgid "ar:CZK" msgstr "" #: ../data/currencies.xml.in.h:38 msgid "Hungarian Forint" msgstr "匈牙利福林" #: ../data/currencies.xml.in.h:39 msgid "forint,ar:HUF" msgstr "" #: ../data/currencies.xml.in.h:40 msgid "Polish Zloty" msgstr "波兰兹罗提" #: ../data/currencies.xml.in.h:41 msgid "zloty,ar:PLN" msgstr "" #: ../data/currencies.xml.in.h:42 msgid "Romanian New Leu" msgstr "罗马尼亚新Leu" #: ../data/currencies.xml.in.h:43 msgid "leu,ar:RON" msgstr "" #: ../data/currencies.xml.in.h:44 msgid "Turkish New Lira" msgstr "土耳其新里拉" #: ../data/currencies.xml.in.h:45 msgid "ar:TRY,au:₺" msgstr "" #: ../data/currencies.xml.in.h:46 msgid "Australian Dollars" msgstr "澳大利亚元" #: ../data/currencies.xml.in.h:47 msgid "ar:AUD" msgstr "" #: ../data/currencies.xml.in.h:48 msgid "Canadian Dollars" msgstr "加拿大元" #: ../data/currencies.xml.in.h:49 msgid "ar:CAD" msgstr "" #: ../data/currencies.xml.in.h:50 msgid "Hong Kong Dollars" msgstr "港币" #: ../data/currencies.xml.in.h:51 msgid "ar:HKD" msgstr "" #: ../data/currencies.xml.in.h:52 msgid "New Zealand Dollars" msgstr "新西兰元" #: ../data/currencies.xml.in.h:53 msgid "ar:NZD" msgstr "" #: ../data/currencies.xml.in.h:54 msgid "Singapore Dollars" msgstr "新加坡元" #: ../data/currencies.xml.in.h:55 msgid "ar:SGD" msgstr "" #: ../data/currencies.xml.in.h:56 msgid "South Korean Won" msgstr "韩元" #: ../data/currencies.xml.in.h:57 msgid "ar:KRW,au:₩,won" msgstr "" #: ../data/currencies.xml.in.h:58 msgid "South African Rand" msgstr "南非兰特" #: ../data/currencies.xml.in.h:59 msgid "ar:ZAR" msgstr "" #: ../data/currencies.xml.in.h:60 msgid "Indian Rupee" msgstr "" #: ../data/currencies.xml.in.h:61 msgid "ar:INR,au:₹,rupee" msgstr "" #: ../data/currencies.xml.in.h:62 msgid "Israeli New Sheqel" msgstr "" #: ../data/currencies.xml.in.h:63 msgid "ar:ILS,au:₪,sheqel" msgstr "" #: ../data/currencies.xml.in.h:64 msgid "Mexican Peso" msgstr "" #: ../data/currencies.xml.in.h:65 msgid "ar:MXN" msgstr "" #: ../data/currencies.xml.in.h:66 msgid "Brazilian Real" msgstr "" #: ../data/currencies.xml.in.h:67 msgid "ar:BRL" msgstr "" #: ../data/currencies.xml.in.h:68 msgid "Euro Cent" msgstr "欧元分" #: ../data/currencies.xml.in.h:69 msgid "r:eurocent,p:eurocents" msgstr "r:欧元分" #: ../data/currencies.xml.in.h:70 msgid "Cent (USD)" msgstr "美分" #: ../data/currencies.xml.in.h:71 msgid "au:¢,r:cent,p:cents" msgstr "au:¢,r:美分" #: ../data/currencies.xml.in.h:72 msgid "Belgian Franc" msgstr "比利时法郎" #: ../data/currencies.xml.in.h:73 msgid "ar:BEF" msgstr "" #: ../data/currencies.xml.in.h:74 msgid "Greek Drachma" msgstr "希腊德拉马克" #: ../data/currencies.xml.in.h:75 msgid "ar:GRD,au:₯,drachma" msgstr "" #: ../data/currencies.xml.in.h:76 msgid "French Franc" msgstr "法国法郎" #: ../data/currencies.xml.in.h:77 msgid "ar:FRF,au:₣,franc" msgstr "" #: ../data/currencies.xml.in.h:78 msgid "Italian Lira" msgstr "意大利里拉" #: ../data/currencies.xml.in.h:79 msgid "ar:ITL,au:₤,lira" msgstr "ar:ITL,au:₤,里拉" #: ../data/currencies.xml.in.h:80 msgid "Dutch Guilder" msgstr "荷兰盾" #: ../data/currencies.xml.in.h:81 msgid "ar:NLG,guilder" msgstr "" #: ../data/currencies.xml.in.h:82 msgid "Portuguese Escudo" msgstr "葡萄牙埃斯库多" #: ../data/currencies.xml.in.h:83 msgid "ar:PTE,escudo" msgstr "" #: ../data/currencies.xml.in.h:84 msgid "Deutsche Mark" msgstr "" #: ../data/currencies.xml.in.h:85 msgid "ar:DEM,mark" msgstr "a:DEM,马克" #: ../data/currencies.xml.in.h:86 msgid "Spanish Peseta" msgstr "西班牙比塞塔" #: ../data/currencies.xml.in.h:87 msgid "ar:ESP,au:₧,peseta,p:pesetas" msgstr "" #: ../data/currencies.xml.in.h:88 msgid "Irish Pound" msgstr "爱尔兰镑" #: ../data/currencies.xml.in.h:89 msgid "ar:IEP" msgstr "" #: ../data/currencies.xml.in.h:90 msgid "Luxembourg Franc" msgstr "卢森堡法郎" #: ../data/currencies.xml.in.h:91 msgid "ar:LUF" msgstr "" #: ../data/currencies.xml.in.h:92 msgid "Austrian Schilling" msgstr "奥地利先令" #: ../data/currencies.xml.in.h:93 msgid "ar:ATS,schilling" msgstr "a:ATS,先令" #: ../data/currencies.xml.in.h:94 msgid "Finnish Markka" msgstr "芬兰马克" #: ../data/currencies.xml.in.h:95 msgid "ar:FIM,markka" msgstr "" #: ../data/currencies.xml.in.h:96 msgid "Slovenian Tolar" msgstr "斯洛文尼亚Tolar" #: ../data/currencies.xml.in.h:97 msgid "ar:SIT,tolar" msgstr "" #: ../data/currencies.xml.in.h:98 msgid "Cypriot Pound" msgstr "塞浦路斯镑" #: ../data/currencies.xml.in.h:99 msgid "ar:CYP" msgstr "" #: ../data/currencies.xml.in.h:100 msgid "Estonian Kroon" msgstr "爱沙尼亚克鲁恩" #: ../data/currencies.xml.in.h:101 msgid "ar:EEK,kroon,p:krooni" msgstr "" #: ../data/currencies.xml.in.h:102 msgid "Slovak Koruna" msgstr "斯洛伐克Koruna" #: ../data/currencies.xml.in.h:103 msgid "ar:SKK" msgstr "" #: ../data/currencies.xml.in.h:104 msgid "Maltese Lira" msgstr "马耳他里拉" #: ../data/currencies.xml.in.h:105 msgid "ar:MTL" msgstr "" #: ../data/currencies.xml.in.h:106 msgid "Latvian Lats" msgstr "拉脱维亚 Lats" #: ../data/currencies.xml.in.h:107 msgid "lats,ar:LVL" msgstr "" #: ../data/currencies.xml.in.h:108 msgid "Lithuanian Litas" msgstr "立陶宛Litas" #: ../data/currencies.xml.in.h:109 msgid "litas,ar:LTL" msgstr "" #: ../data/datasets.xml.in.h:1 msgid "Data Sets" msgstr "数据集" #. Data set for chemical elements #: ../data/datasets.xml.in.h:3 msgid "!datasets!Elements" msgstr "元素" #: ../data/datasets.xml.in.h:4 msgid "r:atom" msgstr "" #. Object argument for chemical elements data set #: ../data/datasets.xml.in.h:6 msgid "!datasets!Element" msgstr "元素" #: ../data/datasets.xml.in.h:7 msgid "Symbol" msgstr "符号" #: ../data/datasets.xml.in.h:8 msgid "r:symbol" msgstr "" #. Chemical elements number #: ../data/datasets.xml.in.h:10 msgid "!datasets!Number" msgstr "编号" #. Chemical elements number #: ../data/datasets.xml.in.h:12 msgid "!datasets!r:number" msgstr "编号" #: ../data/datasets.xml.in.h:13 ../data/functions.xml.in.h:574 msgid "Name" msgstr "名称" #: ../data/datasets.xml.in.h:14 msgid "r:name" msgstr "" #: ../data/datasets.xml.in.h:15 msgid "Classification" msgstr "分类" #: ../data/datasets.xml.in.h:16 #, fuzzy 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 Polyatomic Non-Metal 9 Diatomic Non-" "Metal 10 Noble Gas 11 Unknown chemical properties" msgstr "" "一个代表元素族的数字: 1 碱金属 2 硷土金属 3 镧系元素 4 锕系" "元素 5 过渡金属元素 6 金属 7 半金属元素 8 非金属 9 卤" "素 10 惰性气体 11 锕系后元素" #: ../data/datasets.xml.in.h:17 msgid "r:class" msgstr "" #: ../data/datasets.xml.in.h:18 ../data/functions.xml.in.h:352 msgid "Weight" msgstr "重量" #: ../data/datasets.xml.in.h:19 msgid "r:weight,mass" msgstr "" #: ../data/datasets.xml.in.h:20 msgid "Boiling Point" msgstr "沸点" #: ../data/datasets.xml.in.h:21 msgid "r:boiling" msgstr "" #: ../data/datasets.xml.in.h:22 msgid "Melting Point" msgstr "熔点" #: ../data/datasets.xml.in.h:23 msgid "r:melting" msgstr "" #: ../data/datasets.xml.in.h:24 ../data/units.xml.in.h:119 msgid "Density" msgstr "密度" #: ../data/datasets.xml.in.h:25 msgid "Density at 295K" msgstr "295K时的密度" #: ../data/datasets.xml.in.h:26 msgid "r:density" msgstr "" #: ../data/datasets.xml.in.h:27 msgid "X Position" msgstr "X坐标" #: ../data/datasets.xml.in.h:28 msgid "r:x_pos" msgstr "" #: ../data/datasets.xml.in.h:29 msgid "Y Position" msgstr "Y坐标" #: ../data/datasets.xml.in.h:30 msgid "r:y_pos" msgstr "" #: ../data/datasets.xml.in.h:31 msgid "Planets" msgstr "行星" #: ../data/datasets.xml.in.h:32 msgid "r:planet" msgstr "" #: ../data/datasets.xml.in.h:33 msgid "Planet" msgstr "行星" #: ../data/datasets.xml.in.h:34 msgid "Orbital Period (Year)" msgstr "轨道周期(年)" #. Orbital period for planet #: ../data/datasets.xml.in.h:36 msgid "!datasets!r:year" msgstr "年" #: ../data/datasets.xml.in.h:37 msgid "Average Orbital Speed" msgstr "平均归到速度" #: ../data/datasets.xml.in.h:38 msgid "r:speed" msgstr "" #: ../data/datasets.xml.in.h:39 msgid "Eccentricity" msgstr "偏心率" #: ../data/datasets.xml.in.h:40 msgid "r:eccentricity" msgstr "" #: ../data/datasets.xml.in.h:41 msgid "Inclination" msgstr "倾角" #: ../data/datasets.xml.in.h:42 msgid "r:inclination" msgstr "" #: ../data/datasets.xml.in.h:43 msgid "Number of Satellites" msgstr "卫星个数" #: ../data/datasets.xml.in.h:44 msgid "r:satellites" msgstr "" #. Planet mass #: ../data/datasets.xml.in.h:46 msgid "!datasets!Mass" msgstr "质量" #: ../data/datasets.xml.in.h:47 msgid "r:mass" msgstr "" #: ../data/datasets.xml.in.h:48 msgid "Mean Density" msgstr "平均密度" #: ../data/datasets.xml.in.h:49 msgid "Surface Area" msgstr "表面积" #. Surface area of planet #: ../data/datasets.xml.in.h:51 msgid "!datasets!r:area" msgstr "面积" #: ../data/datasets.xml.in.h:52 msgid "Equatorial Gravity" msgstr "赤道重力" #: ../data/datasets.xml.in.h:53 msgid "r:gravity" msgstr "" #: ../data/datasets.xml.in.h:54 msgid "Mean Surface Temperature" msgstr "平均表面温度" #: ../data/datasets.xml.in.h:55 msgid "r:temperature" msgstr "" #: ../data/elements.xml.in.h:1 msgid "Hydrogen" msgstr "氢" #: ../data/elements.xml.in.h:2 msgid "Helium" msgstr "氦" #: ../data/elements.xml.in.h:3 msgid "Lithium" msgstr "锂" #: ../data/elements.xml.in.h:4 msgid "Beryllium" msgstr "铍" #: ../data/elements.xml.in.h:5 msgid "Boron" msgstr "硼" #: ../data/elements.xml.in.h:6 msgid "Carbon" msgstr "碳" #: ../data/elements.xml.in.h:7 msgid "Nitrogen" msgstr "氮" #: ../data/elements.xml.in.h:8 msgid "Oxygen" msgstr "氧" #: ../data/elements.xml.in.h:9 msgid "Fluorine" msgstr "氟" #: ../data/elements.xml.in.h:10 msgid "Neon" msgstr "氖" #: ../data/elements.xml.in.h:11 msgid "Sodium" msgstr "钠" #: ../data/elements.xml.in.h:12 msgid "Magnesium" msgstr "镁" #: ../data/elements.xml.in.h:13 msgid "Aluminum" msgstr "铝" #: ../data/elements.xml.in.h:14 msgid "Silicon" msgstr "硅" #: ../data/elements.xml.in.h:15 msgid "Phosphorus" msgstr "磷" #: ../data/elements.xml.in.h:16 msgid "Sulfur" msgstr "硫" #: ../data/elements.xml.in.h:17 msgid "Chlorine" msgstr "氯" #: ../data/elements.xml.in.h:18 msgid "Argon" msgstr "氩" #: ../data/elements.xml.in.h:19 msgid "Potassium" msgstr "钾" #: ../data/elements.xml.in.h:20 msgid "Calcium" msgstr "钙" #: ../data/elements.xml.in.h:21 msgid "Scandium" msgstr "钪" #: ../data/elements.xml.in.h:22 msgid "Titanium" msgstr "钛" #: ../data/elements.xml.in.h:23 msgid "Vanadium" msgstr "钒" #: ../data/elements.xml.in.h:24 msgid "Chromium" msgstr "铬" #: ../data/elements.xml.in.h:25 msgid "Manganese" msgstr "锰" #: ../data/elements.xml.in.h:26 msgid "Iron" msgstr "铁" #: ../data/elements.xml.in.h:27 msgid "Cobalt" msgstr "钴" #: ../data/elements.xml.in.h:28 msgid "Nickel" msgstr "镍" #: ../data/elements.xml.in.h:29 msgid "Copper" msgstr "铜" #: ../data/elements.xml.in.h:30 msgid "Zinc" msgstr "锌" #: ../data/elements.xml.in.h:31 msgid "Gallium" msgstr "镓" #: ../data/elements.xml.in.h:32 msgid "Germanium" msgstr "锗" #: ../data/elements.xml.in.h:33 msgid "Arsenic" msgstr "砷" #: ../data/elements.xml.in.h:34 msgid "Selenium" msgstr "硒" #: ../data/elements.xml.in.h:35 msgid "Bromine" msgstr "溴" #: ../data/elements.xml.in.h:36 msgid "Krypton" msgstr "氪" #: ../data/elements.xml.in.h:37 msgid "Rubidium" msgstr "铷" #: ../data/elements.xml.in.h:38 msgid "Strontium" msgstr "锶" #: ../data/elements.xml.in.h:39 msgid "Yttrium" msgstr "钇" #: ../data/elements.xml.in.h:40 msgid "Zirconium" msgstr "锆" #: ../data/elements.xml.in.h:41 msgid "Niobium" msgstr "铌" #: ../data/elements.xml.in.h:42 msgid "Molybdenum" msgstr "钼" #: ../data/elements.xml.in.h:43 msgid "Technetium" msgstr "锝" #: ../data/elements.xml.in.h:44 msgid "Ruthenium" msgstr "钌" #: ../data/elements.xml.in.h:45 msgid "Rhodium" msgstr "铑" #: ../data/elements.xml.in.h:46 msgid "Palladium" msgstr "钯" #: ../data/elements.xml.in.h:47 msgid "Silver" msgstr "银" #: ../data/elements.xml.in.h:48 msgid "Cadmium" msgstr "镉" #: ../data/elements.xml.in.h:49 msgid "Indium" msgstr "铟" #: ../data/elements.xml.in.h:50 msgid "Tin" msgstr "锡" #: ../data/elements.xml.in.h:51 msgid "Antimony" msgstr "锑" #: ../data/elements.xml.in.h:52 msgid "Tellurium" msgstr "碲" #: ../data/elements.xml.in.h:53 msgid "Iodine" msgstr "碘" #: ../data/elements.xml.in.h:54 msgid "Xenon" msgstr "氙" #: ../data/elements.xml.in.h:55 msgid "Cesium" msgstr "铯" #: ../data/elements.xml.in.h:56 msgid "Barium" msgstr "钡" #: ../data/elements.xml.in.h:57 msgid "Lanthanum" msgstr "镧" #: ../data/elements.xml.in.h:58 msgid "Cerium" msgstr "铈" #: ../data/elements.xml.in.h:59 msgid "Praseodymium" msgstr "镨" #: ../data/elements.xml.in.h:60 msgid "Neodymium" msgstr "钕" #: ../data/elements.xml.in.h:61 msgid "Promethium" msgstr "钷" #: ../data/elements.xml.in.h:62 msgid "Samarium" msgstr "钐" #: ../data/elements.xml.in.h:63 msgid "Europium" msgstr "铕" #: ../data/elements.xml.in.h:64 msgid "Gadolinium" msgstr "钆" #: ../data/elements.xml.in.h:65 msgid "Terbium" msgstr "铽" #: ../data/elements.xml.in.h:66 msgid "Dysprosium" msgstr "镝" #: ../data/elements.xml.in.h:67 msgid "Holmium" msgstr "钬" #: ../data/elements.xml.in.h:68 msgid "Erbium" msgstr "铒" #: ../data/elements.xml.in.h:69 msgid "Thulium" msgstr "铥" #: ../data/elements.xml.in.h:70 msgid "Ytterbium" msgstr "镱" #: ../data/elements.xml.in.h:71 msgid "Lutetium" msgstr "镥" #: ../data/elements.xml.in.h:72 msgid "Hafnium" msgstr "铪" #: ../data/elements.xml.in.h:73 msgid "Tantalum" msgstr "钽" #: ../data/elements.xml.in.h:74 msgid "Tungsten" msgstr "钨" #: ../data/elements.xml.in.h:75 msgid "Rhenium" msgstr "铼" #: ../data/elements.xml.in.h:76 msgid "Osmium" msgstr "锇" #: ../data/elements.xml.in.h:77 msgid "Iridium" msgstr "铱" #: ../data/elements.xml.in.h:78 msgid "Platinum" msgstr "铂" #: ../data/elements.xml.in.h:79 msgid "Gold" msgstr "金" #. Chemical element #: ../data/elements.xml.in.h:81 msgid "!elements!Mercury" msgstr "汞" #: ../data/elements.xml.in.h:82 msgid "Thallium" msgstr "铊" #: ../data/elements.xml.in.h:83 msgid "Lead" msgstr "铅" #: ../data/elements.xml.in.h:84 msgid "Bismuth" msgstr "铋" #: ../data/elements.xml.in.h:85 msgid "Polonium" msgstr "钋" #: ../data/elements.xml.in.h:86 msgid "Astatine" msgstr "砹" #: ../data/elements.xml.in.h:87 msgid "Radon" msgstr "氡" #: ../data/elements.xml.in.h:88 msgid "Francium" msgstr "钫" #: ../data/elements.xml.in.h:89 msgid "Radium" msgstr "镭" #: ../data/elements.xml.in.h:90 msgid "Actinium" msgstr "锕" #: ../data/elements.xml.in.h:91 msgid "Thorium" msgstr "钍" #: ../data/elements.xml.in.h:92 msgid "Protactinium" msgstr "镤" #: ../data/elements.xml.in.h:93 msgid "Uranium" msgstr "铀" #: ../data/elements.xml.in.h:94 msgid "Neptunium" msgstr "镎" #: ../data/elements.xml.in.h:95 msgid "Plutonium" msgstr "钚" #: ../data/elements.xml.in.h:96 msgid "Americium" msgstr "镅" #: ../data/elements.xml.in.h:97 msgid "Curium" msgstr "锔" #: ../data/elements.xml.in.h:98 msgid "Berkelium" msgstr "锫" #: ../data/elements.xml.in.h:99 msgid "Californium" msgstr "锎" #: ../data/elements.xml.in.h:100 msgid "Einsteinium" msgstr "锿" #: ../data/elements.xml.in.h:101 msgid "Fermium" msgstr "镄" #: ../data/elements.xml.in.h:102 msgid "Mendelevium" msgstr "钔" #: ../data/elements.xml.in.h:103 msgid "Nobelium" msgstr "锘" #: ../data/elements.xml.in.h:104 msgid "Lawrencium" msgstr "铹" #: ../data/elements.xml.in.h:105 msgid "Rutherfordium" msgstr "" #: ../data/elements.xml.in.h:106 msgid "Dubnium" msgstr "" #: ../data/elements.xml.in.h:107 msgid "Seaborgium" msgstr "" #: ../data/elements.xml.in.h:108 msgid "Bohrium" msgstr "" #: ../data/elements.xml.in.h:109 msgid "Hassium" msgstr "" #: ../data/elements.xml.in.h:110 msgid "Meitnerium" msgstr "" #: ../data/elements.xml.in.h:111 msgid "Darmstadtium" msgstr "" #: ../data/elements.xml.in.h:112 msgid "Roentgenium" msgstr "" #: ../data/elements.xml.in.h:113 msgid "Copernicium" msgstr "" #: ../data/elements.xml.in.h:114 msgid "Ununtrium" msgstr "" #: ../data/elements.xml.in.h:115 msgid "Flerovium" msgstr "" #: ../data/elements.xml.in.h:116 msgid "Ununpentium" msgstr "" #: ../data/elements.xml.in.h:117 msgid "Livermorium" msgstr "" #: ../data/elements.xml.in.h:118 msgid "Ununseptium" msgstr "" #: ../data/elements.xml.in.h:119 msgid "Ununoctium" msgstr "" #: ../data/functions.xml.in.h:1 msgid "Matrices & Vectors" msgstr "矩阵与向量" #: ../data/functions.xml.in.h:2 msgid "Construct Vector" msgstr "构造向量" #: ../data/functions.xml.in.h:3 msgid "r:vector" msgstr "" #: ../data/functions.xml.in.h:4 msgid "Returns a vector with listed elements." msgstr "使用列出的元素生成一个向量并返回。" #. Vector/matrix elements #: ../data/functions.xml.in.h:6 msgid "Elements" msgstr "多个元素" #: ../data/functions.xml.in.h:7 msgid "Generate Vector" msgstr "生成向量" #: ../data/functions.xml.in.h:8 msgid "r:genvector" msgstr "" #: ../data/functions.xml.in.h:9 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:10 msgid "Function" msgstr "函数" #: ../data/functions.xml.in.h:11 msgid "Min" msgstr "最小值" #: ../data/functions.xml.in.h:12 msgid "Max" msgstr "最大值" #: ../data/functions.xml.in.h:13 msgid "Dimension / Step size" msgstr "维数/步长" #: ../data/functions.xml.in.h:14 msgid "Variable" msgstr "变量" #: ../data/functions.xml.in.h:15 msgid "Use step size" msgstr "使用步长" #: ../data/functions.xml.in.h:16 msgid "Sort" msgstr "排序" #: ../data/functions.xml.in.h:17 msgid "r:sort" msgstr "" #: ../data/functions.xml.in.h:18 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:19 msgid "Vector" msgstr "向量" #: ../data/functions.xml.in.h:20 msgid "Ascending" msgstr "升序" #: ../data/functions.xml.in.h:21 msgid "Rank" msgstr "" #: ../data/functions.xml.in.h:22 msgid "r:rank" msgstr "" #: ../data/functions.xml.in.h:23 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:24 msgid "Vector Limits" msgstr "向量限" #: ../data/functions.xml.in.h:25 msgid "r:limits" msgstr "" #: ../data/functions.xml.in.h:26 msgid "Returns a part of a vector between two positions." msgstr "返回一个向量两个位置之间的一部分。" #: ../data/functions.xml.in.h:27 msgid "Lower limit" msgstr "下限" #: ../data/functions.xml.in.h:28 msgid "Upper limit" msgstr "上限" #: ../data/functions.xml.in.h:29 msgid "Dimension" msgstr "维数" #: ../data/functions.xml.in.h:30 msgid "r:dimension" msgstr "" #: ../data/functions.xml.in.h:31 msgid "Returns the number of elements in a vector." msgstr "返回一个向量内的元素数量。" #: ../data/functions.xml.in.h:32 msgid "Merge Vectors" msgstr "合并向量" #: ../data/functions.xml.in.h:33 msgid "r:mergevectors" msgstr "" #: ../data/functions.xml.in.h:34 msgid "Returns a vector with the elements from two vectors." msgstr "将两个向量合成一个并返回。" #: ../data/functions.xml.in.h:35 msgid "Vector 1" msgstr "向量1" #: ../data/functions.xml.in.h:36 msgid "Vector 2" msgstr "向量2" #: ../data/functions.xml.in.h:37 msgid "Construct Matrix" msgstr "构造矩阵" #: ../data/functions.xml.in.h:38 msgid "r:matrix" msgstr "" #: ../data/functions.xml.in.h:39 msgid "" "Returns a matrix with specified dimensions and listed elements. Omitted " "elements are set to zero." msgstr "根据指定的维数和列出的元素返回一个矩阵。省略被设为零的元素。" #: ../data/functions.xml.in.h:40 msgid "Rows" msgstr "行" #: ../data/functions.xml.in.h:41 msgid "Columns" msgstr "列" #: ../data/functions.xml.in.h:42 msgid "Convert Matrix to Vector" msgstr "将矩阵转换为向量" #: ../data/functions.xml.in.h:43 msgid "r:matrix2vector" msgstr "" #: ../data/functions.xml.in.h:44 msgid "Puts each element of a matrix in vertical order in a vector." msgstr "将按照垂直顺序将矩阵中的每个元素放到向量中。" #: ../data/functions.xml.in.h:45 msgid "Matrix" msgstr "矩阵" #: ../data/functions.xml.in.h:46 msgid "Matrix Area" msgstr "子矩阵" #. Matrix area #: ../data/functions.xml.in.h:48 msgid "r:area" msgstr "" #: ../data/functions.xml.in.h:49 msgid "Returns a part of a matrix." msgstr "返回矩阵的一部分。" #: ../data/functions.xml.in.h:50 msgid "Start row" msgstr "起始行" #: ../data/functions.xml.in.h:51 msgid "Start column" msgstr "起始列" #: ../data/functions.xml.in.h:52 msgid "End row" msgstr "结束行" #: ../data/functions.xml.in.h:53 msgid "End column" msgstr "结束列" #: ../data/functions.xml.in.h:54 msgid "r:rows" msgstr "" #: ../data/functions.xml.in.h:55 msgid "Returns the number of rows in a matrix." msgstr "返回矩阵中的行数。" #: ../data/functions.xml.in.h:56 msgid "r:columns" msgstr "" #: ../data/functions.xml.in.h:57 msgid "Returns the number of columns in a matrix." msgstr "返回矩阵的列数。" #: ../data/functions.xml.in.h:58 msgid "Extract row as vector" msgstr "将行提取为向量" #: ../data/functions.xml.in.h:59 msgid "r:row" msgstr "" #: ../data/functions.xml.in.h:60 msgid "Returns a row in a matrix as a vector." msgstr "将矩阵的一行作为向量返回。" #: ../data/functions.xml.in.h:61 msgid "Row" msgstr "行" #: ../data/functions.xml.in.h:62 msgid "Extract Column as Vector" msgstr "将列提取为向量" #: ../data/functions.xml.in.h:63 msgid "r:column" msgstr "" #: ../data/functions.xml.in.h:64 msgid "Returns a column in a matrix as a vector." msgstr "将矩阵的一列作为向量返回。" #: ../data/functions.xml.in.h:65 msgid "Column" msgstr "列" #: ../data/functions.xml.in.h:66 msgid "r:elements" msgstr "" #: ../data/functions.xml.in.h:67 msgid "Returns the number of elements in a matrix or vector." msgstr "返回一个矩阵或向量内的元素数目。" #: ../data/functions.xml.in.h:68 msgid "Matrix or vector" msgstr "矩阵或向量" #. Vector/matrix element #: ../data/functions.xml.in.h:70 msgid "Element" msgstr "一个元素" #: ../data/functions.xml.in.h:71 msgid "r:element" msgstr "" #: ../data/functions.xml.in.h:72 msgid "" "Returns the element at specified position in a matrix (row and column) or " "vector (index)." msgstr "返回矩阵(行和列)或向量(下标)指定位置上的元素。" #: ../data/functions.xml.in.h:73 msgid "Matrix/vector" msgstr "矩阵/向量" #: ../data/functions.xml.in.h:74 msgid "Row/index" msgstr "行/下标" #: ../data/functions.xml.in.h:75 msgid "Transpose" msgstr "转置" #: ../data/functions.xml.in.h:76 msgid "r:transpose" msgstr "" #: ../data/functions.xml.in.h:77 msgid "Returns the transpose of a matrix." msgstr "返回矩阵的转置。" #: ../data/functions.xml.in.h:78 msgid "Identity" msgstr "单位矩阵" #: ../data/functions.xml.in.h:79 msgid "r:identity" msgstr "" #: ../data/functions.xml.in.h:80 msgid "" "Returns the identity matrix of a matrix or with specified number of rows/" "columns." msgstr "返回指定行/列数或与指定矩阵同阶的单位矩阵。" #: ../data/functions.xml.in.h:81 msgid "Matrix or rows/columns" msgstr "矩阵或行/列" #: ../data/functions.xml.in.h:82 msgid "Determinant" msgstr "行列式" #: ../data/functions.xml.in.h:83 msgid "r:det" msgstr "" #: ../data/functions.xml.in.h:84 msgid "Calculates the determinant of a matrix." msgstr "计算矩阵的行列式。" #: ../data/functions.xml.in.h:85 msgid "Permanent" msgstr "积和式" #: ../data/functions.xml.in.h:86 msgid "r:permanent" msgstr "" #: ../data/functions.xml.in.h:87 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:88 msgid "Adjugate (Adjoint)" msgstr "伴随矩阵" #: ../data/functions.xml.in.h:89 msgid "r:adj" msgstr "" #: ../data/functions.xml.in.h:90 msgid "Calculates the adjugate or adjoint of a matrix." msgstr "计算矩阵的伴随矩阵" #: ../data/functions.xml.in.h:91 msgid "Cofactor" msgstr "余因子" #: ../data/functions.xml.in.h:92 msgid "r:cofactor" msgstr "" #: ../data/functions.xml.in.h:93 msgid "Calculates the cofactor of the element at specified position." msgstr "计算指定位置元素的余因子。" #: ../data/functions.xml.in.h:94 msgid "Matrix Inverse" msgstr "求逆矩阵" #: ../data/functions.xml.in.h:95 msgid "r:inverse" msgstr "" #: ../data/functions.xml.in.h:96 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:97 msgid "Load CSV File" msgstr "载入CSV文件" #: ../data/functions.xml.in.h:98 msgid "r:load" msgstr "" #: ../data/functions.xml.in.h:99 msgid "Returns a matrix imported from a CSV data file." msgstr "返回从CSV数据文件导入的矩阵" #: ../data/functions.xml.in.h:100 msgid "Filename" msgstr "文件名" #: ../data/functions.xml.in.h:101 msgid "First data row" msgstr "第一行数据" #: ../data/functions.xml.in.h:102 msgid "Separator" msgstr "分隔符" #: ../data/functions.xml.in.h:103 msgid "Export To CSV File" msgstr "导出到CSV文件" #: ../data/functions.xml.in.h:104 msgid "r:export" msgstr "" #: ../data/functions.xml.in.h:105 msgid "Exports a matrix to a CSV data file." msgstr "将矩阵导出到CSV数据文件" #: ../data/functions.xml.in.h:106 msgid "Norm (length)" msgstr "范数(长度)" #: ../data/functions.xml.in.h:107 msgid "r:norm" msgstr "" #: ../data/functions.xml.in.h:108 msgid "Calculates the norm/length of a vector." msgstr "计算向量的范数/长度。" #: ../data/functions.xml.in.h:109 msgid "Cross Product" msgstr "向量积" #: ../data/functions.xml.in.h:110 msgid "r:cross" msgstr "" #: ../data/functions.xml.in.h:111 msgid "Calculates the cross product of two 3-dimensional vectors." msgstr "计算两个三维向量的向量积" #: ../data/functions.xml.in.h:112 msgid "Combinatorics" msgstr "组合学" #: ../data/functions.xml.in.h:113 msgid "Factorial" msgstr "阶乘" #: ../data/functions.xml.in.h:114 msgid "" "Calculates the factorial of an integer. Multiplies 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:115 msgid "r:factorial" msgstr "" #: ../data/functions.xml.in.h:116 msgid "Value" msgstr "值" #: ../data/functions.xml.in.h:117 msgid "Double Factorial" msgstr "双阶乘" #: ../data/functions.xml.in.h:118 msgid "r:factorial2" msgstr "" #: ../data/functions.xml.in.h:119 msgid "" "Calculates the double factorial of an integer. Multiplies 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:120 msgid "Multifactorial" msgstr "多阶乘" #: ../data/functions.xml.in.h:121 msgid "r:multifactorial" msgstr "" #: ../data/functions.xml.in.h:122 msgid "" "Calculates the multifactorial of an integer. Multiplies 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:123 msgid "Binomial Coefficient" msgstr "二项式系数" #: ../data/functions.xml.in.h:124 msgid "r:binomial" msgstr "" #: ../data/functions.xml.in.h:125 msgid "Exponent" msgstr "指数" #: ../data/functions.xml.in.h:126 msgid "Index" msgstr "下标" #: ../data/functions.xml.in.h:127 msgid "Hyperfactorial" msgstr "hyper阶乘" #: ../data/functions.xml.in.h:128 msgid "r:hyperfactorial" msgstr "" #: ../data/functions.xml.in.h:129 msgid "" "Calculates the hyperfactorial of an integer. Multiplies 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:130 msgid "Superfactorial" msgstr "超级阶乘" #: ../data/functions.xml.in.h:131 msgid "r:superfactorial" msgstr "" #: ../data/functions.xml.in.h:132 msgid "" "Calculates the superfactorial of an integer. Multiplies 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:133 msgid "Permutations (Variations)" msgstr "排列" #: ../data/functions.xml.in.h:134 msgid "r:perm,variations" msgstr "" #: ../data/functions.xml.in.h:135 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:136 msgid "Objects" msgstr "对象个数" #: ../data/functions.xml.in.h:137 msgid "Size" msgstr "大小" #: ../data/functions.xml.in.h:138 msgid "Combinations" msgstr "组合" #: ../data/functions.xml.in.h:139 msgid "r:comb" msgstr "" #: ../data/functions.xml.in.h:140 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:141 msgid "Derangements" msgstr "重排数" #: ../data/functions.xml.in.h:142 msgid "r:derangements" msgstr "" #: ../data/functions.xml.in.h:143 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:144 msgid "Number of elements" msgstr "元素个数" #: ../data/functions.xml.in.h:145 msgid "Number Theory" msgstr "数论" #: ../data/functions.xml.in.h:146 msgid "Absolute Value" msgstr "绝对值" #: ../data/functions.xml.in.h:147 msgid "r:abs" msgstr "" #: ../data/functions.xml.in.h:148 msgid "Arithmetics" msgstr "算术" #: ../data/functions.xml.in.h:149 msgid "Signum" msgstr "符号函数" #: ../data/functions.xml.in.h:150 msgid "r:sgn" msgstr "" #. A numerical value #: ../data/functions.xml.in.h:152 msgid "Number" msgstr "数字" #: ../data/functions.xml.in.h:153 msgid "Numerator" msgstr "分子" #: ../data/functions.xml.in.h:154 msgid "r:numerator" msgstr "" #: ../data/functions.xml.in.h:155 msgid "Denominator" msgstr "分母" #: ../data/functions.xml.in.h:156 msgid "r:denominator" msgstr "" #: ../data/functions.xml.in.h:157 msgid "Remainder" msgstr "余数" #: ../data/functions.xml.in.h:158 msgid "r:rem" msgstr "" #: ../data/functions.xml.in.h:159 msgid "Modulus" msgstr "模" #: ../data/functions.xml.in.h:160 msgid "r:mod" msgstr "" #: ../data/functions.xml.in.h:161 msgid "Negate" msgstr "非" #: ../data/functions.xml.in.h:162 msgid "r:neg" msgstr "" #: ../data/functions.xml.in.h:163 msgid "Reciprocal" msgstr "倒数" #: ../data/functions.xml.in.h:164 msgid "r:inv" msgstr "" #: ../data/functions.xml.in.h:165 msgid "Multiply" msgstr "乘" #: ../data/functions.xml.in.h:166 msgid "r:multiply" msgstr "" #: ../data/functions.xml.in.h:167 msgid "Factors" msgstr "因子" #: ../data/functions.xml.in.h:168 msgid "Add" msgstr "加" #: ../data/functions.xml.in.h:169 msgid "r:add" msgstr "" #: ../data/functions.xml.in.h:170 msgid "Terms" msgstr "项" #: ../data/functions.xml.in.h:171 msgid "Subtract" msgstr "减" #: ../data/functions.xml.in.h:172 msgid "r:subtract" msgstr "" #: ../data/functions.xml.in.h:173 msgid "Divide" msgstr "除" #: ../data/functions.xml.in.h:174 msgid "r:divide" msgstr "" #: ../data/functions.xml.in.h:175 msgid "Raise" msgstr "乘方" #: ../data/functions.xml.in.h:176 msgid "r:raise" msgstr "" #: ../data/functions.xml.in.h:177 msgid "Base" msgstr "基/底" #: ../data/functions.xml.in.h:178 msgid "Polynomials" msgstr "多项式" #: ../data/functions.xml.in.h:179 msgid "Coefficient" msgstr "系数" #: ../data/functions.xml.in.h:180 msgid "r:coeff" msgstr "" #: ../data/functions.xml.in.h:181 msgid "Polynomial" msgstr "多项式" #: ../data/functions.xml.in.h:182 msgid "Leading Coefficient" msgstr "首项系数" #: ../data/functions.xml.in.h:183 msgid "r:lcoeff" msgstr "" #: ../data/functions.xml.in.h:184 msgid "Trailing Coefficient" msgstr "末项系数" #: ../data/functions.xml.in.h:185 msgid "r:tcoeff" msgstr "" #: ../data/functions.xml.in.h:186 msgid "Polynomial Degree" msgstr "多项式次数" #: ../data/functions.xml.in.h:187 msgid "r:degree" msgstr "" #: ../data/functions.xml.in.h:188 msgid "Lowest Degree (Valuation)" msgstr "末项次数(估计)" #: ../data/functions.xml.in.h:189 msgid "r:ldegree" msgstr "" #: ../data/functions.xml.in.h:190 msgid "Content Part" msgstr "常数公因子" #: ../data/functions.xml.in.h:191 msgid "r:pcontent" msgstr "" #: ../data/functions.xml.in.h:192 msgid "Primitive Part" msgstr "原始部分" #: ../data/functions.xml.in.h:193 msgid "r:primpart" msgstr "" #: ../data/functions.xml.in.h:194 msgid "Unit Part" msgstr "单位部分" #: ../data/functions.xml.in.h:195 msgid "r:punit" msgstr "" #: ../data/functions.xml.in.h:196 msgid "Greatest Common Divisor" msgstr "最大公约数" #: ../data/functions.xml.in.h:197 msgid "r:gcd" msgstr "" #: ../data/functions.xml.in.h:198 msgid "1st value" msgstr "值1" #: ../data/functions.xml.in.h:199 msgid "2nd value" msgstr "值2" #: ../data/functions.xml.in.h:200 msgid "Least Common Multiple" msgstr "最小公倍数" #: ../data/functions.xml.in.h:201 msgid "r:lcm" msgstr "" #: ../data/functions.xml.in.h:202 msgid "Rounding" msgstr "取整" #: ../data/functions.xml.in.h:203 msgid "Round" msgstr "取整" #: ../data/functions.xml.in.h:204 msgid "r:round" msgstr "" #: ../data/functions.xml.in.h:205 msgid "Round Downwards" msgstr "向下取整" #: ../data/functions.xml.in.h:206 msgid "r:floor" msgstr "" #: ../data/functions.xml.in.h:207 msgid "Round Upwards" msgstr "向上取整" #: ../data/functions.xml.in.h:208 msgid "r:ceil" msgstr "" #: ../data/functions.xml.in.h:209 msgid "Round Towards Zero" msgstr "向零取整" #: ../data/functions.xml.in.h:210 msgid "r:trunc" msgstr "" #: ../data/functions.xml.in.h:211 msgid "Extract Integer Part" msgstr "提取整数部分" #: ../data/functions.xml.in.h:212 msgid "r:int" msgstr "" #: ../data/functions.xml.in.h:213 msgid "Extract Fractional Part" msgstr "提取分数部分" #: ../data/functions.xml.in.h:214 msgid "r:frac" msgstr "" #: ../data/functions.xml.in.h:215 msgid "Number Bases" msgstr "数字进制" #: ../data/functions.xml.in.h:216 msgid "Number Base" msgstr "数字进制" #: ../data/functions.xml.in.h:217 msgid "r:base" msgstr "" #: ../data/functions.xml.in.h:218 msgid "Returns an integer from a number of specified base between 2 and 36" msgstr "返回一个指定进制(2-36之间)数字的值" #: ../data/functions.xml.in.h:219 msgid "Binary" msgstr "二进制" #: ../data/functions.xml.in.h:220 msgid "r:bin" msgstr "" #: ../data/functions.xml.in.h:221 msgid "Returns an integer from a binary number" msgstr "返回一个二进制数字表示的整数值。" #: ../data/functions.xml.in.h:222 msgid "Binary number" msgstr "二进制数" #: ../data/functions.xml.in.h:223 msgid "Octal" msgstr "八进制" #: ../data/functions.xml.in.h:224 msgid "r:oct" msgstr "" #: ../data/functions.xml.in.h:225 msgid "Returns an integer from an octal number" msgstr "返回一个八进制数字表示的整数值。" #: ../data/functions.xml.in.h:226 msgid "Octal number" msgstr "八进制数" #: ../data/functions.xml.in.h:227 msgid "Hexadecimal" msgstr "十六进制" #: ../data/functions.xml.in.h:228 msgid "r:hex" msgstr "" #: ../data/functions.xml.in.h:229 msgid "Returns a value from a hexadecimal number" msgstr "返回一个十六进制数字表示的数值" #: ../data/functions.xml.in.h:230 msgid "Hexadecimal number" msgstr "十六进制数" #: ../data/functions.xml.in.h:231 msgid "Integers" msgstr "整数" #: ../data/functions.xml.in.h:232 msgid "Even" msgstr "偶" #: ../data/functions.xml.in.h:233 msgid "r:even" msgstr "" #: ../data/functions.xml.in.h:234 msgid "Odd" msgstr "奇" #: ../data/functions.xml.in.h:235 msgid "r:odd" msgstr "" #: ../data/functions.xml.in.h:236 msgid "Step Functions" msgstr "阶梯函数" #: ../data/functions.xml.in.h:237 msgid "Heaviside Step Function" msgstr "Heaviside阶梯函数" #: ../data/functions.xml.in.h:238 msgid "r:heaviside" msgstr "" #: ../data/functions.xml.in.h:239 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:240 msgid "Ramp Function" msgstr " 斜坡函数" #: ../data/functions.xml.in.h:241 msgid "r:ramp" msgstr "" #: ../data/functions.xml.in.h:242 msgid "Rectangular Function" msgstr "矩阵函数" #: ../data/functions.xml.in.h:243 msgid "r:rectangular" msgstr "" #: ../data/functions.xml.in.h:244 msgid "Sigmoid Function" msgstr "sigmoid函数" #: ../data/functions.xml.in.h:245 msgid "r:sigmoid" msgstr "" #: ../data/functions.xml.in.h:246 msgid "Logit Transformation" msgstr "Logit变换" #: ../data/functions.xml.in.h:247 msgid "r:logit" msgstr "" #: ../data/functions.xml.in.h:248 msgid "Triangular Function" msgstr "三角函数" #: ../data/functions.xml.in.h:249 msgid "r:triangular" msgstr "" #: ../data/functions.xml.in.h:250 msgid "Analysis" msgstr "分析" #: ../data/functions.xml.in.h:251 msgid "Real Part" msgstr "实部" #: ../data/functions.xml.in.h:252 msgid "r:re" msgstr "" #: ../data/functions.xml.in.h:253 msgid "Complex number" msgstr "复数" #: ../data/functions.xml.in.h:254 msgid "Imaginary Part" msgstr "虚部" #: ../data/functions.xml.in.h:255 msgid "r:im" msgstr "" #: ../data/functions.xml.in.h:256 msgid "Gamma Function" msgstr "γ函数" #: ../data/functions.xml.in.h:257 msgid "r:gamma" msgstr "" #: ../data/functions.xml.in.h:258 msgid "Beta Function" msgstr "β函数" #: ../data/functions.xml.in.h:259 msgid "r:beta" msgstr "" #: ../data/functions.xml.in.h:260 msgid "Exponents & Logarithms" msgstr "指数与对数" #: ../data/functions.xml.in.h:261 msgid "Square Root" msgstr "平方根" #: ../data/functions.xml.in.h:262 msgid "au:√,r:sqrt" msgstr "" #: ../data/functions.xml.in.h:263 msgid "Square" msgstr "正方形" #: ../data/functions.xml.in.h:264 msgid "r:sq" msgstr "" #: ../data/functions.xml.in.h:265 msgid "Exponential (e^x)" msgstr "e的乘方" #: ../data/functions.xml.in.h:266 msgid "r:exp" msgstr "" #: ../data/functions.xml.in.h:267 msgid "Natural Logarithm" msgstr "自然对数" #: ../data/functions.xml.in.h:268 msgid "r:ln" msgstr "" #: ../data/functions.xml.in.h:269 msgid "Base-N Logarithm" msgstr "以n为底的对数" #: ../data/functions.xml.in.h:270 msgid "r:log" msgstr "" #: ../data/functions.xml.in.h:271 msgid "Lambert W Function (Omega Function, Product Log)" msgstr "Lambert W函数(ω函数, Product Log)" #: ../data/functions.xml.in.h:272 msgid "r:lambertw,productlog" msgstr "r:lambertw,productlog" #: ../data/functions.xml.in.h:273 msgid "Returns the inverse function for mx*e^x as ln() does for e^x." msgstr "返回函数mx*e^x的逆函数。" #: ../data/functions.xml.in.h:274 msgid "Base-2 Logarithm" msgstr "以2为底的对数" #: ../data/functions.xml.in.h:275 msgid "rs:log2" msgstr "" #: ../data/functions.xml.in.h:276 msgid "Returns the base n logarithm." msgstr "返回以n为底的对数。" #: ../data/functions.xml.in.h:277 msgid "Base-10 Logarithm" msgstr "以10为底的对数" #: ../data/functions.xml.in.h:278 msgid "rs:log10" msgstr "" #: ../data/functions.xml.in.h:279 msgid "Complex Exponential (Cis)" msgstr "复指数(Cis)" #: ../data/functions.xml.in.h:280 msgid "r:cis" msgstr "" #: ../data/functions.xml.in.h:281 msgid "2 raised the to power X" msgstr "2的乘方" #: ../data/functions.xml.in.h:282 msgid "rs:exp2" msgstr "" #: ../data/functions.xml.in.h:283 msgid "10 raised the to power X" msgstr "10的乘方" #: ../data/functions.xml.in.h:284 msgid "rs:exp10" msgstr "" #: ../data/functions.xml.in.h:285 msgid "Cube Root" msgstr "立方根" #: ../data/functions.xml.in.h:286 msgid "au:∛,r:cbrt" msgstr "" #: ../data/functions.xml.in.h:287 msgid "Nth root" msgstr "N次方根" #: ../data/functions.xml.in.h:288 msgid "r:root" msgstr "" #: ../data/functions.xml.in.h:289 msgid "X raised to the power Y" msgstr "X的Y次方" #: ../data/functions.xml.in.h:290 msgid "r:pow" msgstr "" #: ../data/functions.xml.in.h:291 msgid "Square root (x * pi)" msgstr "平方根(x*π)" #: ../data/functions.xml.in.h:292 msgid "r:sqrtpi" msgstr "" #: ../data/functions.xml.in.h:293 msgid "Returns the non-negative square root of x * pi" msgstr "返回xπ的非负平方根" #: ../data/functions.xml.in.h:294 msgid "Non-negative value" msgstr "非负值" #: ../data/functions.xml.in.h:295 msgid "Trigonometry" msgstr "三角学" #: ../data/functions.xml.in.h:296 msgid "Sine" msgstr "正弦" #: ../data/functions.xml.in.h:297 msgid "r:sin" msgstr "" #: ../data/functions.xml.in.h:298 msgid "Angle" msgstr "角度" #: ../data/functions.xml.in.h:299 msgid "Cosine" msgstr "余弦" #: ../data/functions.xml.in.h:300 msgid "r:cos" msgstr "" #: ../data/functions.xml.in.h:301 msgid "Tangent" msgstr "正切" #: ../data/functions.xml.in.h:302 msgid "r:tan" msgstr "" #: ../data/functions.xml.in.h:303 msgid "Inverse Sine" msgstr "反正弦" #: ../data/functions.xml.in.h:304 msgid "r:asin" msgstr "" #: ../data/functions.xml.in.h:305 msgid "Inverse Cosine" msgstr "反余弦" #: ../data/functions.xml.in.h:306 msgid "r:acos" msgstr "" #: ../data/functions.xml.in.h:307 msgid "Inverse Tangent" msgstr "反正切" #: ../data/functions.xml.in.h:308 msgid "r:atan" msgstr "" #: ../data/functions.xml.in.h:309 msgid "Hyperbolic Sine" msgstr "双曲正弦" #: ../data/functions.xml.in.h:310 msgid "r:sinh" msgstr "" #: ../data/functions.xml.in.h:311 msgid "Hyperbolic Cosine" msgstr "双曲余弦" #: ../data/functions.xml.in.h:312 msgid "r:cosh" msgstr "" #: ../data/functions.xml.in.h:313 msgid "Hyperbolic Tangent" msgstr "双曲正割" #: ../data/functions.xml.in.h:314 msgid "r:tanh" msgstr "" #: ../data/functions.xml.in.h:315 msgid "Inverse Hyperbolic Sine" msgstr "反双曲正弦" #: ../data/functions.xml.in.h:316 msgid "r:asinh" msgstr "" #: ../data/functions.xml.in.h:317 msgid "Inverse Hyperbolic Cosine" msgstr "反双曲余弦" #: ../data/functions.xml.in.h:318 msgid "r:acosh" msgstr "" #: ../data/functions.xml.in.h:319 msgid "Inverse Hyperbolic Tangent" msgstr "反双曲正切" #: ../data/functions.xml.in.h:320 msgid "r:atanh" msgstr "" #: ../data/functions.xml.in.h:321 msgid "Radians to Default Angle Unit" msgstr "将弧度转换到缺省角度单位" #: ../data/functions.xml.in.h:322 msgid "r:radtodef" msgstr "" #: ../data/functions.xml.in.h:323 msgid "Radians" msgstr "弧度" #: ../data/functions.xml.in.h:324 msgid "Secant" msgstr "正割" #: ../data/functions.xml.in.h:325 msgid "r:sec" msgstr "" #: ../data/functions.xml.in.h:326 msgid "Cosecant" msgstr "余割" #: ../data/functions.xml.in.h:327 msgid "r:csc" msgstr "" #: ../data/functions.xml.in.h:328 msgid "Cotangent" msgstr "余切" #: ../data/functions.xml.in.h:329 msgid "r:cot" msgstr "" #: ../data/functions.xml.in.h:330 msgid "Hyperbolic Secant" msgstr "双曲正切" #: ../data/functions.xml.in.h:331 msgid "r:sech" msgstr "" #: ../data/functions.xml.in.h:332 msgid "Hyperbolic Cosecant" msgstr "双曲余割" #: ../data/functions.xml.in.h:333 msgid "r:csch" msgstr "" #: ../data/functions.xml.in.h:334 msgid "Hyperbolic Cotangent" msgstr "双曲余切" #: ../data/functions.xml.in.h:335 msgid "r:coth" msgstr "" #: ../data/functions.xml.in.h:336 msgid "Inverse Secant" msgstr "反正割" #: ../data/functions.xml.in.h:337 msgid "r:asec" msgstr "" #: ../data/functions.xml.in.h:338 msgid "Inverse Cosecant" msgstr "反余割" #: ../data/functions.xml.in.h:339 msgid "r:acsc" msgstr "" #: ../data/functions.xml.in.h:340 msgid "Inverse Cotangent" msgstr "反余切" #: ../data/functions.xml.in.h:341 msgid "r:acot" msgstr "" #: ../data/functions.xml.in.h:342 msgid "Inverse Hyperbolic Secant" msgstr "反双曲正割" #: ../data/functions.xml.in.h:343 msgid "r:asech" msgstr "" #: ../data/functions.xml.in.h:344 msgid "Inverse Hyperbolic Cosecant" msgstr "反双曲余割" #: ../data/functions.xml.in.h:345 msgid "r:acsch" msgstr "" #: ../data/functions.xml.in.h:346 msgid "Inverse Hyperbolic Cotangent" msgstr "反双曲余切" #: ../data/functions.xml.in.h:347 msgid "r:acoth" msgstr "" #: ../data/functions.xml.in.h:348 msgid "Miscellaneous" msgstr "杂项" #: ../data/functions.xml.in.h:349 msgid "Body Mass Index (BMI)" msgstr "体质指数(BMI)" #: ../data/functions.xml.in.h:350 msgid "-r:bmi" msgstr "" #: ../data/functions.xml.in.h:351 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:353 msgid "Length" msgstr "长度" #: ../data/functions.xml.in.h:354 msgid "Riemann Zeta" msgstr "Riemann Zeta" #: ../data/functions.xml.in.h:355 msgid "r:zeta" msgstr "" #: ../data/functions.xml.in.h:356 msgid "Integral point" msgstr "积分点" #: ../data/functions.xml.in.h:357 msgid "Roman Number" msgstr "罗马数字" #: ../data/functions.xml.in.h:358 msgid "r:roman" msgstr "" #: ../data/functions.xml.in.h:359 msgid "Returns the value of a roman number." msgstr "返回罗马数字表示的值。" #: ../data/functions.xml.in.h:360 msgid "Roman number" msgstr "罗马数字" #: ../data/functions.xml.in.h:361 msgid "Kronecker Delta" msgstr "Kronecker Delta" #: ../data/functions.xml.in.h:362 msgid "r:kronecker" msgstr "" #: ../data/functions.xml.in.h:363 msgid "Returns 0 if i != j and 1 if i = j." msgstr "如果i不等于j,返回0;如果i等于j,返回1。" #: ../data/functions.xml.in.h:364 msgid "Value 1 (i)" msgstr "值1(i)" #: ../data/functions.xml.in.h:365 msgid "Value 2 (j)" msgstr "值2(i)" #: ../data/functions.xml.in.h:366 msgid "Fibonacci Number" msgstr "" #: ../data/functions.xml.in.h:367 msgid "r:fibonacci" msgstr "" #: ../data/functions.xml.in.h:368 msgid "Returns the n-th term of the Fibonacci sequence." msgstr "" #: ../data/functions.xml.in.h:369 #, fuzzy msgid "Index (n)" msgstr "下标" #: ../data/functions.xml.in.h:370 msgid "Statistics" msgstr "统计" #: ../data/functions.xml.in.h:371 msgid "Descriptive Statistics" msgstr "描述性统计" #: ../data/functions.xml.in.h:372 msgid "Sum (total)" msgstr "总和" #: ../data/functions.xml.in.h:373 msgid "r:total" msgstr "" #: ../data/functions.xml.in.h:374 msgid "Data" msgstr "数据" #: ../data/functions.xml.in.h:375 msgid "Percentile" msgstr "百分位数" #: ../data/functions.xml.in.h:376 msgid "r:percentile" msgstr "" #: ../data/functions.xml.in.h:378 #, no-c-format msgid "Percentile (%)" msgstr "百分位数(%)" #: ../data/functions.xml.in.h:379 msgid "r:min" msgstr "" #: ../data/functions.xml.in.h:380 msgid "Returns the lowest value." msgstr "返回最小值。" #: ../data/functions.xml.in.h:381 msgid "r:max" msgstr "" #: ../data/functions.xml.in.h:382 msgid "Returns the highest value." msgstr "返回最大值。" #: ../data/functions.xml.in.h:383 msgid "Mode" msgstr "模式" #: ../data/functions.xml.in.h:384 msgid "r:mode" msgstr "" #: ../data/functions.xml.in.h:385 msgid "Returns the most frequently occurring value." msgstr "返回最常出现的值。" #: ../data/functions.xml.in.h:386 msgid "Range" msgstr "范围" #: ../data/functions.xml.in.h:387 msgid "r:range" msgstr "" #: ../data/functions.xml.in.h:388 msgid "Calculates the difference between the min and max value." msgstr "计算最大和最小值之间的差。" #: ../data/functions.xml.in.h:389 msgid "Median" msgstr "中位数" #: ../data/functions.xml.in.h:390 msgid "r:median" msgstr "" #: ../data/functions.xml.in.h:391 msgid "Quartile" msgstr "四分位数" #: ../data/functions.xml.in.h:392 msgid "r:quartile" msgstr "" #: ../data/functions.xml.in.h:393 msgid "Decile" msgstr "十分位数" #: ../data/functions.xml.in.h:394 msgid "r:decile" msgstr "" #: ../data/functions.xml.in.h:395 msgid "Interquartile Range" msgstr "四分位距" #: ../data/functions.xml.in.h:396 msgid "r:iqr" msgstr "" #: ../data/functions.xml.in.h:397 msgid "Calculates the difference between the first and third quartile." msgstr "计算第一和第三四分位数之间的差。" #: ../data/functions.xml.in.h:398 msgid "Number of Samples" msgstr "样本数量" #. Number of samples #: ../data/functions.xml.in.h:400 msgid "r:number" msgstr "" #: ../data/functions.xml.in.h:401 msgid "Returns the number of samples." msgstr "返回样本数量。" #: ../data/functions.xml.in.h:402 msgid "Random Number" msgstr "随机数" #: ../data/functions.xml.in.h:403 msgid "r:rand" msgstr "" #: ../data/functions.xml.in.h:404 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:405 msgid "Ceil" msgstr "顶部值" #: ../data/functions.xml.in.h:406 msgid "Random Number Between Limits" msgstr "在某一范围内的随机数" #: ../data/functions.xml.in.h:407 msgid "r:randbetween" msgstr "" #: ../data/functions.xml.in.h:408 msgid "Returns an integer between (including) bottom and top." msgstr "返回在顶部和底部之间(含底部)的一个整数。" #: ../data/functions.xml.in.h:409 msgid "Bottom" msgstr "底部" #: ../data/functions.xml.in.h:410 msgid "Top" msgstr "顶部" #: ../data/functions.xml.in.h:411 msgid "Means" msgstr "平均" #: ../data/functions.xml.in.h:412 msgid "Mean" msgstr "平均" #: ../data/functions.xml.in.h:413 msgid "r:mean,average" msgstr "" #: ../data/functions.xml.in.h:414 msgid "Harmonic Mean" msgstr "调和平均" #: ../data/functions.xml.in.h:415 msgid "r:harmmean" msgstr "" #: ../data/functions.xml.in.h:416 msgid "Geometric Mean" msgstr "几何平均" #: ../data/functions.xml.in.h:417 msgid "r:geomean" msgstr "" #: ../data/functions.xml.in.h:418 msgid "Trimmed Mean" msgstr "截尾均值" #: ../data/functions.xml.in.h:419 msgid "r:trimmean" msgstr "" #: ../data/functions.xml.in.h:420 msgid "Trimmed percentage (at each end)" msgstr "截尾百分比(在每一端)" #: ../data/functions.xml.in.h:421 msgid "Winsorized Mean" msgstr "Winsorized平均" #: ../data/functions.xml.in.h:422 msgid "r:winsormean" msgstr "" #: ../data/functions.xml.in.h:423 msgid "Winsorized percentage (at each end)" msgstr "Winsorized百分比(在每一端)" #: ../data/functions.xml.in.h:424 msgid "Weighted Mean" msgstr "加权平均" #: ../data/functions.xml.in.h:425 msgid "r:weighmean" msgstr "" #: ../data/functions.xml.in.h:426 msgid "Weights" msgstr "权重" #: ../data/functions.xml.in.h:427 msgid "Quadratic Mean (RMS)" msgstr "均方(RMS)" #: ../data/functions.xml.in.h:428 msgid "r:rms" msgstr "" #: ../data/functions.xml.in.h:429 msgid "Moments" msgstr "统计矩" #: ../data/functions.xml.in.h:430 msgid "Standard Deviation (entire population)" msgstr "标准差(总体)" #: ../data/functions.xml.in.h:431 msgid "r:stdevp" msgstr "" #: ../data/functions.xml.in.h:432 msgid "Standard Deviation (random sampling)" msgstr "标准差(随机采样)" #: ../data/functions.xml.in.h:433 msgid "r:stdev" msgstr "" #: ../data/functions.xml.in.h:434 msgid "Variance (entire population)" msgstr "方差(总体)" #: ../data/functions.xml.in.h:435 msgid "r:varp" msgstr "" #: ../data/functions.xml.in.h:436 msgid "Variance (random sampling)" msgstr "方差(随机样本)" #: ../data/functions.xml.in.h:437 msgid "r:var" msgstr "" #: ../data/functions.xml.in.h:438 msgid "Standard Error" msgstr "标准误差" #: ../data/functions.xml.in.h:439 msgid "r:stderr" msgstr "" #: ../data/functions.xml.in.h:440 msgid "Mean Deviation" msgstr "均差" #: ../data/functions.xml.in.h:441 msgid "r:meandev" msgstr "" #: ../data/functions.xml.in.h:442 msgid "Covariance" msgstr "协方差" #: ../data/functions.xml.in.h:443 msgid "r:cov,r:covar" msgstr "" #: ../data/functions.xml.in.h:444 msgid "Data 1" msgstr "数据1" #: ../data/functions.xml.in.h:445 msgid "Data 2" msgstr "数据2" #: ../data/functions.xml.in.h:446 msgid "Pooled Variance" msgstr "合并方差" #: ../data/functions.xml.in.h:447 msgid "r:poolvar" msgstr "" #: ../data/functions.xml.in.h:448 msgid "Regression" msgstr "回归分析" #: ../data/functions.xml.in.h:449 msgid "Statistical Correlation" msgstr "统计相关" #: ../data/functions.xml.in.h:450 msgid "r:cor" msgstr "" #: ../data/functions.xml.in.h:451 msgid "Pearson's Correlation Coefficient" msgstr "个人相关系数" #: ../data/functions.xml.in.h:452 msgid "r:pearson,r:correl" msgstr "" #: ../data/functions.xml.in.h:453 msgid "Spearman's Rho" msgstr "" #: ../data/functions.xml.in.h:454 msgid "r:spearman" msgstr "" #: ../data/functions.xml.in.h:455 msgid "Durbin-Watson" msgstr "Durbin-Watson" #: ../data/functions.xml.in.h:456 msgid "r:durbinwatson" msgstr "" #: ../data/functions.xml.in.h:457 msgid "Statistical Tests" msgstr "统计测试" #: ../data/functions.xml.in.h:458 msgid "Unpaired T-Test" msgstr "非配对T测试" #: ../data/functions.xml.in.h:459 msgid "r:ttest" msgstr "" #: ../data/functions.xml.in.h:460 msgid "Paired T-Test" msgstr "配对t检验" #: ../data/functions.xml.in.h:461 msgid "r:pttest" msgstr "" #: ../data/functions.xml.in.h:462 msgid "Distribution" msgstr "分布" #: ../data/functions.xml.in.h:463 msgid "Rayleigh Distribution" msgstr "Rayleigh分布" #: ../data/functions.xml.in.h:464 msgid "r:rayleigh" msgstr "" #: ../data/functions.xml.in.h:465 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:466 msgid "X" msgstr "X" #: ../data/functions.xml.in.h:467 msgid "Sigma" msgstr "Sigma" #: ../data/functions.xml.in.h:468 msgid "Rayleigh Tail Distribution" msgstr "Rayleigh尾分布" #: ../data/functions.xml.in.h:469 msgid "r:rayleightail" msgstr "" #: ../data/functions.xml.in.h:470 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:471 msgid "Pareto Distribution" msgstr "Pareto分布" #: ../data/functions.xml.in.h:472 msgid "r:pareto" msgstr "" #: ../data/functions.xml.in.h:473 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:474 msgid "Scale" msgstr "规模" #: ../data/functions.xml.in.h:475 msgid "Logistic Distribution" msgstr "Logistic分布" #: ../data/functions.xml.in.h:476 msgid "r:logistic" msgstr "" #: ../data/functions.xml.in.h:477 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:478 msgid "Date & Time" msgstr "日期与时间" #: ../data/functions.xml.in.h:479 msgid "Days between two dates" msgstr "两个日期之间的天数" #: ../data/functions.xml.in.h:480 msgid "r:days" msgstr "" #: ../data/functions.xml.in.h:481 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:482 msgid "First date" msgstr "第一个日期" #: ../data/functions.xml.in.h:483 msgid "Second date" msgstr "第二个日期" #: ../data/functions.xml.in.h:484 msgid "Day counting basis" msgstr "天数计算基准" #: ../data/functions.xml.in.h:485 msgid "Financial function mode" msgstr "金融函数模式" #: ../data/functions.xml.in.h:486 msgid "Years between two dates" msgstr "两个日期之间相隔的年数" #: ../data/functions.xml.in.h:487 msgid "r:yearfrac" msgstr "" #: ../data/functions.xml.in.h:488 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:489 msgid "Week of Year" msgstr "一年中的第几周" #: ../data/functions.xml.in.h:490 msgid "r:week" msgstr "" #: ../data/functions.xml.in.h:491 msgid "Date" msgstr "日期" #: ../data/functions.xml.in.h:492 msgid "Week begins on Sunday" msgstr "每周从星期天开始" #: ../data/functions.xml.in.h:493 msgid "Day of Week" msgstr "星期中的第几天" #: ../data/functions.xml.in.h:494 msgid "r:weekday" msgstr "" #: ../data/functions.xml.in.h:495 msgid "Month" msgstr "月份" #: ../data/functions.xml.in.h:496 msgid "r:month" msgstr "" #: ../data/functions.xml.in.h:497 msgid "Day of Month" msgstr "月份中的第几天" #: ../data/functions.xml.in.h:498 msgid "r:day" msgstr "" #: ../data/functions.xml.in.h:499 msgid "Year" msgstr "年" #: ../data/functions.xml.in.h:500 msgid "r:year" msgstr "" #: ../data/functions.xml.in.h:501 msgid "Day of Year" msgstr "一年中的第几天" #: ../data/functions.xml.in.h:502 msgid "r:yearday" msgstr "" #: ../data/functions.xml.in.h:503 msgid "Current Time" msgstr "当前时间" #: ../data/functions.xml.in.h:504 msgid "r:time" msgstr "" #: ../data/functions.xml.in.h:505 msgid "Standard Date Format" msgstr "标准日期格式" #: ../data/functions.xml.in.h:506 msgid "r:isodate" msgstr "" #: ../data/functions.xml.in.h:507 msgid "Local Date Format" msgstr "本地日期格式" #: ../data/functions.xml.in.h:508 msgid "r:localdate" msgstr "" #: ../data/functions.xml.in.h:509 msgid "Date to Unix Timestamp" msgstr "将时间转换为Unix时间戳" #: ../data/functions.xml.in.h:510 msgid "r:timestamp" msgstr "" #: ../data/functions.xml.in.h:511 msgid "Unix Timestamp to Date" msgstr "Unix时间戳转换为日期" #: ../data/functions.xml.in.h:512 msgid "r:stamptodate" msgstr "" #: ../data/functions.xml.in.h:513 msgid "Timestamp" msgstr "时间戳" #: ../data/functions.xml.in.h:514 msgid "Add Days" msgstr "加日" #: ../data/functions.xml.in.h:515 msgid "r:addDays" msgstr "" #: ../data/functions.xml.in.h:516 msgid "Days" msgstr "日" #: ../data/functions.xml.in.h:517 msgid "Add Months" msgstr "加月份" #: ../data/functions.xml.in.h:518 msgid "r:addMonths" msgstr "" #: ../data/functions.xml.in.h:519 msgid "Months" msgstr "月份" #: ../data/functions.xml.in.h:520 msgid "Add Years" msgstr "加年" #: ../data/functions.xml.in.h:521 msgid "r:addYears" msgstr "" #: ../data/functions.xml.in.h:522 msgid "Years" msgstr "年" #: ../data/functions.xml.in.h:523 msgid "Add Time" msgstr "加时间" #: ../data/functions.xml.in.h:524 msgid "r:addTime" msgstr "" #: ../data/functions.xml.in.h:525 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:526 ../data/units.xml.in.h:132 msgid "Time" msgstr "时间" #: ../data/functions.xml.in.h:527 msgid "Utilities" msgstr "工具" #: ../data/functions.xml.in.h:528 msgid "ASCII Value" msgstr "ASCII值" #: ../data/functions.xml.in.h:529 msgid "r:code" msgstr "" #: ../data/functions.xml.in.h:530 msgid "Character" msgstr "字符" #: ../data/functions.xml.in.h:531 msgid "ASCII Char" msgstr "ASCII字符" #: ../data/functions.xml.in.h:532 msgid "r:char" msgstr "" #: ../data/functions.xml.in.h:533 msgid "Length of string" msgstr "字符串长度" #: ../data/functions.xml.in.h:534 msgid "r:len" msgstr "" #: ../data/functions.xml.in.h:535 msgid "Text" msgstr "文字" #: ../data/functions.xml.in.h:536 msgid "Concatenate Strings" msgstr "连接字符串" #: ../data/functions.xml.in.h:537 msgid "r:concatenate" msgstr "" #: ../data/functions.xml.in.h:538 msgid "Text string 1" msgstr "文字1" #: ../data/functions.xml.in.h:539 msgid "Text string 2" msgstr "文字2" #: ../data/functions.xml.in.h:540 msgid "Replace" msgstr "替换" #: ../data/functions.xml.in.h:541 msgid "r:replace" msgstr "" #: ../data/functions.xml.in.h:542 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:543 msgid "Expression" msgstr "表达式" #: ../data/functions.xml.in.h:544 msgid "Original value" msgstr "原始值" #: ../data/functions.xml.in.h:545 msgid "New value" msgstr "新值" #: ../data/functions.xml.in.h:546 msgid "Precalculate expression" msgstr "预先计算表达式" #: ../data/functions.xml.in.h:547 msgid "Strip Units" msgstr "剥离单位" #: ../data/functions.xml.in.h:548 msgid "r:nounit,strip_units" msgstr "" #: ../data/functions.xml.in.h:549 msgid "" "Removes all units from an expression. The expression is calculated before " "the removal." msgstr "从表达式中删除全部单位。在删除之前会先对表达式进行计算。" #: ../data/functions.xml.in.h:550 msgid "Process Vector Elements" msgstr "处理向量元素" #: ../data/functions.xml.in.h:551 msgid "r:process" msgstr "" #: ../data/functions.xml.in.h:552 msgid "Element variable" msgstr "元素变量" #: ../data/functions.xml.in.h:553 msgid "Index variable" msgstr "下标变量" #: ../data/functions.xml.in.h:554 msgid "Vector variable" msgstr "向量变量" #: ../data/functions.xml.in.h:555 msgid "Process Matrix Elements" msgstr "处理矩阵元素" #: ../data/functions.xml.in.h:556 msgid "r:processm" msgstr "" #: ../data/functions.xml.in.h:557 msgid "Row variable" msgstr "行变量" #: ../data/functions.xml.in.h:558 msgid "Column variable" msgstr "列标量" #: ../data/functions.xml.in.h:559 msgid "Matrix variable" msgstr "矩阵变量" #: ../data/functions.xml.in.h:560 msgid "Custom Sum of Elements" msgstr "元素的自定义和" #: ../data/functions.xml.in.h:561 msgid "r:csum" msgstr "" #: ../data/functions.xml.in.h:562 msgid "First element" msgstr "最后一个元素" #: ../data/functions.xml.in.h:563 msgid "Last element" msgstr "最后一个元素" #: ../data/functions.xml.in.h:564 msgid "Initial value" msgstr "初始值" #: ../data/functions.xml.in.h:565 msgid "Value variable" msgstr "值变量" #: ../data/functions.xml.in.h:566 msgid "Select Vector Elements" msgstr "选择矩阵元素" #: ../data/functions.xml.in.h:567 msgid "r:select" msgstr "" #: ../data/functions.xml.in.h:568 msgid "Condition" msgstr "条件" #: ../data/functions.xml.in.h:569 msgid "Select first match" msgstr "选择第一个匹配项" #: ../data/functions.xml.in.h:570 msgid "r:function" msgstr "" #: ../data/functions.xml.in.h:571 msgid "Arguments" msgstr "自变量" #: ../data/functions.xml.in.h:572 msgid "Title" msgstr "标题" #: ../data/functions.xml.in.h:573 msgid "r:title" msgstr "" #: ../data/functions.xml.in.h:575 msgid "Display Error" msgstr "显示错误" #: ../data/functions.xml.in.h:576 msgid "r:error" msgstr "" #: ../data/functions.xml.in.h:577 msgid "Message" msgstr "信息" #: ../data/functions.xml.in.h:578 msgid "Display Warning" msgstr "显示警告" #: ../data/functions.xml.in.h:579 msgid "r:warning" msgstr "" #: ../data/functions.xml.in.h:580 msgid "Display Message" msgstr "显示信息" #: ../data/functions.xml.in.h:581 msgid "r:message" msgstr "" #: ../data/functions.xml.in.h:582 msgid "Save as Variable" msgstr "作为变量保存" #: ../data/functions.xml.in.h:583 msgid "r:save" msgstr "" #: ../data/functions.xml.in.h:584 msgid "Category" msgstr "类别" #: ../data/functions.xml.in.h:585 msgid "RPN Stack Register" msgstr "RPN栈寄存器" #: ../data/functions.xml.in.h:586 msgid "r:register" msgstr "" #: ../data/functions.xml.in.h:587 msgid "Returns the value of a RPN stack register." msgstr "返回RPN栈寄存器的值。" #: ../data/functions.xml.in.h:588 msgid "RPN Stack Vector" msgstr "RPN栈向量" #: ../data/functions.xml.in.h:589 msgid "r:stack" msgstr "" #: ../data/functions.xml.in.h:590 msgid "Returns the RPN stack as a vector." msgstr "将RPN栈作为向量返回。" #: ../data/functions.xml.in.h:591 msgid "Is Number" msgstr "是数字" #: ../data/functions.xml.in.h:592 msgid "r:isNumber" msgstr "" #: ../data/functions.xml.in.h:593 msgid "Is Real" msgstr "是实数" #: ../data/functions.xml.in.h:594 msgid "r:isReal" msgstr "" #: ../data/functions.xml.in.h:595 msgid "Is Rational" msgstr "是有理数" #: ../data/functions.xml.in.h:596 msgid "r:isRational" msgstr "" #: ../data/functions.xml.in.h:597 msgid "Is Integer" msgstr "是整数" #: ../data/functions.xml.in.h:598 msgid "r:isInteger" msgstr "" #: ../data/functions.xml.in.h:599 msgid "Represents Number" msgstr "代表数字" #: ../data/functions.xml.in.h:600 msgid "r:representsNumber" msgstr "" #: ../data/functions.xml.in.h:601 msgid "Represents Real" msgstr "代表实数" #: ../data/functions.xml.in.h:602 msgid "r:representsReal" msgstr "" #: ../data/functions.xml.in.h:603 msgid "Represents Rational" msgstr "代表有理数" #: ../data/functions.xml.in.h:604 msgid "r:representsRational" msgstr "" #: ../data/functions.xml.in.h:605 msgid "Represents Integer" msgstr "代表整数" #: ../data/functions.xml.in.h:606 msgid "r:representsInteger" msgstr "" #: ../data/functions.xml.in.h:607 msgid "Logical" msgstr "逻辑" #: ../data/functions.xml.in.h:608 msgid "For...Do" msgstr "For...Do" #: ../data/functions.xml.in.h:609 msgid "r:for" msgstr "" #: ../data/functions.xml.in.h:610 msgid "Initial value of counter" msgstr "计数器初始值" #: ../data/functions.xml.in.h:611 msgid "Counter variable" msgstr "计数器变量" #: ../data/functions.xml.in.h:612 msgid "For condition" msgstr "For条件" #: ../data/functions.xml.in.h:613 msgid "Counter update function" msgstr "计数器更新函数" #: ../data/functions.xml.in.h:614 msgid "Do function" msgstr "Do函数" #: ../data/functions.xml.in.h:615 msgid "If...Then...Else" msgstr "If...Then...Else" #: ../data/functions.xml.in.h:616 msgid "r:if" msgstr "" #: ../data/functions.xml.in.h:617 msgid "Tests a condition and returns a value depending on the result." msgstr "对一个条件进行测试,并根据测试结果返回一个值。" #: ../data/functions.xml.in.h:618 msgid "Expression if condition is met" msgstr "条件满足时的表达式" #: ../data/functions.xml.in.h:619 msgid "Expression if condition is NOT met" msgstr "条件不满足时的表达式" #: ../data/functions.xml.in.h:620 msgid "Logical Exclusive OR" msgstr "逻辑排斥OR" #: ../data/functions.xml.in.h:621 msgid "r:xor" msgstr "" #: ../data/functions.xml.in.h:622 msgid "Value 1" msgstr "值1" #: ../data/functions.xml.in.h:623 msgid "Value 2" msgstr "值2" #: ../data/functions.xml.in.h:624 msgid "Bitwise Exclusive OR" msgstr "按位排斥OR" #: ../data/functions.xml.in.h:625 msgid "r:bitxor" msgstr "" #: ../data/functions.xml.in.h:626 msgid "Bitwise Shift" msgstr "按位移位" #: ../data/functions.xml.in.h:627 msgid "r:shift" msgstr "" #: ../data/functions.xml.in.h:628 msgid "Bits" msgstr "比特" #: ../data/functions.xml.in.h:629 msgid "Algebra" msgstr "代数" #: ../data/functions.xml.in.h:630 msgid "Sum" msgstr "求和" #: ../data/functions.xml.in.h:631 msgid "au:Σ,r:sum" msgstr "" #: ../data/functions.xml.in.h:632 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:633 msgid "Term expression" msgstr "项表达式" #: ../data/functions.xml.in.h:634 msgid "Lower limit (i)" msgstr "下限(i)" #: ../data/functions.xml.in.h:635 msgid "Upper limit (n)" msgstr "上限(n)" #: ../data/functions.xml.in.h:636 msgid "Product" msgstr "连乘" #: ../data/functions.xml.in.h:637 msgid "au:Π,r:product" msgstr "" #: ../data/functions.xml.in.h:638 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:639 msgid "Factor expression" msgstr "因子表达式" #: ../data/functions.xml.in.h:640 msgid "Solve for multiple variables" msgstr "多变量求解" #: ../data/functions.xml.in.h:641 msgid "r:multisolve" msgstr "r:multisolve" #: ../data/functions.xml.in.h:642 msgid "Equation vector" msgstr "方程向量" #: ../data/functions.xml.in.h:643 msgid "Variable vector" msgstr "变量向量" #: ../data/functions.xml.in.h:644 msgid "Solve equation" msgstr "方程求解" #: ../data/functions.xml.in.h:645 msgid "r:solve" msgstr "" #: ../data/functions.xml.in.h:646 msgid "Equation" msgstr "方程" #: ../data/functions.xml.in.h:647 msgid "With respect to" msgstr "关于" #: ../data/functions.xml.in.h:648 msgid "Solve for two variables" msgstr "双变量求解" #: ../data/functions.xml.in.h:649 msgid "r:solve2" msgstr "" #: ../data/functions.xml.in.h:650 msgid "" "Solves two equations with two unknown variables. Returns the value of the " "first variable." msgstr "解由两个未知数和两个方程组成方程组。返回第一个变量的值。" #: ../data/functions.xml.in.h:651 msgid "Equation 1" msgstr "方程1" #: ../data/functions.xml.in.h:652 msgid "Equation 2" msgstr "方程" #: ../data/functions.xml.in.h:653 msgid "Variable 1" msgstr "变量1" #: ../data/functions.xml.in.h:654 msgid "Variable 2" msgstr "变量2" #: ../data/functions.xml.in.h:655 msgid "Find Linear Function" msgstr "寻找线性函数" #: ../data/functions.xml.in.h:656 msgid "r:linearfunction" msgstr "" #: ../data/functions.xml.in.h:657 msgid "" "Finds the linear function for the straight line between two distinct points." msgstr "寻找过两点直线段的线性函数" #: ../data/functions.xml.in.h:658 msgid "x1" msgstr "" #: ../data/functions.xml.in.h:659 msgid "y1" msgstr "" #: ../data/functions.xml.in.h:660 msgid "x2" msgstr "" #: ../data/functions.xml.in.h:661 msgid "y2" msgstr "" #: ../data/functions.xml.in.h:662 msgid "Calculus" msgstr "微积分" #: ../data/functions.xml.in.h:663 msgid "Differentiate" msgstr "百分位数" #: ../data/functions.xml.in.h:664 msgid "r:diff" msgstr "" #: ../data/functions.xml.in.h:665 msgid "Order" msgstr "次数" #: ../data/functions.xml.in.h:666 msgid "Integrate" msgstr "积分" #: ../data/functions.xml.in.h:667 msgid "r:integrate" msgstr "" #: ../data/functions.xml.in.h:668 msgid "Variable of integration" msgstr "积分变量" #: ../data/functions.xml.in.h:669 msgid "Extreme Values" msgstr "极限值" #: ../data/functions.xml.in.h:670 msgid "r:extremum" msgstr "" #: ../data/functions.xml.in.h:671 msgid "Geometry" msgstr "几何" #: ../data/functions.xml.in.h:672 msgid "Triangle" msgstr "三角形" #: ../data/functions.xml.in.h:673 msgid "Hypotenuse" msgstr "斜边" #: ../data/functions.xml.in.h:674 msgid "r:hypot" msgstr "" #: ../data/functions.xml.in.h:675 msgid "Side A" msgstr "边A" #: ../data/functions.xml.in.h:676 msgid "Side B" msgstr "边B" #: ../data/functions.xml.in.h:677 msgid "Triangle Area" msgstr "三角形面积" #: ../data/functions.xml.in.h:678 msgid "r:triangle" msgstr "" #: ../data/functions.xml.in.h:679 msgid "Height" msgstr "高度" #: ../data/functions.xml.in.h:680 msgid "Triangle Perimeter" msgstr "(直角)三角形周长" #: ../data/functions.xml.in.h:681 msgid "r:triangle_perimeter" msgstr "" #: ../data/functions.xml.in.h:682 msgid "Circle" msgstr "圆形" #: ../data/functions.xml.in.h:683 msgid "Circle Area" msgstr "圆面积" #: ../data/functions.xml.in.h:684 msgid "r:circle" msgstr "" #: ../data/functions.xml.in.h:685 msgid "Calculates the area of a circle using the radius" msgstr "使用半径计算圆面积" #: ../data/functions.xml.in.h:686 msgid "Radius" msgstr "半径" #: ../data/functions.xml.in.h:687 msgid "Circle Circumference" msgstr "圆周长" #: ../data/functions.xml.in.h:688 msgid "r:circumference" msgstr "" #: ../data/functions.xml.in.h:689 msgid "Cylinder" msgstr "圆柱" #: ../data/functions.xml.in.h:690 msgid "Cylinder Volume" msgstr "圆柱体积" #: ../data/functions.xml.in.h:691 msgid "r:cylinder" msgstr "" #: ../data/functions.xml.in.h:692 msgid "Surface Area of Cylinder" msgstr "圆柱体表面积" #: ../data/functions.xml.in.h:693 msgid "r:cylinder_sa" msgstr "" #: ../data/functions.xml.in.h:694 msgid "Cone" msgstr "圆锥" #: ../data/functions.xml.in.h:695 msgid "Cone Volume" msgstr "圆锥体积" #: ../data/functions.xml.in.h:696 msgid "r:cone" msgstr "" #: ../data/functions.xml.in.h:697 msgid "Surface Area of Cone" msgstr "圆锥表面积" #: ../data/functions.xml.in.h:698 msgid "r:cone_sa" msgstr "" #: ../data/functions.xml.in.h:699 msgid "Sphere" msgstr "球体" #: ../data/functions.xml.in.h:700 msgid "Sphere Volume" msgstr "球体积" #: ../data/functions.xml.in.h:701 msgid "r:sphere" msgstr "" #: ../data/functions.xml.in.h:702 msgid "Surface Area of Sphere" msgstr "球体表面积" #: ../data/functions.xml.in.h:703 msgid "r:sphere_sa" msgstr "" #: ../data/functions.xml.in.h:704 msgid "Square Area" msgstr "正方形面积" #: ../data/functions.xml.in.h:705 msgid "r:square" msgstr "" #: ../data/functions.xml.in.h:706 msgid "Length of side" msgstr "边长" #: ../data/functions.xml.in.h:707 msgid "Square Perimeter" msgstr "正方形周长" #: ../data/functions.xml.in.h:708 msgid "r:square_perimeter" msgstr "" #: ../data/functions.xml.in.h:709 msgid "Cube" msgstr "立方体" #: ../data/functions.xml.in.h:710 msgid "Cube Volume" msgstr "立方体体积" #: ../data/functions.xml.in.h:711 msgid "r:cube" msgstr "" #: ../data/functions.xml.in.h:712 msgid "Surface Area of Cube" msgstr "立方体表面积" #: ../data/functions.xml.in.h:713 msgid "r:cube_sa" msgstr "" #: ../data/functions.xml.in.h:714 msgid "Rectangle" msgstr "矩形" #: ../data/functions.xml.in.h:715 msgid "Rectangle Area" msgstr "矩形面积" #: ../data/functions.xml.in.h:716 msgid "r:rect" msgstr "" #: ../data/functions.xml.in.h:717 msgid "Width" msgstr "宽度" #: ../data/functions.xml.in.h:718 msgid "Rectangle Perimeter" msgstr "矩形周长" #: ../data/functions.xml.in.h:719 msgid "r:rect_perimeter" msgstr "" #: ../data/functions.xml.in.h:720 msgid "Prism" msgstr "棱柱" #: ../data/functions.xml.in.h:721 msgid "Volume of Rectangular Prism" msgstr "矩形棱柱体积" #: ../data/functions.xml.in.h:722 msgid "r:rectprism" msgstr "" #: ../data/functions.xml.in.h:723 msgid "Calculates the volume of a prism with rectangular base." msgstr "计算矩形棱柱的体积。" #: ../data/functions.xml.in.h:724 msgid "Surface Area of Rectangular Prism" msgstr " 矩形棱柱表面积" #: ../data/functions.xml.in.h:725 msgid "r:rectprism_sa" msgstr "" #: ../data/functions.xml.in.h:726 msgid "Calculates the surface area of a prism with rectangular base." msgstr "计算矩形棱柱的表面积" #: ../data/functions.xml.in.h:727 msgid "Volume of Triangular Prism" msgstr "三角棱柱体积" #: ../data/functions.xml.in.h:728 msgid "r:triangleprism" msgstr "" #: ../data/functions.xml.in.h:729 msgid "Calculates the volume of a prism with triangular base." msgstr "计算三角棱柱的体积。" #: ../data/functions.xml.in.h:730 msgid "Pyramid" msgstr "锥体" #: ../data/functions.xml.in.h:731 msgid "Pyramid Volume" msgstr "锥体体积" #: ../data/functions.xml.in.h:732 msgid "r:pyramid" msgstr "" #: ../data/functions.xml.in.h:733 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:734 msgid "Length of base" msgstr "底面长度" #: ../data/functions.xml.in.h:735 msgid "Width of base" msgstr "底面宽度" #: ../data/functions.xml.in.h:736 msgid "Volume of Regular Tetrahedron" msgstr "正四面体体积" #: ../data/functions.xml.in.h:737 msgid "r:tetrahedron" msgstr "" #: ../data/functions.xml.in.h:738 msgid "Surface Area of Regular Tetrahedron" msgstr "正四面体表面积" #: ../data/functions.xml.in.h:739 msgid "r:tetrahedron_sa" msgstr "" #: ../data/functions.xml.in.h:740 msgid "Height of Regular Tetrahedron" msgstr "正四面体的高度" #: ../data/functions.xml.in.h:741 msgid "r:tetrahedron_height" msgstr "" #: ../data/functions.xml.in.h:742 msgid "Volume of Square Pyramid" msgstr "方锥体体积" #: ../data/functions.xml.in.h:743 msgid "r:sqpyramid" msgstr "" #: ../data/functions.xml.in.h:744 msgid "Surface Area of Square Pyramid" msgstr "方锥体表面积" #: ../data/functions.xml.in.h:745 msgid "r:sqpyramid_sa" msgstr "" #: ../data/functions.xml.in.h:746 msgid "Height of Square Pyramid" msgstr "方角锥的高度" #: ../data/functions.xml.in.h:747 msgid "r:sqpyramid_height" msgstr "" #: ../data/functions.xml.in.h:748 msgid "Parallelogram" msgstr "平行四边形" #: ../data/functions.xml.in.h:749 msgid "Parallelogram Area" msgstr "平行四边形面积" #: ../data/functions.xml.in.h:750 msgid "r:parallelogram" msgstr "" #: ../data/functions.xml.in.h:751 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:752 msgid "Parallelogram Perimeter" msgstr "平行四边形周长" #: ../data/functions.xml.in.h:753 msgid "r:parallelogram_perimeter" msgstr "" #: ../data/functions.xml.in.h:754 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:755 msgid "Trapezoid" msgstr "梯形" #: ../data/functions.xml.in.h:756 msgid "Trapezoid Area" msgstr "梯形面积" #: ../data/functions.xml.in.h:757 msgid "r:trapezoid" msgstr "" #: ../data/functions.xml.in.h:758 msgid "Calculates the area of a four-sided figure with two parallel sides." msgstr "计算梯形的面积。" #: ../data/functions.xml.in.h:759 msgid "Economics" msgstr "经济学" #: ../data/functions.xml.in.h:760 msgid "Microeconomics" msgstr "微观经济学" #: ../data/functions.xml.in.h:761 msgid "Elasticity" msgstr "弹性" #: ../data/functions.xml.in.h:762 msgid "r:elasticity" msgstr "" #: ../data/functions.xml.in.h:763 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:764 msgid "Demand function" msgstr "需求函数" #: ../data/functions.xml.in.h:765 msgid "Price" msgstr "价格" #: ../data/functions.xml.in.h:766 msgid "Price variable" msgstr "价格变量" #: ../data/functions.xml.in.h:767 msgid "Consumer Surplus" msgstr "消费者剩余" #: ../data/functions.xml.in.h:768 msgid "r:csurplus" msgstr "" #: ../data/functions.xml.in.h:769 msgid "Supply function or price" msgstr "供给函数或价格" #: ../data/functions.xml.in.h:770 msgid "Quantity variabel" msgstr "数量变量" #: ../data/functions.xml.in.h:771 msgid "Producer Surplus" msgstr "" #: ../data/functions.xml.in.h:772 msgid "r:psurplus" msgstr "" #: ../data/functions.xml.in.h:773 msgid "Supply function" msgstr "供给函数" #: ../data/functions.xml.in.h:774 msgid "Demand function or price" msgstr "需求函数或价格" #: ../data/functions.xml.in.h:775 msgid "Finance" msgstr "金融" #: ../data/functions.xml.in.h:776 msgid "Sum-of-Years Digits Depreciation" msgstr "年数总和折旧" #: ../data/functions.xml.in.h:777 msgid "r:syd" msgstr "" #: ../data/functions.xml.in.h:778 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:779 msgid "Cost" msgstr "成本" #: ../data/functions.xml.in.h:780 msgid "Salvage value" msgstr "残值" #: ../data/functions.xml.in.h:781 msgid "Life" msgstr "" #: ../data/functions.xml.in.h:782 msgid "Period" msgstr "周期" #: ../data/functions.xml.in.h:783 msgid "Straight Line Depreciation" msgstr "直线折旧" #: ../data/functions.xml.in.h:784 msgid "r:sln" msgstr "" #: ../data/functions.xml.in.h:785 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:786 msgid "Present Value" msgstr "现值" #: ../data/functions.xml.in.h:787 msgid "r:pv" msgstr "" #: ../data/functions.xml.in.h:788 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:789 msgid "Interest rate" msgstr "利率" #: ../data/functions.xml.in.h:790 msgid "Number of periods" msgstr "期数" #: ../data/functions.xml.in.h:791 msgid "Payment made each period" msgstr "每期支付" #: ../data/functions.xml.in.h:792 msgid "Future value" msgstr "未来值" #: ../data/functions.xml.in.h:793 msgid "Type" msgstr "类型" #: ../data/functions.xml.in.h:794 msgid "Nominal Interest Rate" msgstr "名义利率" #: ../data/functions.xml.in.h:795 msgid "r:nominal" msgstr "" #: ../data/functions.xml.in.h:796 msgid "" "Calculates the nominal interest rate from a given effective interest rate " "compounded at given intervals." msgstr "根据在给定时间段内复合的给定有效利率计算名义利率。" #: ../data/functions.xml.in.h:797 msgid "Effective interest rate" msgstr "有效利率" #: ../data/functions.xml.in.h:798 msgid "Periods" msgstr "周期" #: ../data/functions.xml.in.h:799 msgid "Zero Coupon" msgstr "零息" #: ../data/functions.xml.in.h:800 msgid "r:zero_coupon" msgstr "" #: ../data/functions.xml.in.h:801 msgid "Calculates the value of a zero-coupon (pure discount) bond." msgstr "计算零息债券(纯贴现债券)的值。" #: ../data/functions.xml.in.h:802 msgid "Face value" msgstr "票面价值" #: ../data/functions.xml.in.h:803 msgid "Treasury Bill Yield" msgstr "短期债券收益" #: ../data/functions.xml.in.h:804 msgid "r:tbillyield" msgstr "" #: ../data/functions.xml.in.h:805 msgid "Returns the yield for a treasury bill." msgstr "返回短期债券的收益。" #: ../data/functions.xml.in.h:806 msgid "Settlement date" msgstr "结算日期" #: ../data/functions.xml.in.h:807 msgid "Maturity date" msgstr "到期日期" #: ../data/functions.xml.in.h:808 msgid "Price per $100 face value" msgstr "每$100票面价值的价格" #: ../data/functions.xml.in.h:809 msgid "Treasury Bill Price" msgstr "短期债券价格" #: ../data/functions.xml.in.h:810 msgid "r:tbillprice" msgstr "" #: ../data/functions.xml.in.h:811 msgid "Returns the price per $100 value for a treasury bill." msgstr "返回一支短期债券每100美元面值的价格。" #: ../data/functions.xml.in.h:812 msgid "Discount rate" msgstr "贴现率" #: ../data/functions.xml.in.h:813 msgid "Treasury Bill Equivalent" msgstr "短期债券等价物" #: ../data/functions.xml.in.h:814 msgid "r:tbilleq" msgstr "" #: ../data/functions.xml.in.h:815 msgid "Returns the bond equivalent for a treasury bill." msgstr "返回与一支短期债券等值的债券。" #: ../data/functions.xml.in.h:816 msgid "Interest paid on a given period of an investment (ISPMT)" msgstr "给定投资期内要支付的利息(ISPMT)" #: ../data/functions.xml.in.h:817 msgid "r:ispmt" msgstr "" #: ../data/functions.xml.in.h:818 msgid "Calculates the interest paid on a given period of an investment." msgstr "计算一项投资在给定周期内支付的利息。" #: ../data/functions.xml.in.h:819 msgid "Periodic interest rate" msgstr "周期利率" #: ../data/functions.xml.in.h:820 msgid "Amortizement period" msgstr "偿还期" #: ../data/functions.xml.in.h:821 msgid "Present value" msgstr "现值" #: ../data/functions.xml.in.h:822 msgid "Payment for a loan" msgstr "贷款偿还" #: ../data/functions.xml.in.h:823 msgid "r:pmt" msgstr "" #: ../data/functions.xml.in.h:824 #, fuzzy 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. Note that the " "interest rate here refers to the rate for each period and if you calculate " "with an annual rate, each period will be interpreted as a whole year (to get " "monthly payments, divide the result by 12)." msgstr "" "返回一项利率固定并且定期偿还的贷款的偿还额。(每次偿还金额相同) \"类" "型\" 定义了到期日期。\"1\"代表在每个周期的开头支付; \"0\"(缺省值)代表在每个周" "期末尾支付。" #: ../data/functions.xml.in.h:825 msgid "Rate" msgstr "利率" #: ../data/functions.xml.in.h:826 msgid "Periods of an investment" msgstr "投资的期数" #: ../data/functions.xml.in.h:827 msgid "r:nper" msgstr "" #: ../data/functions.xml.in.h:828 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:829 msgid "Duration" msgstr "持续时间" #: ../data/functions.xml.in.h:830 msgid "r:duration" msgstr "" #: ../data/functions.xml.in.h:831 msgid "Calculates the duration of a security." msgstr "计算债券的持续时间。" #: ../data/functions.xml.in.h:833 #, no-c-format msgid "Annual coupon rate (%)" msgstr "年息票利率(%)" #: ../data/functions.xml.in.h:835 #, no-c-format msgid "Annualized yield (%)" msgstr "年度基础换算后的收益率(%)" #. Reccurance #: ../data/functions.xml.in.h:837 msgid "Frequency" msgstr "频率" #: ../data/functions.xml.in.h:838 msgid "Periods for investment to attain desired value" msgstr "要获得想要的值,需要的投资期数" #: ../data/functions.xml.in.h:839 msgid "r:g_duration" msgstr "" #: ../data/functions.xml.in.h:840 msgid "" "Returns the number of periods needed for an investment to attain a desired " "value." msgstr "返回一项投资要得到想要的金额,所需要的期数。" #: ../data/functions.xml.in.h:841 msgid "Payment of an annuity going towards principal (PPMT)" msgstr "本金的年金支付额(PPMT)" #: ../data/functions.xml.in.h:842 msgid "r:ppmt" msgstr "" #: ../data/functions.xml.in.h:843 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:844 msgid "Desired future value" msgstr "期望的未来价值" #: ../data/functions.xml.in.h:845 msgid "Effective Interest Rate" msgstr "有效利率" #: ../data/functions.xml.in.h:846 msgid "r:effect" msgstr "" #: ../data/functions.xml.in.h:847 msgid "Calculates the effective interest for a given nominal rate." msgstr "根据给定的名义利率计算有效利息。" #: ../data/functions.xml.in.h:848 msgid "Nominal interest rate" msgstr "名义利率" #: ../data/functions.xml.in.h:849 msgid "Future Value" msgstr "未来值" #: ../data/functions.xml.in.h:850 msgid "r:fv" msgstr "" #: ../data/functions.xml.in.h:851 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:852 msgid "Return on continuously compounded interest" msgstr "根据连续复合利率的回报" #: ../data/functions.xml.in.h:853 msgid "r:continuous" msgstr "" #: ../data/functions.xml.in.h:854 msgid "" "Calculates the return on continuously compounded interest, given the " "principal, nominal rate and time in years." msgstr "根据给定的本金、名义利率和以年为单位的时间,计算连续复合利率的回报。" #: ../data/functions.xml.in.h:855 msgid "Principal" msgstr "本金" #: ../data/functions.xml.in.h:856 msgid "Compound" msgstr "复合值" #: ../data/functions.xml.in.h:857 msgid "r:compound" msgstr "" #: ../data/functions.xml.in.h:858 msgid "" "Returns the value of an investment, given the principal, nominal interest " "rate, compounding frequency and time." msgstr "根据给定的本金、名义利率、复合频率和时间计算并返回投资的值。" #: ../data/functions.xml.in.h:859 msgid "Periods per year" msgstr "每年的期数" #: ../data/functions.xml.in.h:860 msgid "Payment of an annuity going towards interest (IPMT)" msgstr "利息的年金支付额(IPMT)" #: ../data/functions.xml.in.h:861 msgid "r:ipmt" msgstr "" #: ../data/functions.xml.in.h:862 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:863 msgid "Interest rate for a fully invested security" msgstr "一项已充分投资证券的利率" #: ../data/functions.xml.in.h:864 msgid "r:intrate" msgstr "" #: ../data/functions.xml.in.h:865 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:866 msgid "Investment" msgstr "投资" #: ../data/functions.xml.in.h:867 msgid "Redemption" msgstr "偿还" #: ../data/functions.xml.in.h:868 msgid "Dollar Fraction" msgstr "美元分数" #: ../data/functions.xml.in.h:869 msgid "r:dollarfr" msgstr "" #: ../data/functions.xml.in.h:870 msgid "" "Converts a decimal dollar price into a dollar price expressed as a fraction." msgstr "将用小数表示的美元价格转化为用分数表示的价格。" #: ../data/functions.xml.in.h:871 msgid "Decimal dollar" msgstr "小数表示的美元" #: ../data/functions.xml.in.h:872 msgid "Denominator of fraction" msgstr "分数的分母" #: ../data/functions.xml.in.h:873 msgid "Dollar Decimal" msgstr "美元小数" #: ../data/functions.xml.in.h:874 msgid "r:dollarde" msgstr "" #: ../data/functions.xml.in.h:875 msgid "" "Converts a dollar price expressed as a fraction into a dollar price " "expressed as a decimal number." msgstr "将用分数表示的美元价格转化为用小数表示的价格。" #: ../data/functions.xml.in.h:876 msgid "Fractional dollar" msgstr "分数表示的美元" #: ../data/functions.xml.in.h:877 msgid "Amount received at maturity for a security bond" msgstr "债券到期时获得的金额" #: ../data/functions.xml.in.h:878 msgid "r:received" msgstr "" #: ../data/functions.xml.in.h:879 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:880 msgid "Discount rate for a security" msgstr "证券的贴现率" #: ../data/functions.xml.in.h:881 msgid "r:disc" msgstr "" #: ../data/functions.xml.in.h:882 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:883 msgid "Accrued interest of security paying at maturity" msgstr "到期时支付的证券应计利息" #: ../data/functions.xml.in.h:884 msgid "r:accrintm" msgstr "" #: ../data/functions.xml.in.h:885 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:886 msgid "Issue date" msgstr "发表日期" #: ../data/functions.xml.in.h:887 msgid "Annual rate of security" msgstr "证券年利率" #: ../data/functions.xml.in.h:888 msgid "Par value" msgstr "面值" #: ../data/functions.xml.in.h:889 msgid "Accrued interest of security with periodic interest payments" msgstr "分期支付的证券应计利息" #: ../data/functions.xml.in.h:890 msgid "r:accrint" msgstr "" #: ../data/functions.xml.in.h:891 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:892 msgid "First interest" msgstr "第一笔利息" #: ../data/functions.xml.in.h:893 msgid "Number of coupons to be paid" msgstr "要支付的息票数量" #: ../data/functions.xml.in.h:894 msgid "r:coupnum" msgstr "" #: ../data/functions.xml.in.h:895 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:896 #, fuzzy msgid "Price per $100 face value of a discounted security" msgstr "一支证券每$100票面价值的价格" #: ../data/functions.xml.in.h:897 msgid "r:pricedisc" msgstr "" #: ../data/functions.xml.in.h:898 #, fuzzy msgid "" "Calculates and returns the price per $100 face value of a discounted " "security. 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:899 msgid "Discount" msgstr "贴现" #: ../data/functions.xml.in.h:900 msgid "Price per $100 face value of a security" msgstr "一支证券每$100票面价值的价格" #: ../data/functions.xml.in.h:901 msgid "r:pricemat" msgstr "" #: ../data/functions.xml.in.h:902 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:903 msgid "Annual yield" msgstr "年收益" #: ../data/functions.xml.in.h:904 msgid "Level-Coupon Bond" msgstr "息票债券" #: ../data/functions.xml.in.h:905 msgid "r:level_coupon" msgstr "r:level_coupon" #: ../data/functions.xml.in.h:906 msgid "Calculates the value of a level-coupon bond." msgstr "计算息票债券的值。" #: ../data/functions.xml.in.h:907 msgid "Coupon rate" msgstr "息票利率" #: ../data/functions.xml.in.h:908 msgid "Coupons per year" msgstr "息票数每年" #: ../data/functions.xml.in.h:909 msgid "Market interest rate" msgstr "市场利率" #: ../data/planets.xml.in.h:1 msgid "Earth" msgstr "地球" #: ../data/planets.xml.in.h:2 msgid "Mars" msgstr "火星" #. Planet #: ../data/planets.xml.in.h:4 msgid "!planets!Mercury" msgstr "水星" #: ../data/planets.xml.in.h:5 msgid "Venus" msgstr "金星" #: ../data/planets.xml.in.h:6 msgid "Jupiter" msgstr "木星" #: ../data/planets.xml.in.h:7 msgid "Saturn" msgstr "土星" #: ../data/planets.xml.in.h:8 msgid "Neptune" msgstr "海王星" #: ../data/planets.xml.in.h:9 msgid "Pluto" msgstr "冥王星" #: ../data/planets.xml.in.h:10 msgid "Uranus" msgstr "天王星" #. Unit category #: ../data/units.xml.in.h:2 msgid "!units!Length" msgstr "长度" #: ../data/units.xml.in.h:3 msgid "Meter" msgstr "米" #: ../data/units.xml.in.h:4 msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "" #: ../data/units.xml.in.h:5 msgid "Kilometer" msgstr "千米" #: ../data/units.xml.in.h:6 msgid "Decimeter" msgstr "分米" #: ../data/units.xml.in.h:7 msgid "Centimeter" msgstr "厘米" #: ../data/units.xml.in.h:8 msgid "Millimeter" msgstr "毫米" #: ../data/units.xml.in.h:9 msgid "Nautical Mile" msgstr "海里" #: ../data/units.xml.in.h:10 msgid "r:nautical_mile,p:nautical_miles" msgstr "" #: ../data/units.xml.in.h:11 msgid "Ångström" msgstr "" #: ../data/units.xml.in.h:12 msgid "aru:Å,u:ångström,angstrom" msgstr "" #: ../data/units.xml.in.h:13 msgid "U.S. Survey Inch" msgstr "" #: ../data/units.xml.in.h:14 msgid "ar:US_in,US_inch,p:US_inches" msgstr "" #: ../data/units.xml.in.h:15 msgid "Inch" msgstr "英寸" #: ../data/units.xml.in.h:16 msgid "ar:in,inch,p:inches" msgstr "" #: ../data/units.xml.in.h:17 msgid "Hand" msgstr "" #: ../data/units.xml.in.h:18 msgid "r:hand,p:hands" msgstr "" #: ../data/units.xml.in.h:19 msgid "Foot" msgstr "英尺" #: ../data/units.xml.in.h:20 msgid "ar:ft,foot,p:feet" msgstr "" #: ../data/units.xml.in.h:21 msgid "U.S. Survey Foot" msgstr "" #: ../data/units.xml.in.h:22 msgid "ar:US_ft,US_foot,p:US_feet" msgstr "" #: ../data/units.xml.in.h:23 msgid "Link" msgstr "" #: ../data/units.xml.in.h:24 msgid "ar:li,link,p:links" msgstr "" #: ../data/units.xml.in.h:25 msgid "Yard" msgstr "码" #: ../data/units.xml.in.h:26 msgid "ar:yd,yard,p:yards" msgstr "" #: ../data/units.xml.in.h:27 msgid "Rod (pole/perch)" msgstr "" #: ../data/units.xml.in.h:28 msgid "ar:rd,rod,p:rods" msgstr "" #: ../data/units.xml.in.h:29 msgid "Fathom" msgstr "英寻" #: ../data/units.xml.in.h:30 msgid "r:fathom,p:fathoms" msgstr "" #: ../data/units.xml.in.h:31 msgid "Chain" msgstr "链" #: ../data/units.xml.in.h:32 msgid "ar:ch,chain,p:chains" msgstr "" #: ../data/units.xml.in.h:33 msgid "Furlong" msgstr "弗隆" #: ../data/units.xml.in.h:34 msgid "ar:fur,furlong,p:furlongs" msgstr "" #: ../data/units.xml.in.h:35 msgid "Mile" msgstr "英里" #: ../data/units.xml.in.h:36 msgid "ar:mi,mile,p:miles" msgstr "" #: ../data/units.xml.in.h:37 msgid "U.S. Survey Mile" msgstr "" #: ../data/units.xml.in.h:38 msgid "ar:US_mi,US_mile,p:US_miles" msgstr "" #: ../data/units.xml.in.h:39 msgid "Mil (1/1000 in)" msgstr "毫英寸(1/1000英寸)" #: ../data/units.xml.in.h:40 msgid "r:mil,p:mils" msgstr "" #: ../data/units.xml.in.h:41 msgid "Astronomical Unit" msgstr "天文单位" #: ../data/units.xml.in.h:42 msgid "ar:AU,astronomical_unit,p:astronomical_units" msgstr "" #: ../data/units.xml.in.h:43 msgid "Light Year" msgstr "光年" #: ../data/units.xml.in.h:44 msgid "ar:ly,lightyear,p:lightyears" msgstr "" #: ../data/units.xml.in.h:45 msgid "Parsec" msgstr "秒差距" #: ../data/units.xml.in.h:46 msgid "ar:pc,parsec,p:parsecs" msgstr "" #: ../data/units.xml.in.h:47 msgid "Pied du roi (French Royal Foot)" msgstr "" #: ../data/units.xml.in.h:48 msgid "r:pied_du_roi" msgstr "" #: ../data/units.xml.in.h:49 msgid "Pouce (French Royal Inch)" msgstr "" #: ../data/units.xml.in.h:50 msgid "r:pouce" msgstr "" #: ../data/units.xml.in.h:51 msgid "Ligne" msgstr "" #: ../data/units.xml.in.h:52 msgid "r:ligne" msgstr "" #: ../data/units.xml.in.h:53 msgid "Toise" msgstr "" #: ../data/units.xml.in.h:54 msgid "r:toise" msgstr "" #. Unit category #: ../data/units.xml.in.h:56 msgid "!units!Angle" msgstr "角度" #: ../data/units.xml.in.h:57 msgid "Plane Angle" msgstr "平面角" #: ../data/units.xml.in.h:58 msgid "Meter per Meter" msgstr "米每米" #: ../data/units.xml.in.h:59 msgid "Radian" msgstr "弧度" #: ../data/units.xml.in.h:60 msgid "ar:rad,radian,p:radians" msgstr "" #: ../data/units.xml.in.h:61 msgid "Degree" msgstr "度" #: ../data/units.xml.in.h:62 msgid "ar:deg,au:°,degree,p:degrees" msgstr "" #: ../data/units.xml.in.h:63 msgid "Gradian (Gon)" msgstr "" #: ../data/units.xml.in.h:64 msgid "ar:gra,gradian,p:gradians,gon,p:gons" msgstr "" #: ../data/units.xml.in.h:65 msgid "Arcminute" msgstr "弧分" #: ../data/units.xml.in.h:66 msgid "r:arcminute,p:arcminutes" msgstr "" #: ../data/units.xml.in.h:67 msgid "Arcsecond" msgstr "弧秒" #: ../data/units.xml.in.h:68 msgid "r:arcsecond,p:arcseconds" msgstr "" #: ../data/units.xml.in.h:69 msgid "Turn" msgstr "" #: ../data/units.xml.in.h:70 msgid "r:turn,p:turns" msgstr "r:turn,p:turns" #: ../data/units.xml.in.h:71 msgid "Solid Angle" msgstr "立体角" #: ../data/units.xml.in.h:72 msgid "Square Meter per Square Meter" msgstr "平方米每平方米" #: ../data/units.xml.in.h:73 msgid "Steradian" msgstr "球面度" #: ../data/units.xml.in.h:74 msgid "ar:sr,steradian,p:steradians" msgstr "" #: ../data/units.xml.in.h:75 msgid "Angular Acceleration" msgstr "角加速度" #: ../data/units.xml.in.h:76 msgid "Radians per Second Squared" msgstr "弧度每平方秒" #: ../data/units.xml.in.h:77 msgid "Angular Velocity" msgstr "角速度" #: ../data/units.xml.in.h:78 msgid "Radians per Second" msgstr "弧度每秒" #. Unit category #: ../data/units.xml.in.h:80 msgid "!units!Mass" msgstr "质量" #: ../data/units.xml.in.h:81 msgid "Gram" msgstr "克" #: ../data/units.xml.in.h:82 msgid "ar:g,gram,p:grams" msgstr "" #: ../data/units.xml.in.h:83 msgid "Kilogram" msgstr "千克" #: ../data/units.xml.in.h:84 #, fuzzy msgid "Hectogram" msgstr "向量" #: ../data/units.xml.in.h:85 msgid "Metric Ton (Tonne)" msgstr "公吨" #: ../data/units.xml.in.h:86 msgid "ar:t,tonne,p:tonnes,ton,p:tons" msgstr "" #: ../data/units.xml.in.h:87 msgid "Grain" msgstr "格令" #: ../data/units.xml.in.h:88 msgid "ar:gr,grain,p:grains" msgstr "" #: ../data/units.xml.in.h:89 msgid "Pennyweight" msgstr "本尼威特" #: ../data/units.xml.in.h:90 msgid "ar:pwt,pennyweight,p:pennyweights" msgstr "" #: ../data/units.xml.in.h:91 msgid "Ounce (troy)" msgstr "金衡制盎司" #: ../data/units.xml.in.h:92 msgid "ar:oz_t,troy_ounce,p:troy_ounces" msgstr "" #: ../data/units.xml.in.h:93 msgid "Pound (troy)" msgstr "金衡制磅" #: ../data/units.xml.in.h:94 msgid "ar:lb_t,troy_pound,p:troy_pounds" msgstr "" #: ../data/units.xml.in.h:95 msgid "Dram" msgstr "英钱" #: ../data/units.xml.in.h:96 msgid "ar:dr,dram,p:drams" msgstr "" #: ../data/units.xml.in.h:97 msgid "Ounce" msgstr "盎司" #: ../data/units.xml.in.h:98 msgid "ar:oz,ounce,p:ounces" msgstr "" #: ../data/units.xml.in.h:99 msgid "Pound" msgstr "磅" #: ../data/units.xml.in.h:100 msgid "ar:lb,pound,p:pounds" msgstr "" #: ../data/units.xml.in.h:101 msgid "Short Hundredweight" msgstr "短英担" #: ../data/units.xml.in.h:102 msgid "ar:cwt,hundredweight,p:hundredweights" msgstr "" #: ../data/units.xml.in.h:103 msgid "Long Hundredweight" msgstr "长担" #: ../data/units.xml.in.h:104 msgid "ar:l_cwt,long_hundredweight,p:long_hundredweights" msgstr "" #: ../data/units.xml.in.h:105 msgid "Short Ton" msgstr "短吨" #: ../data/units.xml.in.h:106 msgid "ar:s_ton,short_ton,p:short_tons" msgstr "" #: ../data/units.xml.in.h:107 msgid "Long Ton" msgstr "长吨" #: ../data/units.xml.in.h:108 msgid "ar:l_ton,long_ton,p:long_tons" msgstr "" #: ../data/units.xml.in.h:109 msgid "Stone" msgstr "" #: ../data/units.xml.in.h:110 msgid "r:stone,p:stones" msgstr "" #: ../data/units.xml.in.h:111 msgid "Cental" msgstr "百磅" #: ../data/units.xml.in.h:112 msgid "r:cental,p:centals" msgstr "" #: ../data/units.xml.in.h:113 msgid "Carat" msgstr "克拉" #: ../data/units.xml.in.h:114 msgid "r:carat,p:carats" msgstr "" #: ../data/units.xml.in.h:115 msgid "Pfund" msgstr "" #: ../data/units.xml.in.h:116 msgid "r:pfund" msgstr "" #: ../data/units.xml.in.h:117 msgid "Zentner" msgstr "" #: ../data/units.xml.in.h:118 msgid "r:zentner" msgstr "r:zentner" #: ../data/units.xml.in.h:120 msgid "Kilogram per Cubic Meter" msgstr "千克每立方米" #: ../data/units.xml.in.h:121 msgid "Gram per Cubic Decimeter" msgstr "克每立方分米" #: ../data/units.xml.in.h:122 msgid "Gram per Cubic Centimeter" msgstr "克每立方厘米" #: ../data/units.xml.in.h:123 #, fuzzy msgid "Atomic Mass" msgstr "原子质量单位" #: ../data/units.xml.in.h:124 msgid "Gram per Mole" msgstr "克每摩尔" #: ../data/units.xml.in.h:125 msgid "Atomic Mass Unit" msgstr "原子质量单位" #: ../data/units.xml.in.h:126 msgid "ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units" msgstr "" #: ../data/units.xml.in.h:127 msgid "Dalton" msgstr "" #: ../data/units.xml.in.h:128 msgid "ar:Da,dalton,p:daltons" msgstr "" #: ../data/units.xml.in.h:129 msgid "Kilodalton" msgstr "" #: ../data/units.xml.in.h:130 msgid "Mass Fraction" msgstr "质量分数" #: ../data/units.xml.in.h:131 msgid "Kilogram per Kilogram" msgstr "千克每千克" #: ../data/units.xml.in.h:133 msgid "Second" msgstr "秒" #: ../data/units.xml.in.h:134 msgid "ar:s,second,p:seconds" msgstr "" #: ../data/units.xml.in.h:135 msgid "Minute" msgstr "分" #: ../data/units.xml.in.h:136 msgid "ar:min,minute,p:minutes" msgstr "" #: ../data/units.xml.in.h:137 msgid "Hour" msgstr "小时" #: ../data/units.xml.in.h:138 msgid "ar:h,hour,p:hours" msgstr "" #: ../data/units.xml.in.h:139 msgid "Day" msgstr "日" #: ../data/units.xml.in.h:140 msgid "ar:d,day,p:days" msgstr "" #: ../data/units.xml.in.h:141 msgid "Week" msgstr "周" #: ../data/units.xml.in.h:142 msgid "r:week,p:weeks" msgstr "" #: ../data/units.xml.in.h:143 msgid "Fortnight" msgstr "两星期" #: ../data/units.xml.in.h:144 msgid "r:fortnight,p:fortnights" msgstr "" #: ../data/units.xml.in.h:145 msgid "Julian Year" msgstr "儒略年" #: ../data/units.xml.in.h:146 msgid "r:year,p:years" msgstr "" #. Unit category #: ../data/units.xml.in.h:148 msgid "!units!Frequency" msgstr "频率" #: ../data/units.xml.in.h:149 msgid "Hertz" msgstr "赫兹" #: ../data/units.xml.in.h:150 msgid "ar:Hz,hertz" msgstr "" #: ../data/units.xml.in.h:151 msgid "Electricity" msgstr "电学" #: ../data/units.xml.in.h:152 msgid "Electric Current" msgstr "电流" #: ../data/units.xml.in.h:153 msgid "Ampere" msgstr "安培" #: ../data/units.xml.in.h:154 msgid "ar:A,ampere,p:amperes" msgstr "" #: ../data/units.xml.in.h:155 msgid "Abampere" msgstr "绝对安培" #: ../data/units.xml.in.h:156 msgid "r:abampere,a:abA,a:aA,p:abamperes" msgstr "" #: ../data/units.xml.in.h:157 msgid "Current Density" msgstr "电流密度" #: ../data/units.xml.in.h:158 msgid "Ampere per Meter Squared" msgstr "安培每平方米" #: ../data/units.xml.in.h:159 msgid "Electric Charge" msgstr "电荷" #: ../data/units.xml.in.h:160 msgid "Second Ampere" msgstr "秒安培" #: ../data/units.xml.in.h:161 msgid "Coulomb" msgstr "库仑" #: ../data/units.xml.in.h:162 msgid "ar:C,coulomb,p:coulombs" msgstr "" #: ../data/units.xml.in.h:163 msgid "Abcoulomb" msgstr "绝对库伦" #: ../data/units.xml.in.h:164 msgid "r:abcoulomb,p:abcoulombs,a:abC,a:aC" msgstr "" #: ../data/units.xml.in.h:165 msgid "Statcoloumb (Franklin)" msgstr "" #: ../data/units.xml.in.h:166 msgid "r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins" msgstr "" #: ../data/units.xml.in.h:167 msgid "Electric Charge Density" msgstr "电荷密度" #: ../data/units.xml.in.h:168 msgid "Coulomb per Cubic Meter" msgstr "库仑每立方米" #: ../data/units.xml.in.h:169 msgid "Electric Flux Density" msgstr "电通密度" #: ../data/units.xml.in.h:170 msgid "Coulomb per Meter Squared" msgstr "库仑每平米" #: ../data/units.xml.in.h:171 msgid "Electric Potential" msgstr "电势" #: ../data/units.xml.in.h:172 msgid "Watt per Ampere" msgstr "瓦每安培" #: ../data/units.xml.in.h:173 msgid "Volt" msgstr "伏特" #: ../data/units.xml.in.h:174 msgid "ar:V,volt,p:volts" msgstr "" #: ../data/units.xml.in.h:175 msgid "Statvolt" msgstr "静伏特" #: ../data/units.xml.in.h:176 msgid "r:statvolt,p:statvolts,a:statV" msgstr "" #: ../data/units.xml.in.h:177 msgid "Abvolt" msgstr "绝对伏特" #: ../data/units.xml.in.h:178 msgid "r:abvolt,p:abvolts,a:abV" msgstr "" #: ../data/units.xml.in.h:179 msgid "Capacitance" msgstr "电容" #: ../data/units.xml.in.h:180 msgid "Coulomb per Volt" msgstr "库仑每伏特" #: ../data/units.xml.in.h:181 msgid "Farad" msgstr "法拉" #: ../data/units.xml.in.h:182 msgid "ar:F,farad,p:farads" msgstr "" #: ../data/units.xml.in.h:183 msgid "Electric Resistance" msgstr "电阻" #: ../data/units.xml.in.h:184 msgid "Volt per Ampere" msgstr "伏特每安培" #: ../data/units.xml.in.h:185 msgid "Ohm" msgstr "欧姆" #: ../data/units.xml.in.h:186 msgid "au:Ω,r:ohm,p:ohms" msgstr "" #: ../data/units.xml.in.h:187 msgid "Abohm" msgstr "绝对单位欧姆" #: ../data/units.xml.in.h:188 msgid "r:abohm,p:abohms,au:abΩ" msgstr "" #: ../data/units.xml.in.h:189 msgid "Statohm" msgstr "静欧姆" #: ../data/units.xml.in.h:190 msgid "r:statohm,p:statohms,au:statΩ" msgstr "" #: ../data/units.xml.in.h:191 msgid "Electric Conductance" msgstr "电导" #: ../data/units.xml.in.h:192 msgid "Ampere per Volt" msgstr "安培每伏特" #: ../data/units.xml.in.h:193 msgid "Siemens" msgstr "" #: ../data/units.xml.in.h:194 msgid "ar:S,siemens" msgstr "" #: ../data/units.xml.in.h:195 msgid "Electric Field Strength" msgstr "电场强度" #: ../data/units.xml.in.h:196 msgid "Volt per Meter" msgstr "伏特每米" #: ../data/units.xml.in.h:197 msgid "Permittivity" msgstr "电容率" #: ../data/units.xml.in.h:198 msgid "Farad per Meter" msgstr "法拉每米" #: ../data/units.xml.in.h:199 msgid "Inductance" msgstr "电感" #: ../data/units.xml.in.h:200 msgid "Weber per Ampere" msgstr "韦伯每安培" #: ../data/units.xml.in.h:201 msgid "Henry" msgstr "亨利" #: ../data/units.xml.in.h:202 msgid "ar:H,henry,p:henrys" msgstr "" #: ../data/units.xml.in.h:203 msgid "Permeability" msgstr "磁导率" #: ../data/units.xml.in.h:204 msgid "Henry per Meter" msgstr "亨利每米" #: ../data/units.xml.in.h:205 msgid "Temperature" msgstr "温度" #: ../data/units.xml.in.h:206 msgid "Kelvin" msgstr "开尔文" #: ../data/units.xml.in.h:207 msgid "ar:K,kelvin,p:kelvins" msgstr "" #: ../data/units.xml.in.h:208 msgid "Degree Celsius" msgstr "摄氏度" #: ../data/units.xml.in.h:209 msgid "" "ar:oC,au:°C,au:℃,r:celsius,p:celsius,centigrade,p:centigrades" msgstr "" #: ../data/units.xml.in.h:210 msgid "Degree Rankine" msgstr "华氏度" #: ../data/units.xml.in.h:211 msgid "ar:oR,au:°R,r:rankine" msgstr "" #: ../data/units.xml.in.h:212 msgid "Degree Fahrenheit" msgstr "华氏度" #: ../data/units.xml.in.h:213 msgid "ar:oF,au:°F,au:℉,r:fahrenheit" msgstr "" #: ../data/units.xml.in.h:214 msgid "Substance" msgstr "物质" #: ../data/units.xml.in.h:215 msgid "Mole" msgstr "摩尔" #: ../data/units.xml.in.h:216 msgid "ar:mol,mole,p:moles" msgstr "" #: ../data/units.xml.in.h:217 msgid "Einstein" msgstr "爱因斯坦" #: ../data/units.xml.in.h:218 msgid "r:einstein,p:einsteins" msgstr "" #: ../data/units.xml.in.h:219 msgid "Substance Concentration" msgstr "物质浓度" #: ../data/units.xml.in.h:220 msgid "Mole per Cubic Meter" msgstr "摩尔每平米" #: ../data/units.xml.in.h:221 msgid "Catalytic Activity" msgstr "催化活性" #: ../data/units.xml.in.h:222 msgid "Reciprocal Seconds Mole" msgstr "" #: ../data/units.xml.in.h:223 msgid "Katal" msgstr "卡塔尔" #: ../data/units.xml.in.h:224 msgid "ar:kat,katal,p:katals" msgstr "" #: ../data/units.xml.in.h:225 msgid "Catalytic Concentration" msgstr "催化浓度" #: ../data/units.xml.in.h:226 msgid "Katal per Cubic Meter" msgstr "卡塔尔每立方米" #: ../data/units.xml.in.h:227 msgid "Light" msgstr "光学" #: ../data/units.xml.in.h:228 msgid "Luminous Intensity" msgstr "发光强度" #: ../data/units.xml.in.h:229 msgid "Candela" msgstr "" #: ../data/units.xml.in.h:230 msgid "ar:cd,candela,p:candelas" msgstr "" #: ../data/units.xml.in.h:231 msgid "Luminance" msgstr "亮度" #: ../data/units.xml.in.h:232 msgid "Candela per Meter Squared" msgstr "" #: ../data/units.xml.in.h:233 msgid "Stilb" msgstr "熙提" #: ../data/units.xml.in.h:234 msgid "ar:sb,stilb,p:stilbs" msgstr "" #: ../data/units.xml.in.h:235 msgid "Luminous Flux" msgstr "光通量" #: ../data/units.xml.in.h:236 msgid "Candela Steradian" msgstr "" #: ../data/units.xml.in.h:237 msgid "Lumen" msgstr "流明" #: ../data/units.xml.in.h:238 msgid "ar:lm,lumen,p:lumens" msgstr "" #: ../data/units.xml.in.h:239 msgid "Illuminance" msgstr "照度" #: ../data/units.xml.in.h:240 msgid "Lumen per Meter Squared" msgstr "流明每平米" #: ../data/units.xml.in.h:241 msgid "Lumen per Foot Squared" msgstr "流明每平方英尺" #: ../data/units.xml.in.h:242 msgid "Lux" msgstr "勒克斯" #: ../data/units.xml.in.h:243 msgid "ar:lx,lux" msgstr "" #: ../data/units.xml.in.h:244 msgid "Foot-Candle" msgstr "" #: ../data/units.xml.in.h:245 msgid "ar:fc,footcandle,p:footcandles" msgstr "" #: ../data/units.xml.in.h:246 msgid "Phot" msgstr "幅透" #: ../data/units.xml.in.h:247 msgid "ar:ph,phot,p:phots" msgstr "" #: ../data/units.xml.in.h:248 msgid "Radiant Intensity" msgstr "辐射强度" #: ../data/units.xml.in.h:249 msgid "Watt per Steradian" msgstr "瓦每球面度" #: ../data/units.xml.in.h:250 msgid "Irradiance" msgstr "辐照度" #: ../data/units.xml.in.h:251 msgid "Watt per Meter Squared" msgstr "瓦每平米" #: ../data/units.xml.in.h:252 msgid "Einstein per Meter Squared per Second" msgstr "爱因斯坦每平方米每秒" #: ../data/units.xml.in.h:253 msgid "Microeinstein per Meter Squared per Second" msgstr "" #: ../data/units.xml.in.h:254 msgid "Radiance" msgstr "辐射率" #: ../data/units.xml.in.h:255 msgid "Watt per Square Meter Steradian" msgstr "瓦每平米球面度" #: ../data/units.xml.in.h:256 msgid "Area" msgstr "面积" #: ../data/units.xml.in.h:257 msgid "Square Meter" msgstr "平方米" #: ../data/units.xml.in.h:258 msgid "Square Kilometer" msgstr "平方千米" #: ../data/units.xml.in.h:259 msgid "Are" msgstr "" #: ../data/units.xml.in.h:260 msgid "ar:a,are,p:ares" msgstr "" #: ../data/units.xml.in.h:261 msgid "Hectare" msgstr "公顷" #: ../data/units.xml.in.h:262 msgid "Barn" msgstr "靶" #: ../data/units.xml.in.h:263 msgid "ar:b,barn,p:barns" msgstr "" #: ../data/units.xml.in.h:264 msgid "Rood" msgstr "" #: ../data/units.xml.in.h:265 msgid "r:rood,p:roods" msgstr "" #: ../data/units.xml.in.h:266 msgid "Acre" msgstr "英亩" #: ../data/units.xml.in.h:267 msgid "r:acre,p:acres" msgstr "" #: ../data/units.xml.in.h:268 msgid "Section" msgstr "" #: ../data/units.xml.in.h:269 msgid "r:section,p:sections" msgstr "" #: ../data/units.xml.in.h:270 msgid "Township" msgstr "" #: ../data/units.xml.in.h:271 msgid "r:township,p:townships" msgstr "" #: ../data/units.xml.in.h:272 msgid "Square Foot" msgstr "平方英尺" #: ../data/units.xml.in.h:273 msgid "Square Inch" msgstr "平方英寸" #: ../data/units.xml.in.h:274 msgid "Square Mile" msgstr "平方英里" #: ../data/units.xml.in.h:275 msgid "Volume" msgstr "体积" #: ../data/units.xml.in.h:276 msgid "Cubic Meter" msgstr "立方米" #: ../data/units.xml.in.h:277 msgid "Liter" msgstr "升" #: ../data/units.xml.in.h:278 msgid "ar:L,a:l,liter,p:liters,litre,p:litres" msgstr "" #: ../data/units.xml.in.h:279 msgid "Milliliter" msgstr "毫升" #: ../data/units.xml.in.h:280 msgid "Centiliter" msgstr "厘升" #: ../data/units.xml.in.h:281 msgid "Deciliter" msgstr "分升" #: ../data/units.xml.in.h:282 msgid "Cubic Inch" msgstr "立方英寸" #: ../data/units.xml.in.h:283 msgid "Fuel Economy" msgstr "燃料经济" #: ../data/units.xml.in.h:284 msgid "Liter per Kilometer" msgstr "升每千米" #: ../data/units.xml.in.h:285 msgid "Kilometer per Liter" msgstr "千米每升" #: ../data/units.xml.in.h:286 msgid "Miles per Gallon" msgstr "英里每加仑" #: ../data/units.xml.in.h:287 msgid "a-cr:mpg" msgstr "a-cr:mpg" #: ../data/units.xml.in.h:288 msgid "Cooking" msgstr "烹饪" #: ../data/units.xml.in.h:289 msgid "Teaspoon" msgstr "茶匙" #: ../data/units.xml.in.h:290 msgid "r:teaspoon,p:teaspoons" msgstr "" #: ../data/units.xml.in.h:291 msgid "Dessertspoon" msgstr "点心匙" #: ../data/units.xml.in.h:292 msgid "r:dessertspoon,p:dessertspoons" msgstr "" #: ../data/units.xml.in.h:293 msgid "Tablespoon" msgstr "汤匙" #: ../data/units.xml.in.h:294 msgid "r:tablespoon,p:tablespoons" msgstr "" #: ../data/units.xml.in.h:295 msgid "Cup" msgstr "杯" #: ../data/units.xml.in.h:296 msgid "r:cup,p:cups" msgstr "" #: ../data/units.xml.in.h:297 msgid "Imperial Capacity" msgstr "" #: ../data/units.xml.in.h:298 msgid "Imperial Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:299 msgid "ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces" msgstr "" #: ../data/units.xml.in.h:300 msgid "Imperial Gill" msgstr "" #: ../data/units.xml.in.h:301 msgid "ar:UK_gi,imperial_gill,p:imperial_gills" msgstr "" #: ../data/units.xml.in.h:302 msgid "Imperial Pint" msgstr "" #: ../data/units.xml.in.h:303 msgid "ar:UK_pt,imperial_pint,p:imperial_pints" msgstr "" #: ../data/units.xml.in.h:304 msgid "Imperial Quart" msgstr "" #: ../data/units.xml.in.h:305 msgid "ar:UK_qt,imperial_quart,p:imperial_quarts" msgstr "" #: ../data/units.xml.in.h:306 msgid "Imperial Gallon" msgstr "" #: ../data/units.xml.in.h:307 msgid "ar:UK_gal,imperial_gallon,p:imperial_gallons" msgstr "" #: ../data/units.xml.in.h:308 msgid "Imperial Minim" msgstr "" #: ../data/units.xml.in.h:309 msgid "r:imperial_minim,p:imperial_minims" msgstr "" #: ../data/units.xml.in.h:310 msgid "Imperial Fluid Scuple" msgstr "" #: ../data/units.xml.in.h:311 msgid "r:imperial_fluid_scuple,p:imperial_fluid_scuples" msgstr "" #: ../data/units.xml.in.h:312 msgid "Imperial Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:313 msgid "ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms" msgstr "" #: ../data/units.xml.in.h:314 msgid "Imperial Bushel" msgstr "" #: ../data/units.xml.in.h:315 msgid "ar:UK_bu,imperial_bushel,p:imperial_bushels" msgstr "" #: ../data/units.xml.in.h:316 msgid "U.S. Capacity" msgstr "" #: ../data/units.xml.in.h:317 msgid "U.S. Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:318 msgid "ar:fl_oz,fluid_ounce,p:fluid_ounces" msgstr "" #: ../data/units.xml.in.h:319 msgid "U.S. Gill" msgstr "" #: ../data/units.xml.in.h:320 msgid "ar:gi,gill,p:gills" msgstr "" #: ../data/units.xml.in.h:321 msgid "U.S. Liquid Pints" msgstr "" #: ../data/units.xml.in.h:322 msgid "ar:liq_pt,liquid_pint,p:liquid_pints" msgstr "" #: ../data/units.xml.in.h:323 msgid "U.S. Liquid Quarts" msgstr "" #: ../data/units.xml.in.h:324 msgid "ar:liq_qt,liquid_quart,p:liquid_quarts" msgstr "" #: ../data/units.xml.in.h:325 msgid "U.S. Minim" msgstr "" #: ../data/units.xml.in.h:326 msgid "r:minim,p:minims" msgstr "" #: ../data/units.xml.in.h:327 msgid "U.S. Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:328 msgid "ar:fl_dr,fluid_drachm,p:fluid_drachms" msgstr "" #: ../data/units.xml.in.h:329 msgid "U.S. Dry Pint" msgstr "" #: ../data/units.xml.in.h:330 msgid "ar:dry_pt,dry_pint,p:dry_pints" msgstr "" #: ../data/units.xml.in.h:331 msgid "U.S. Dry Quart" msgstr "" #: ../data/units.xml.in.h:332 msgid "ar:dry_qt,dry_quart,p:dry_quarts" msgstr "" #: ../data/units.xml.in.h:333 msgid "U.S. Peck" msgstr "" #: ../data/units.xml.in.h:334 msgid "ar:pk,peck,p:pecks" msgstr "" #: ../data/units.xml.in.h:335 msgid "U.S. Bushel" msgstr "" #: ../data/units.xml.in.h:336 msgid "ar:bu,bushel,p:bushels" msgstr "" #: ../data/units.xml.in.h:337 msgid "U.S. Gallon" msgstr "" #: ../data/units.xml.in.h:338 msgid "ar:gal,gallon,p:gallons" msgstr "" #: ../data/units.xml.in.h:339 msgid "U.S. Barrel (oil)" msgstr "" #: ../data/units.xml.in.h:340 msgid "ar:bbl,barrel,p:barrels" msgstr "" #: ../data/units.xml.in.h:341 msgid "Specific Volume" msgstr "" #: ../data/units.xml.in.h:342 msgid "Cubic Meter per Kilogram" msgstr "立方米每公斤" #: ../data/units.xml.in.h:343 msgid "Speed" msgstr "速度" #: ../data/units.xml.in.h:344 msgid "Meter per Second" msgstr "米每秒" #: ../data/units.xml.in.h:345 msgid "Kilometer per Hour" msgstr "千米每小时" #: ../data/units.xml.in.h:346 msgid "Nautical Mile per Hour" msgstr "海里每小时" #: ../data/units.xml.in.h:347 msgid "Knot" msgstr "节" #: ../data/units.xml.in.h:348 msgid "r:knot,p:knots" msgstr "" #: ../data/units.xml.in.h:349 msgid "Miles per Hour" msgstr "英里每小时" #: ../data/units.xml.in.h:350 msgid "a-cr:mph" msgstr "" #: ../data/units.xml.in.h:351 msgid "Acceleration" msgstr "加速度" #: ../data/units.xml.in.h:352 msgid "Meter per Second Squared" msgstr "米每平方秒" #: ../data/units.xml.in.h:353 msgid "Galileo" msgstr "伽利略" #: ../data/units.xml.in.h:354 msgid "ar:Gal,galileo,p:galileos" msgstr "" #: ../data/units.xml.in.h:355 msgid "Gee" msgstr "" #: ../data/units.xml.in.h:356 msgid "r:gee,p:gees" msgstr "" #: ../data/units.xml.in.h:357 msgid "Magnetism" msgstr "磁学" #: ../data/units.xml.in.h:358 msgid "Wave Number" msgstr "波数" #: ../data/units.xml.in.h:359 msgid "Reciprocal Meter" msgstr "" #: ../data/units.xml.in.h:360 msgid "Magnetic Field Strength" msgstr "磁场强度" #: ../data/units.xml.in.h:361 msgid "Ampere per Meter" msgstr "安培每米" #: ../data/units.xml.in.h:362 msgid "Oersted" msgstr "奥斯特" #: ../data/units.xml.in.h:363 msgid "ar:Oe,oersted,p:oersteds" msgstr "" #: ../data/units.xml.in.h:364 msgid "Magnetic Flux" msgstr "磁通量" #: ../data/units.xml.in.h:365 msgid "Volt Seconds" msgstr "伏特秒" #: ../data/units.xml.in.h:366 msgid "Weber" msgstr "韦伯" #: ../data/units.xml.in.h:367 msgid "ar:Wb,weber,p:webers" msgstr "" #: ../data/units.xml.in.h:368 msgid "Maxwell" msgstr "麦克斯韦" #: ../data/units.xml.in.h:369 msgid "ar:Mx,maxwell,p:maxwells" msgstr "" #: ../data/units.xml.in.h:370 msgid "Magnetic Flux Density" msgstr "磁通密度" #: ../data/units.xml.in.h:371 msgid "Weber per Meter Squared" msgstr "韦伯每平米" #: ../data/units.xml.in.h:372 msgid "Tesla" msgstr "特斯拉" #: ../data/units.xml.in.h:373 msgid "ar:T,tesla,p:teslas" msgstr "" #: ../data/units.xml.in.h:374 msgid "Gauss" msgstr "高斯" #: ../data/units.xml.in.h:375 msgid "r:gauss" msgstr "" #: ../data/units.xml.in.h:376 msgid "Force" msgstr "力学" #: ../data/units.xml.in.h:377 msgid "Meter Kilogram per Second Squared" msgstr "米千克每平方秒" #: ../data/units.xml.in.h:378 msgid "Newton" msgstr "牛顿" #: ../data/units.xml.in.h:379 msgid "ar:N,newton,p:newtons" msgstr "" #: ../data/units.xml.in.h:380 msgid "Dyne" msgstr "达因" #: ../data/units.xml.in.h:381 msgid "ar:dyn,dyne,p:dynes" msgstr "" #: ../data/units.xml.in.h:382 msgid "Pound-force" msgstr "磅力" #: ../data/units.xml.in.h:383 msgid "ar:lbf,pound_force" msgstr "ar:lbf,pound_force" #: ../data/units.xml.in.h:384 msgid "Pound Foot per Second Squared" msgstr "磅英尺每平方秒" #: ../data/units.xml.in.h:385 msgid "Poundal" msgstr "磅达" #: ../data/units.xml.in.h:386 msgid "r:poundal,p:poundals,a:pdl" msgstr "" #: ../data/units.xml.in.h:387 msgid "Pond (Gram-Force)" msgstr "克力" #: ../data/units.xml.in.h:388 msgid "r:pond,p:ponds,a:gf" msgstr "" #: ../data/units.xml.in.h:389 msgid "Kilopond (Kilogram-Force)" msgstr "千克力" #: ../data/units.xml.in.h:390 msgid "Moment of Force" msgstr "力矩" #: ../data/units.xml.in.h:391 msgid "Newton Meter" msgstr "牛顿米" #: ../data/units.xml.in.h:392 msgid "Pressure" msgstr "压强" #: ../data/units.xml.in.h:393 msgid "Newton per Meter Squared" msgstr "牛顿每平米" #: ../data/units.xml.in.h:394 msgid "Pound-force per Square Inch" msgstr "磅力每平方英寸" #: ../data/units.xml.in.h:395 msgid "Pascal" msgstr "帕斯卡" #: ../data/units.xml.in.h:396 msgid "ar:Pa,pascal,p:pascals" msgstr "" #: ../data/units.xml.in.h:397 msgid "Pound-force per Square Inch (psi)" msgstr "磅力每平方英寸(psi)" #: ../data/units.xml.in.h:398 msgid "a-cr:psi" msgstr "" #: ../data/units.xml.in.h:399 msgid "Bar" msgstr "巴" #: ../data/units.xml.in.h:400 msgid "r:bar,p:bars" msgstr "" #: ../data/units.xml.in.h:401 msgid "Atmosphere" msgstr "大气压" #: ../data/units.xml.in.h:402 msgid "ar:atm,atmosphere,p:atmospheres" msgstr "" #: ../data/units.xml.in.h:403 msgid "Torr" msgstr "托" #: ../data/units.xml.in.h:404 msgid "r:torr,p:torrs" msgstr "" #: ../data/units.xml.in.h:405 msgid "Millimeter of Mercury" msgstr "毫米汞柱" #: ../data/units.xml.in.h:406 msgid "ar:mmHg" msgstr "" #: ../data/units.xml.in.h:407 msgid "Inch of Mercury" msgstr "英寸汞柱" #: ../data/units.xml.in.h:408 msgid "ar:inHg" msgstr "" #: ../data/units.xml.in.h:409 msgid "Dynamic Viscosity" msgstr "动态粘度" #: ../data/units.xml.in.h:410 msgid "Pascal Second" msgstr "帕斯卡秒" #: ../data/units.xml.in.h:411 msgid "Poise" msgstr "泊" #: ../data/units.xml.in.h:412 msgid "ar:P,poise,p:poises" msgstr "" #: ../data/units.xml.in.h:413 msgid "Kinematic Viscosity" msgstr "运动粘度" #: ../data/units.xml.in.h:414 msgid "Square Meter per Second" msgstr "平方米每秒" #: ../data/units.xml.in.h:415 msgid "Stokes" msgstr "" #: ../data/units.xml.in.h:416 msgid "ar:St,stokes" msgstr "" #: ../data/units.xml.in.h:417 msgid "Surface Tension" msgstr "表面张力" #: ../data/units.xml.in.h:418 msgid "Newton per Meter" msgstr "牛顿每米" #: ../data/units.xml.in.h:419 msgid "Energy" msgstr "能量" #: ../data/units.xml.in.h:420 msgid "Joule" msgstr "焦耳" #: ../data/units.xml.in.h:421 msgid "ar:J,joule,p:joules" msgstr "" #: ../data/units.xml.in.h:422 msgid "Watt Hour" msgstr "瓦小时" #: ../data/units.xml.in.h:423 msgid "Kilowatt Hour" msgstr "度(千瓦时)" #: ../data/units.xml.in.h:424 msgid "Calorie (international table)" msgstr "" #: ../data/units.xml.in.h:425 msgid "ais:cal_IT,ar:cal,c:calorie,cp:calories" msgstr "" #: ../data/units.xml.in.h:426 msgid "Calorie (capital C)" msgstr "" #: ../data/units.xml.in.h:427 msgid "cr:Calorie,cp:Calories" msgstr "" #: ../data/units.xml.in.h:428 msgid "Calorie (thermochemical)" msgstr "" #: ../data/units.xml.in.h:429 msgid "ars:cal_th" msgstr "" #: ../data/units.xml.in.h:430 msgid "Gram of TNT" msgstr "克TNT当量" #: ../data/units.xml.in.h:431 msgid "a-cr:gTNT,gramTNT" msgstr "" #: ../data/units.xml.in.h:432 msgid "Ton of TNT" msgstr "吨TNT当量" #: ../data/units.xml.in.h:433 msgid "a-cr:tTNT,tonTNT" msgstr "" #: ../data/units.xml.in.h:434 msgid "Calorie (15 degrees Celsius)" msgstr "Calorie(15摄氏度)" #: ../data/units.xml.in.h:435 msgid "ars:cal_fifteen" msgstr "" #: ../data/units.xml.in.h:436 msgid "Calorie (mean)" msgstr "" #: ../data/units.xml.in.h:437 msgid "ars:cal_mean" msgstr "" #: ../data/units.xml.in.h:438 msgid "British Thermal Unit (IT)" msgstr "英制热量单位(IT)" #: ../data/units.xml.in.h:439 msgid "ar:Btu" msgstr "" #: ../data/units.xml.in.h:440 msgid "Electron Volt" msgstr "电子伏特" #: ../data/units.xml.in.h:441 msgid "ar:eV,electron_volt,p:electron_volts" msgstr "" #: ../data/units.xml.in.h:442 msgid "Erg" msgstr "" #: ../data/units.xml.in.h:443 msgid "r:erg,p:ergs" msgstr "" #: ../data/units.xml.in.h:444 msgid "Foe" msgstr "" #: ../data/units.xml.in.h:445 msgid "r:foe,p:foes" msgstr "" #: ../data/units.xml.in.h:446 msgid "Foot-Pound Force" msgstr "" #: ../data/units.xml.in.h:447 #, fuzzy msgid "Rydberg" msgstr "里德伯常数" #: ../data/units.xml.in.h:448 msgid "ar:Ry,s:rydberg_unit" msgstr "" #: ../data/units.xml.in.h:449 msgid "Hartree" msgstr "" #: ../data/units.xml.in.h:450 msgid "ar:Ha,as:E_h,hartree" msgstr "" #: ../data/units.xml.in.h:451 msgid "Specific Energy" msgstr "" #: ../data/units.xml.in.h:452 msgid "Joule per Kilogram" msgstr "焦耳每千克" #: ../data/units.xml.in.h:453 msgid "Power" msgstr "功率" #: ../data/units.xml.in.h:454 msgid "Joule per Second" msgstr "焦耳每秒" #: ../data/units.xml.in.h:455 msgid "Watt" msgstr "瓦" #: ../data/units.xml.in.h:456 msgid "ar:W,watt,p:watts" msgstr "" #: ../data/units.xml.in.h:457 msgid "Horse Power" msgstr "匹" #: ../data/units.xml.in.h:458 msgid "ar:hp,horsepower,p:horsepowers" msgstr "" #: ../data/units.xml.in.h:459 msgid "Pferdestärke" msgstr "" #: ../data/units.xml.in.h:460 msgid "ar:PS,u:pferdestärke" msgstr "" #: ../data/units.xml.in.h:461 msgid "Entropy" msgstr "熵" #: ../data/units.xml.in.h:462 msgid "Joule per Kelvin" msgstr "焦耳每开尔文" #: ../data/units.xml.in.h:463 msgid "Specific Entropy" msgstr "" #: ../data/units.xml.in.h:464 msgid "Joule per Kilogram Kelvin" msgstr "焦耳每千克开尔文" #: ../data/units.xml.in.h:465 msgid "Thermal Conductivity" msgstr "导热系数" #: ../data/units.xml.in.h:466 msgid "Watt per Meter Kelvin" msgstr "瓦每米开尔文" #: ../data/units.xml.in.h:467 msgid "Energy Density" msgstr "能量密度" #: ../data/units.xml.in.h:468 msgid "Joule per Cubic Meter" msgstr "焦耳每立方米" #: ../data/units.xml.in.h:469 msgid "Molar Energy" msgstr "" #: ../data/units.xml.in.h:470 msgid "Joule per Mole" msgstr "焦耳每摩尔" #: ../data/units.xml.in.h:471 msgid "Molar Entropy" msgstr "摩尔熵" #: ../data/units.xml.in.h:472 msgid "Joule per Mole Kelvin" msgstr "焦耳每摩尔开尔文" #: ../data/units.xml.in.h:473 msgid "Radioactivity" msgstr "放射性" #: ../data/units.xml.in.h:474 msgid "Becquerel" msgstr "贝可" #: ../data/units.xml.in.h:475 msgid "ar:Bq,becquerel,p:becquerels" msgstr "" #: ../data/units.xml.in.h:476 msgid "Curie" msgstr "居里" #: ../data/units.xml.in.h:477 msgid "ar:Ci,curie,p:curies" msgstr "" #: ../data/units.xml.in.h:478 msgid "Absorbed Dose" msgstr "吸收剂量" #: ../data/units.xml.in.h:479 msgid "Gray" msgstr "戈瑞" #: ../data/units.xml.in.h:480 msgid "ar:Gy,gray,p:grays" msgstr "" #: ../data/units.xml.in.h:481 msgid "Rad" msgstr "" #: ../data/units.xml.in.h:482 msgid "r:rad_radioactivity" msgstr "" #: ../data/units.xml.in.h:483 msgid "Dose Equivalent" msgstr "剂量当量" #: ../data/units.xml.in.h:484 msgid "Sievert" msgstr "" #: ../data/units.xml.in.h:485 msgid "ar:Sv,sievert,p:sieverts" msgstr "" #: ../data/units.xml.in.h:486 msgid "Rem" msgstr "人体伦琴当量" #: ../data/units.xml.in.h:487 msgid "r:rem_radioactivity" msgstr "" #: ../data/units.xml.in.h:488 msgid "Exposure" msgstr "照射量" #: ../data/units.xml.in.h:489 msgid "Coulomb per Kilogram" msgstr "库仑每千克" #: ../data/units.xml.in.h:490 msgid "Roentgen" msgstr "伦琴" #: ../data/units.xml.in.h:491 msgid "ar:R,roentgen,p:roentgens" msgstr "" #: ../data/units.xml.in.h:492 msgid "Absorbed Dose Rate" msgstr "剂量吸收率" #: ../data/units.xml.in.h:493 msgid "Gray per Second" msgstr "戈瑞每秒" #: ../data/units.xml.in.h:494 msgid "Ratio" msgstr "比值" #: ../data/units.xml.in.h:495 msgid "Neper" msgstr "奈培" #: ../data/units.xml.in.h:496 msgid "ar:Np,neper,p:nepers" msgstr "" #: ../data/units.xml.in.h:497 msgid "Bel" msgstr "贝" #: ../data/units.xml.in.h:498 msgid "ar:B,bel,p:bels" msgstr "" #: ../data/units.xml.in.h:499 msgid "Decibel" msgstr "分贝" #: ../data/units.xml.in.h:500 msgid "Information" msgstr "信息" #: ../data/units.xml.in.h:501 msgid "Bit" msgstr "比特" #: ../data/units.xml.in.h:502 msgid "r:bit,p:bits" msgstr "" #: ../data/units.xml.in.h:503 msgid "Byte (8-bit)" msgstr "字节(8比特)" #: ../data/units.xml.in.h:504 msgid "r:byte,p:bytes,octet,p:octets" msgstr "" #: ../data/units.xml.in.h:505 msgid "Nibble" 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 "Tribble" msgstr "" #: ../data/units.xml.in.h:508 msgid "r:tribble,p:tribbles" msgstr "" #: ../data/units.xml.in.h:509 msgid "Word (16-bit)" msgstr "字(16比特)" #: ../data/units.xml.in.h:510 msgid "r:word,p:words" msgstr "" #: ../data/units.xml.in.h:511 msgid "Kilobyte" msgstr "千字节" #: ../data/units.xml.in.h:512 msgid "Kibibyte" msgstr "" #: ../data/units.xml.in.h:513 msgid "Mebibyte" msgstr "" #: ../data/units.xml.in.h:514 msgid "Gibibyte" msgstr "" #: ../data/units.xml.in.h:515 msgid "Megabyte" msgstr "兆字节" #: ../data/units.xml.in.h:516 msgid "Gigabyte" msgstr "千兆比特" #: ../data/units.xml.in.h:517 msgid "Terabyte" msgstr "万亿字节" #: ../data/units.xml.in.h:518 msgid "Kilobit" msgstr "千比特" #: ../data/units.xml.in.h:519 msgid "Kibibit" msgstr "" #: ../data/units.xml.in.h:520 msgid "Mebibit" msgstr "" #: ../data/units.xml.in.h:521 msgid "Gibibit" msgstr "" #: ../data/units.xml.in.h:522 msgid "Megabit" msgstr "兆比特" #: ../data/units.xml.in.h:523 msgid "Gigabit" msgstr "千兆比特" #: ../data/units.xml.in.h:524 msgid "Terabit" msgstr "万亿比特" #: ../data/units.xml.in.h:525 msgid "Typography" msgstr "印刷" #: ../data/units.xml.in.h:526 msgid "PostScript Point" msgstr "" #: ../data/units.xml.in.h:527 msgid "ar:pt,a:pts,point,p:points" msgstr "" #: ../data/units.xml.in.h:528 msgid "PostScript Pica" msgstr "" #: ../data/units.xml.in.h:529 msgid "r:pica,p:picas" msgstr "" #: ../data/units.xml.in.h:530 msgid "ATA Pica" msgstr "" #: ../data/units.xml.in.h:531 msgid "r:ata_pica,p:ata_picas" msgstr "" #: ../data/units.xml.in.h:532 msgid "ATA Point" msgstr "" #: ../data/units.xml.in.h:533 msgid "r:ata_point,a:ata_pt,p:ata_points" msgstr "" #: ../data/units.xml.in.h:534 msgid "New Didot Point" msgstr "" #: ../data/units.xml.in.h:535 msgid "r:new_didot" msgstr "" #: ../data/units.xml.in.h:536 msgid "Didot Point" msgstr "" #: ../data/units.xml.in.h:537 msgid "r:didot,a:dd" msgstr "" #: ../data/units.xml.in.h:538 msgid "Cicero" msgstr "" #: ../data/units.xml.in.h:539 msgid "r:cicero" msgstr "" #: ../data/variables.xml.in.h:1 msgid "Small Numbers" msgstr "小数字" #: ../data/variables.xml.in.h:2 msgid "Per Mille" msgstr "千分之一" #: ../data/variables.xml.in.h:3 msgid "r:permille,au:‰" msgstr "" #: ../data/variables.xml.in.h:4 msgid "Per Myriad" msgstr "万分之一" #: ../data/variables.xml.in.h:5 msgid "r:permyriad,au:‱" msgstr "" #: ../data/variables.xml.in.h:6 msgid "Percent" msgstr "百分位数" #: ../data/variables.xml.in.h:8 #, no-c-format msgid "a:%,r:percent" msgstr "" #: ../data/variables.xml.in.h:9 msgid "Large Numbers" msgstr "大数" #: ../data/variables.xml.in.h:10 msgid "Googolplex" msgstr "" #: ../data/variables.xml.in.h:11 msgid "r:googolplex" msgstr "" #: ../data/variables.xml.in.h:12 msgid "Googol" msgstr "大数" #: ../data/variables.xml.in.h:13 msgid "r:googol" msgstr "" #: ../data/variables.xml.in.h:14 msgid "Centillion" msgstr "百万的一百次方" #: ../data/variables.xml.in.h:15 msgid "-r:centillion" msgstr "" #: ../data/variables.xml.in.h:16 msgid "Vigintillion" msgstr "" #: ../data/variables.xml.in.h:17 msgid "-r:vigintillion" msgstr "" #: ../data/variables.xml.in.h:18 msgid "Novemdecillion" msgstr "" #: ../data/variables.xml.in.h:19 msgid "-r:novemdecillion" msgstr "" #: ../data/variables.xml.in.h:20 msgid "Octodecillion" msgstr "" #: ../data/variables.xml.in.h:21 msgid "-r:octodecillion" msgstr "" #: ../data/variables.xml.in.h:22 msgid "Septendecillion" msgstr "" #: ../data/variables.xml.in.h:23 msgid "-r:septendecillion" msgstr "" #: ../data/variables.xml.in.h:24 msgid "Sexdecillion" msgstr "" #: ../data/variables.xml.in.h:25 msgid "-r:sexdecillion" msgstr "" #: ../data/variables.xml.in.h:26 msgid "Quindecillion" msgstr "" #: ../data/variables.xml.in.h:27 msgid "-r:quindecillion" msgstr "" #: ../data/variables.xml.in.h:28 msgid "Quattuordecillion" msgstr "" #: ../data/variables.xml.in.h:29 msgid "-r:quattuordecillion" msgstr "" #: ../data/variables.xml.in.h:30 msgid "Tredecillion" msgstr "" #: ../data/variables.xml.in.h:31 msgid "-r:tredecillion" msgstr "" #: ../data/variables.xml.in.h:32 msgid "Duodecillion" msgstr "" #: ../data/variables.xml.in.h:33 msgid "-r:duodecillion" msgstr "" #: ../data/variables.xml.in.h:34 msgid "Undecillion" msgstr "" #: ../data/variables.xml.in.h:35 msgid "-r:undecillion" msgstr "" #: ../data/variables.xml.in.h:36 msgid "Decillion" msgstr "" #: ../data/variables.xml.in.h:37 msgid "-r:decillion" msgstr "" #: ../data/variables.xml.in.h:38 msgid "Nonillion" msgstr "" #: ../data/variables.xml.in.h:39 msgid "-r:nonillion" msgstr "" #: ../data/variables.xml.in.h:40 msgid "Octillion" msgstr "" #: ../data/variables.xml.in.h:41 msgid "-r:octillion" msgstr "" #: ../data/variables.xml.in.h:42 msgid "Septillion" msgstr "" #: ../data/variables.xml.in.h:43 msgid "-r:septillion" msgstr "" #: ../data/variables.xml.in.h:44 msgid "Sextillion" msgstr "" #: ../data/variables.xml.in.h:45 msgid "-r:sextillion" msgstr "" #: ../data/variables.xml.in.h:46 msgid "Quintillion" msgstr "" #: ../data/variables.xml.in.h:47 msgid "-r:quintillion" msgstr "" #: ../data/variables.xml.in.h:48 msgid "Quadrillion" msgstr "" #: ../data/variables.xml.in.h:49 msgid "-r:quadrillion" msgstr "" #: ../data/variables.xml.in.h:50 msgid "Trillion" msgstr "兆" #: ../data/variables.xml.in.h:51 msgid "-r:trillion" msgstr "" #: ../data/variables.xml.in.h:52 msgid "Billion" msgstr "十亿" #: ../data/variables.xml.in.h:53 msgid "-r:billion" msgstr "" #: ../data/variables.xml.in.h:54 msgid "Million" msgstr "百万" #: ../data/variables.xml.in.h:55 msgid "-r:million" msgstr "" #: ../data/variables.xml.in.h:56 msgid "Thousand" msgstr "千" #: ../data/variables.xml.in.h:57 msgid "-r:thousand" msgstr "" #: ../data/variables.xml.in.h:58 msgid "Hundred" msgstr "百" #: ../data/variables.xml.in.h:59 msgid "-r:hundred" msgstr "" #: ../data/variables.xml.in.h:60 msgid "Physical Constants" msgstr "物理常数" #: ../data/variables.xml.in.h:61 msgid "Universal Constants" msgstr "普适常数" #: ../data/variables.xml.in.h:62 msgid "Speed of Light in Vacuum" msgstr "真空中光速" #: ../data/variables.xml.in.h:63 msgid "ar:c,speed_of_light" msgstr "" #: ../data/variables.xml.in.h:64 msgid "Planck Time" msgstr "普朗克时间" #: ../data/variables.xml.in.h:65 msgid "r:planck_time,ais:t_P" msgstr "" #: ../data/variables.xml.in.h:66 msgid "Planck Temperature" msgstr "普朗克温度" #: ../data/variables.xml.in.h:67 msgid "r:planck_temperature,ais:T_P" msgstr "" #: ../data/variables.xml.in.h:68 msgid "Planck Mass" msgstr "普朗克质量" #: ../data/variables.xml.in.h:69 msgid "r:planck_mass,ais:m_P" msgstr "" #: ../data/variables.xml.in.h:70 msgid "Planck Length" msgstr "普朗克长度" #: ../data/variables.xml.in.h:71 msgid "r:planck_length,ais:l_P" msgstr "" #: ../data/variables.xml.in.h:72 msgid "Planck Constant" msgstr "普朗克常数" #: ../data/variables.xml.in.h:73 msgid "r:planck" msgstr "" #: ../data/variables.xml.in.h:74 msgid "Planck Constant over 2 pi" msgstr "普朗克常数每2π" #: ../data/variables.xml.in.h:75 msgid "r:planck2pi" msgstr "" #: ../data/variables.xml.in.h:76 msgid "Newtonian Constant of Gravitation" msgstr "牛顿引力常数" #: ../data/variables.xml.in.h:77 msgid "r:newtonian_constant,a:G" msgstr "" #: ../data/variables.xml.in.h:78 msgid "Electric Constant (Permittivity of Free Space)" msgstr "介电常数(自由空间介电常数)" #: ../data/variables.xml.in.h:79 msgid "r:electric_constant,aisu:ε_0" msgstr "" #: ../data/variables.xml.in.h:80 msgid "Magnetic Constant (Permeability of Free Space)" msgstr "磁常数(自由空间磁导率)" #: ../data/variables.xml.in.h:81 msgid "r:magnetic_constant,aisu:μ_0" msgstr "" #: ../data/variables.xml.in.h:82 msgid "Characteristic Impedance of Vacuum" msgstr "真空特性阻抗" #: ../data/variables.xml.in.h:83 msgid "r:characteristic_impedance,ais:Z_0" msgstr "" #: ../data/variables.xml.in.h:84 msgid "Electromagnetic Constants" msgstr "电磁常数" #: ../data/variables.xml.in.h:85 msgid "Bohr Magneton" msgstr "玻尔磁子" #: ../data/variables.xml.in.h:86 msgid "r:bohr_magneton,aisu:μ_B" msgstr "" #: ../data/variables.xml.in.h:87 msgid "Conductance Quantum" msgstr "量子电导" #: ../data/variables.xml.in.h:88 msgid "r:conductance_quantum,ais:G_0" msgstr "" #: ../data/variables.xml.in.h:89 msgid "Elementary Charge" msgstr "基本电荷" #: ../data/variables.xml.in.h:90 msgid "r:elementary_charge,ais:e_charge" msgstr "" #: ../data/variables.xml.in.h:91 msgid "Josephson Constant" msgstr "约瑟夫森常数" #: ../data/variables.xml.in.h:92 msgid "r:josephson,ais:K_J" msgstr "" #: ../data/variables.xml.in.h:93 msgid "Magnetic Flux Quantum" msgstr "磁通量量子" #: ../data/variables.xml.in.h:94 msgid "r:magnetic_flux_quantum,aisu:Φ_0" msgstr "" #: ../data/variables.xml.in.h:95 msgid "Nuclear Magneton" msgstr "核磁子" #: ../data/variables.xml.in.h:96 msgid "r:nuclear_magneton,aisu:μ_N" msgstr "" #: ../data/variables.xml.in.h:97 msgid "von Klitzing Constant" msgstr "冯·克里青常数" #: ../data/variables.xml.in.h:98 msgid "r:klitzing,ais:R_K" msgstr "" #: ../data/variables.xml.in.h:99 msgid "Atomic and Nuclear Constants" msgstr "原子与核物理常数" #: ../data/variables.xml.in.h:100 msgid "Alpha Particle Mass" msgstr "α粒子质量" #: ../data/variables.xml.in.h:101 msgid "r:alpha_particle_mass,aisu:m_α" msgstr "" #: ../data/variables.xml.in.h:102 msgid "Bohr Radius" msgstr "玻尔半径" #: ../data/variables.xml.in.h:103 msgid "r:bohr_radius,ais:a_o" msgstr "" #: ../data/variables.xml.in.h:104 msgid "Classical Electron Radius" msgstr "经典电子半径" #: ../data/variables.xml.in.h:105 msgid "r:classical_electron_radius,ais:r_e" msgstr "" #: ../data/variables.xml.in.h:106 msgid "Compton Wavelength" msgstr "康普顿波长" #: ../data/variables.xml.in.h:107 msgid "r:compton_wavelength,aisu:λ_C" msgstr "" #: ../data/variables.xml.in.h:108 msgid "Electron Mass" msgstr "电子质量" #: ../data/variables.xml.in.h:109 msgid "r:electron_mass,ais:m_e" msgstr "" #: ../data/variables.xml.in.h:110 msgid "Helion Mass" msgstr "Helion质量" #: ../data/variables.xml.in.h:111 msgid "r:helion_mass,ais:m_h" msgstr "" #: ../data/variables.xml.in.h:112 msgid "Neutron Mass" msgstr "中子质量" #: ../data/variables.xml.in.h:113 msgid "r:neutron_mass,ais:m_n" msgstr "" #: ../data/variables.xml.in.h:114 msgid "Proton Mass" msgstr "质子质量" #: ../data/variables.xml.in.h:115 msgid "r:proton_mass,ais:m_p" msgstr "" #: ../data/variables.xml.in.h:116 msgid "Rydberg Constant" msgstr "里德伯常数" #: ../data/variables.xml.in.h:117 msgid "r:rydberg,aisu:R_∞" msgstr "" #: ../data/variables.xml.in.h:118 msgid "Tau Mass" msgstr "γ质量" #: ../data/variables.xml.in.h:119 msgid "r:tau_mass,aisu:m_τ" msgstr "" #: ../data/variables.xml.in.h:120 msgid "Physico-Chemical Constants" msgstr "物理化学常数" #: ../data/variables.xml.in.h:121 msgid "Atomic Mass Constant" msgstr "原子质量常数" #: ../data/variables.xml.in.h:122 msgid "r:atomic_mass,ais:m_u" msgstr "" #: ../data/variables.xml.in.h:123 msgid "Avogadro Constant" msgstr "阿佛加德罗常数" #: ../data/variables.xml.in.h:124 msgid "r:avogadro,ais:N_A" msgstr "" #: ../data/variables.xml.in.h:125 msgid "Boltzmann Constant" msgstr "玻耳兹曼常数" #: ../data/variables.xml.in.h:126 msgid "r:boltzmann" msgstr "" #: ../data/variables.xml.in.h:127 msgid "Faraday Constant" msgstr "法拉第常数" #: ../data/variables.xml.in.h:128 msgid "r:faraday" msgstr "" #: ../data/variables.xml.in.h:129 msgid "First Radiation Constant" msgstr "第一辐射常数" #: ../data/variables.xml.in.h:130 msgid "r:first_radiation,ais:c_1" msgstr "" #: ../data/variables.xml.in.h:131 msgid "Ideal Gas Constant" msgstr "理想气体常数" #: ../data/variables.xml.in.h:132 msgid "r:ideal_gas" msgstr "" #: ../data/variables.xml.in.h:133 msgid "Second Radiation Constant" msgstr "第二辐射常数" #: ../data/variables.xml.in.h:134 msgid "r:second_radiation,ais:c_2" msgstr "" #: ../data/variables.xml.in.h:135 msgid "Basic Constants" msgstr "基本常数" #: ../data/variables.xml.in.h:136 msgid "Golden Ratio" msgstr "黄金比例" #: ../data/variables.xml.in.h:137 msgid "r:golden,au:φ" msgstr "" #: ../data/variables.xml.in.h:138 msgid "Omega Constant" msgstr "Ω常数" #: ../data/variables.xml.in.h:139 msgid "r:omega" msgstr "" #: ../data/variables.xml.in.h:140 msgid "Pythagoras' Constant (sqrt 2)" msgstr "毕达哥拉斯常数(根号2)" #: ../data/variables.xml.in.h:141 msgid "r:pythagoras" msgstr "" #: ../data/variables.xml.in.h:142 msgid "Apery's Constant" msgstr "Apery常数" #: ../data/variables.xml.in.h:143 msgid "r:apery" msgstr "" #: ../data/variables.xml.in.h:144 msgid "Base of Natural Logarithms (e)" msgstr "自然对数的底e" #: ../data/variables.xml.in.h:145 msgid "r:e" msgstr "" #: ../data/variables.xml.in.h:146 msgid "Archimedes' Constant (pi)" msgstr "圆周率(π)" #: ../data/variables.xml.in.h:147 msgid "au:π,r:pi" msgstr "" #: ../data/variables.xml.in.h:148 msgid "Euler's Constant" msgstr "欧拉常数" #: ../data/variables.xml.in.h:149 msgid "au:γ,r:euler" msgstr "" #: ../data/variables.xml.in.h:150 msgid "Catalan's Constant" msgstr "Catalan常数" #: ../data/variables.xml.in.h:151 msgid "r:catalan" msgstr "" #: ../data/variables.xml.in.h:152 msgid "Special Numbers" msgstr "特殊数字" #: ../data/variables.xml.in.h:153 msgid "Imaginary i (sqrt -1)" msgstr "虚数i(sqrt -1)" #: ../data/variables.xml.in.h:154 msgid "r:i" msgstr "" #: ../data/variables.xml.in.h:155 msgid "Infinity" msgstr "无穷" #: ../data/variables.xml.in.h:156 msgid "a:∞,r:infinity" msgstr "" #: ../data/variables.xml.in.h:157 msgid "Positive Infinity" msgstr "正无穷" #: ../data/variables.xml.in.h:158 msgid "r:plus_infinity" msgstr "" #: ../data/variables.xml.in.h:159 msgid "Negative Infinity" msgstr "负无穷" #: ../data/variables.xml.in.h:160 msgid "r:minus_infinity" msgstr "" #: ../data/variables.xml.in.h:161 msgid "Undefined" msgstr "未定义的" #: ../data/variables.xml.in.h:162 msgid "r:undefined" msgstr "" #: ../data/variables.xml.in.h:163 msgid "False" msgstr "假" #: ../data/variables.xml.in.h:164 msgid "r:false,r:no" msgstr "" #: ../data/variables.xml.in.h:165 msgid "True" msgstr "真" #: ../data/variables.xml.in.h:166 msgid "r:true,r:yes" msgstr "" #: ../data/variables.xml.in.h:167 msgid "Unknowns" msgstr "未知数" #: ../data/variables.xml.in.h:168 msgid "r:x" msgstr "" #: ../data/variables.xml.in.h:169 msgid "r:y" msgstr "" #: ../data/variables.xml.in.h:170 msgid "r:z" msgstr "" #~ msgid "r:cbrt" #~ msgstr "r:cbrt" #~ msgid "ar:PHP" #~ msgstr "ar:PHP" #~ msgid "ar:EEK" #~ msgstr "ar:EEK" #~ msgid "tolar,ar:SIT" #~ msgstr "tolar,ar:SIT" #~ msgid "ar:TRY" #~ msgstr "ar:TRY" #~ msgid "ar:KRW" #~ msgstr "ar:KRW" #~ msgid "ar:GRD" #~ msgstr "ar:GRD" #~ msgid "ar:FRF,franc" #~ msgstr "ar:FRF,法郎" #~ msgid "Ionization Potential" #~ msgstr "电离电位" #~ msgid "r:ionization" #~ msgstr "r:ionization" #~ msgid "Covalent Radius" #~ msgstr "共价半径" #~ msgid "r:covalent" #~ msgstr "r:covalent" #, fuzzy #~ msgid "Value 1 (n)" #~ msgstr "值1(i)" #~ msgid "Price per $100 face value of a security bond" #~ msgstr "一支债券每$100票面价值的价格" #~ msgid "r:infinity" #~ msgstr "r:infinity" #~ msgid "Derive" #~ msgstr "求导" libqalculate-0.9.10/po-defs/nl.po0000644000175000017500000052242012725577361013516 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: 2016-06-07 19:05+0200\n" "PO-Revision-Date: 2007-05-18 15:47+0200\n" "Last-Translator: Jaap Woldringh \n" "Language-Team: \n" "Language: \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 "Currency" msgstr "Valuta" #: ../data/currencies.xml.in.h:2 msgid "European Euros" msgstr "Europese euro" #: ../data/currencies.xml.in.h:3 msgid "ar:EUR,au:€,euro,p:euros" msgstr "" #: ../data/currencies.xml.in.h:4 msgid "U.S. Dollars" msgstr "U.S. dollar" #: ../data/currencies.xml.in.h:5 msgid "a:$,ar:USD,dollar,p:dollars" msgstr "" #: ../data/currencies.xml.in.h:6 msgid "Japanese Yen" msgstr "Japanse yen" #: ../data/currencies.xml.in.h:7 msgid "ar:JPY,au:¥,yen" msgstr "" #: ../data/currencies.xml.in.h:8 msgid "Danish Kroner" msgstr "Deense kroon" #: ../data/currencies.xml.in.h:9 msgid "ar:DKK" msgstr "" #: ../data/currencies.xml.in.h:10 msgid "British Pounds" msgstr "Britse Pond" #: ../data/currencies.xml.in.h:11 msgid "ar:GBP,au:£" msgstr "" #: ../data/currencies.xml.in.h:12 msgid "Thai Baht" msgstr "Thailandse bat" #: ../data/currencies.xml.in.h:13 msgid "ar:THB" msgstr "" #: ../data/currencies.xml.in.h:14 msgid "Swedish Krona" msgstr "Zweedse kroon" #: ../data/currencies.xml.in.h:15 msgid "ar:SEK" msgstr "" #: ../data/currencies.xml.in.h:16 msgid "Swiss Francs" msgstr "Zwitserse franc" #: ../data/currencies.xml.in.h:17 msgid "ar:CHF" msgstr "" #: ../data/currencies.xml.in.h:18 msgid "Icelandic Krona" msgstr "IJslandse kroon" #: ../data/currencies.xml.in.h:19 msgid "ar:ISK" msgstr "" #: ../data/currencies.xml.in.h:20 msgid "Norwegian Kroner" msgstr "Noorse kroon" #: ../data/currencies.xml.in.h:21 msgid "ar:NOK" msgstr "" #: ../data/currencies.xml.in.h:22 msgid "Bulgarian Lev" msgstr "Bulgaarse Lev" #: ../data/currencies.xml.in.h:23 msgid "lev,ar:BGN" msgstr "" #: ../data/currencies.xml.in.h:24 msgid "Russian Ruble" msgstr "Russische roebel" #: ../data/currencies.xml.in.h:25 msgid "ar:RUB,au:₽,ruble" msgstr "a:RUB,au:₽,roebel" #: ../data/currencies.xml.in.h:26 msgid "Philippine Peso" msgstr "Filippijnse peso" #: ../data/currencies.xml.in.h:27 msgid "ar:PHP,au:₱" msgstr "" #: ../data/currencies.xml.in.h:28 msgid "Malaysian Ringgit" msgstr "Maleisische ringgit" #: ../data/currencies.xml.in.h:29 msgid "ar:MYR" msgstr "" #: ../data/currencies.xml.in.h:30 msgid "Croatian Kuna" msgstr "Kroatische kuna" #: ../data/currencies.xml.in.h:31 msgid "ar:HRK" msgstr "" #: ../data/currencies.xml.in.h:32 msgid "Yuan Renminbi (PR China)" msgstr "" #: ../data/currencies.xml.in.h:33 msgid "ar:CNY" msgstr "" #: ../data/currencies.xml.in.h:34 msgid "Indonesian Rupiah" msgstr "Indonesische roepiah" #: ../data/currencies.xml.in.h:35 msgid "ar:IDR,rupiah" msgstr "" #: ../data/currencies.xml.in.h:36 msgid "Czech Koruna" msgstr "Tsjechische kroon" #: ../data/currencies.xml.in.h:37 msgid "ar:CZK" msgstr "" #: ../data/currencies.xml.in.h:38 msgid "Hungarian Forint" msgstr "Hongaarse forint" #: ../data/currencies.xml.in.h:39 msgid "forint,ar:HUF" msgstr "" #: ../data/currencies.xml.in.h:40 msgid "Polish Zloty" msgstr "Poolse zloty" #: ../data/currencies.xml.in.h:41 msgid "zloty,ar:PLN" msgstr "" #: ../data/currencies.xml.in.h:42 msgid "Romanian New Leu" msgstr "Nieuwe Roemeense leu" #: ../data/currencies.xml.in.h:43 msgid "leu,ar:RON" msgstr "" #: ../data/currencies.xml.in.h:44 msgid "Turkish New Lira" msgstr "Nieuwe Turkse lire" #: ../data/currencies.xml.in.h:45 msgid "ar:TRY,au:₺" msgstr "" #: ../data/currencies.xml.in.h:46 msgid "Australian Dollars" msgstr "Australische dollar" #: ../data/currencies.xml.in.h:47 msgid "ar:AUD" msgstr "" #: ../data/currencies.xml.in.h:48 msgid "Canadian Dollars" msgstr "Canadese dollar" #: ../data/currencies.xml.in.h:49 msgid "ar:CAD" msgstr "" #: ../data/currencies.xml.in.h:50 msgid "Hong Kong Dollars" msgstr "Hongkong dollar" #: ../data/currencies.xml.in.h:51 msgid "ar:HKD" msgstr "" #: ../data/currencies.xml.in.h:52 msgid "New Zealand Dollars" msgstr "Nieuwzeelandse dollar" #: ../data/currencies.xml.in.h:53 msgid "ar:NZD" msgstr "" #: ../data/currencies.xml.in.h:54 msgid "Singapore Dollars" msgstr "Singapore dollar" #: ../data/currencies.xml.in.h:55 msgid "ar:SGD" msgstr "" #: ../data/currencies.xml.in.h:56 msgid "South Korean Won" msgstr "Zuid-Koreaanse won" #: ../data/currencies.xml.in.h:57 msgid "ar:KRW,au:₩,won" msgstr "" #: ../data/currencies.xml.in.h:58 msgid "South African Rand" msgstr "Zuid-Afrikaanse rand" #: ../data/currencies.xml.in.h:59 msgid "ar:ZAR" msgstr "" #: ../data/currencies.xml.in.h:60 msgid "Indian Rupee" msgstr "" #: ../data/currencies.xml.in.h:61 msgid "ar:INR,au:₹,rupee" msgstr "" #: ../data/currencies.xml.in.h:62 msgid "Israeli New Sheqel" msgstr "" #: ../data/currencies.xml.in.h:63 msgid "ar:ILS,au:₪,sheqel" msgstr "" #: ../data/currencies.xml.in.h:64 msgid "Mexican Peso" msgstr "" #: ../data/currencies.xml.in.h:65 msgid "ar:MXN" msgstr "" #: ../data/currencies.xml.in.h:66 msgid "Brazilian Real" msgstr "" #: ../data/currencies.xml.in.h:67 msgid "ar:BRL" msgstr "" #: ../data/currencies.xml.in.h:68 msgid "Euro Cent" msgstr "Eurocent" #: ../data/currencies.xml.in.h:69 msgid "r:eurocent,p:eurocents" msgstr "eurocent,p:eurocenten" #: ../data/currencies.xml.in.h:70 msgid "Cent (USD)" msgstr "Cent (USD)" #: ../data/currencies.xml.in.h:71 msgid "au:¢,r:cent,p:cents" msgstr "au:¢,cent,p:centen" #: ../data/currencies.xml.in.h:72 msgid "Belgian Franc" msgstr "Belgische frank" #: ../data/currencies.xml.in.h:73 msgid "ar:BEF" msgstr "" #: ../data/currencies.xml.in.h:74 msgid "Greek Drachma" msgstr "Griekse drachme" #: ../data/currencies.xml.in.h:75 msgid "ar:GRD,au:₯,drachma" msgstr "" #: ../data/currencies.xml.in.h:76 msgid "French Franc" msgstr "Franse franc" #: ../data/currencies.xml.in.h:77 msgid "ar:FRF,au:₣,franc" msgstr "" #: ../data/currencies.xml.in.h:78 msgid "Italian Lira" msgstr "Italiaanse lire" #: ../data/currencies.xml.in.h:79 msgid "ar:ITL,au:₤,lira" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:80 msgid "Dutch Guilder" msgstr "Nederlandse gulden" #: ../data/currencies.xml.in.h:81 msgid "ar:NLG,guilder" msgstr "a:NLG,gulden" #: ../data/currencies.xml.in.h:82 msgid "Portuguese Escudo" msgstr "Portugese escudo" #: ../data/currencies.xml.in.h:83 msgid "ar:PTE,escudo" msgstr "" #: ../data/currencies.xml.in.h:84 msgid "Deutsche Mark" msgstr "Duitse mark" #: ../data/currencies.xml.in.h:85 msgid "ar:DEM,mark" msgstr "" #: ../data/currencies.xml.in.h:86 msgid "Spanish Peseta" msgstr "Spaanse peseta" #: ../data/currencies.xml.in.h:87 msgid "ar:ESP,au:₧,peseta,p:pesetas" msgstr "" #: ../data/currencies.xml.in.h:88 msgid "Irish Pound" msgstr "Ierse pond" #: ../data/currencies.xml.in.h:89 msgid "ar:IEP" msgstr "" #: ../data/currencies.xml.in.h:90 msgid "Luxembourg Franc" msgstr "Luxemburgse frank" #: ../data/currencies.xml.in.h:91 msgid "ar:LUF" msgstr "" #: ../data/currencies.xml.in.h:92 msgid "Austrian Schilling" msgstr "Oostenrijkse schilling" #: ../data/currencies.xml.in.h:93 msgid "ar:ATS,schilling" msgstr "" #: ../data/currencies.xml.in.h:94 msgid "Finnish Markka" msgstr "Finse mark" #: ../data/currencies.xml.in.h:95 msgid "ar:FIM,markka" msgstr "" #: ../data/currencies.xml.in.h:96 msgid "Slovenian Tolar" msgstr "Sloveense tolar" #: ../data/currencies.xml.in.h:97 msgid "ar:SIT,tolar" msgstr "" #: ../data/currencies.xml.in.h:98 msgid "Cypriot Pound" msgstr "Cypriotische pond" #: ../data/currencies.xml.in.h:99 msgid "ar:CYP" msgstr "" #: ../data/currencies.xml.in.h:100 msgid "Estonian Kroon" msgstr "Estlandse kroon" #: ../data/currencies.xml.in.h:101 msgid "ar:EEK,kroon,p:krooni" msgstr "" #: ../data/currencies.xml.in.h:102 msgid "Slovak Koruna" msgstr "Slowaakse kroon" #: ../data/currencies.xml.in.h:103 msgid "ar:SKK" msgstr "" #: ../data/currencies.xml.in.h:104 msgid "Maltese Lira" msgstr "Maltese Lira" #: ../data/currencies.xml.in.h:105 msgid "ar:MTL" msgstr "" #: ../data/currencies.xml.in.h:106 msgid "Latvian Lats" msgstr "Letlandse lat" #: ../data/currencies.xml.in.h:107 msgid "lats,ar:LVL" msgstr "" #: ../data/currencies.xml.in.h:108 msgid "Lithuanian Litas" msgstr "Litouwse litas" #: ../data/currencies.xml.in.h:109 msgid "litas,ar:LTL" msgstr "" #: ../data/datasets.xml.in.h:1 msgid "Data Sets" msgstr "Gegevensverzamelingen" #. Data set for chemical elements #: ../data/datasets.xml.in.h:3 msgid "!datasets!Elements" msgstr "Elementen" #: ../data/datasets.xml.in.h:4 msgid "r:atom" msgstr "atoom" #. Object argument for chemical elements data set #: ../data/datasets.xml.in.h:6 msgid "!datasets!Element" msgstr "" #: ../data/datasets.xml.in.h:7 msgid "Symbol" msgstr "Symbool" #: ../data/datasets.xml.in.h:8 msgid "r:symbol" msgstr "symbool" #. Chemical elements number #: ../data/datasets.xml.in.h:10 msgid "!datasets!Number" msgstr "Getal" #. Chemical elements number #: ../data/datasets.xml.in.h:12 msgid "!datasets!r:number" msgstr "getal" #: ../data/datasets.xml.in.h:13 ../data/functions.xml.in.h:574 msgid "Name" msgstr "Naam" #: ../data/datasets.xml.in.h:14 msgid "r:name" msgstr "naam" #: ../data/datasets.xml.in.h:15 msgid "Classification" msgstr "Klassificatie" #: ../data/datasets.xml.in.h:16 #, fuzzy 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 Polyatomic Non-Metal 9 Diatomic Non-" "Metal 10 Noble Gas 11 Unknown chemical properties" 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:17 msgid "r:class" msgstr "klasse" #: ../data/datasets.xml.in.h:18 ../data/functions.xml.in.h:352 msgid "Weight" msgstr "Gewicht" #: ../data/datasets.xml.in.h:19 msgid "r:weight,mass" msgstr "gewicht,massa" #: ../data/datasets.xml.in.h:20 msgid "Boiling Point" msgstr "Kookpunt" #: ../data/datasets.xml.in.h:21 msgid "r:boiling" msgstr "kokend" #: ../data/datasets.xml.in.h:22 msgid "Melting Point" msgstr "Smeltpunt" #: ../data/datasets.xml.in.h:23 msgid "r:melting" msgstr "smeltend" #: ../data/datasets.xml.in.h:24 ../data/units.xml.in.h:119 msgid "Density" msgstr "Dichtheid" #: ../data/datasets.xml.in.h:25 msgid "Density at 295K" msgstr "Dichtheid bij 295K" #: ../data/datasets.xml.in.h:26 msgid "r:density" msgstr "dichtheid" #: ../data/datasets.xml.in.h:27 msgid "X Position" msgstr "X Positie" #: ../data/datasets.xml.in.h:28 msgid "r:x_pos" msgstr "" #: ../data/datasets.xml.in.h:29 msgid "Y Position" msgstr "Y Positie" #: ../data/datasets.xml.in.h:30 msgid "r:y_pos" msgstr "" #: ../data/datasets.xml.in.h:31 msgid "Planets" msgstr "Planeten" #: ../data/datasets.xml.in.h:32 msgid "r:planet" msgstr "planeet" #: ../data/datasets.xml.in.h:33 msgid "Planet" msgstr "Planeet" #: ../data/datasets.xml.in.h:34 msgid "Orbital Period (Year)" msgstr "Omloopperiode (Jaar)" #. Orbital period for planet #: ../data/datasets.xml.in.h:36 msgid "!datasets!r:year" msgstr "jaar" #: ../data/datasets.xml.in.h:37 msgid "Average Orbital Speed" msgstr "Gemiddelde baansnelheid" #: ../data/datasets.xml.in.h:38 msgid "r:speed" msgstr "snelheid" #: ../data/datasets.xml.in.h:39 msgid "Eccentricity" msgstr "Excentriciteit" #: ../data/datasets.xml.in.h:40 msgid "r:eccentricity" msgstr "excentriciteit" #: ../data/datasets.xml.in.h:41 msgid "Inclination" msgstr "Inclinatie" #: ../data/datasets.xml.in.h:42 msgid "r:inclination" msgstr "inclinatie" #: ../data/datasets.xml.in.h:43 msgid "Number of Satellites" msgstr "Aantal satellieten" #: ../data/datasets.xml.in.h:44 msgid "r:satellites" msgstr "satellieten" #. Planet mass #: ../data/datasets.xml.in.h:46 msgid "!datasets!Mass" msgstr "Massa" #: ../data/datasets.xml.in.h:47 msgid "r:mass" msgstr "massa" #: ../data/datasets.xml.in.h:48 msgid "Mean Density" msgstr "Gemiddelde dichtheid" #: ../data/datasets.xml.in.h:49 msgid "Surface Area" msgstr "Oppervlak (3D)" #. Surface area of planet #: ../data/datasets.xml.in.h:51 msgid "!datasets!r:area" msgstr "oppervlak" #: ../data/datasets.xml.in.h:52 msgid "Equatorial Gravity" msgstr "Equatoriale zwaartekracht" #: ../data/datasets.xml.in.h:53 msgid "r:gravity" msgstr "zwaartekracht" #: ../data/datasets.xml.in.h:54 msgid "Mean Surface Temperature" msgstr "Gemiddelde oppervlaktetemperatuur" #: ../data/datasets.xml.in.h:55 msgid "r:temperature" msgstr "temperatuur" #: ../data/elements.xml.in.h:1 msgid "Hydrogen" msgstr "Waterstof" #: ../data/elements.xml.in.h:2 msgid "Helium" msgstr "" #: ../data/elements.xml.in.h:3 msgid "Lithium" msgstr "" #: ../data/elements.xml.in.h:4 msgid "Beryllium" msgstr "" #: ../data/elements.xml.in.h:5 msgid "Boron" msgstr "Boor" #: ../data/elements.xml.in.h:6 msgid "Carbon" msgstr "Koolstof" #: ../data/elements.xml.in.h:7 msgid "Nitrogen" msgstr "Stikstof" #: ../data/elements.xml.in.h:8 msgid "Oxygen" msgstr "Zuurstof" #: ../data/elements.xml.in.h:9 msgid "Fluorine" msgstr "Fluor" #: ../data/elements.xml.in.h:10 msgid "Neon" msgstr "" #: ../data/elements.xml.in.h:11 msgid "Sodium" msgstr "Natrium" #: ../data/elements.xml.in.h:12 msgid "Magnesium" msgstr "" #: ../data/elements.xml.in.h:13 msgid "Aluminum" msgstr "Aluminium" #: ../data/elements.xml.in.h:14 msgid "Silicon" msgstr "Silicium" #: ../data/elements.xml.in.h:15 msgid "Phosphorus" msgstr "Fosfor" #: ../data/elements.xml.in.h:16 msgid "Sulfur" msgstr "Zwavel" #: ../data/elements.xml.in.h:17 msgid "Chlorine" msgstr "Chloor" #: ../data/elements.xml.in.h:18 msgid "Argon" msgstr "" #: ../data/elements.xml.in.h:19 msgid "Potassium" msgstr "Kalium" #: ../data/elements.xml.in.h:20 msgid "Calcium" msgstr "" #: ../data/elements.xml.in.h:21 msgid "Scandium" msgstr "" #: ../data/elements.xml.in.h:22 msgid "Titanium" msgstr "Titaan" #: ../data/elements.xml.in.h:23 msgid "Vanadium" msgstr "" #: ../data/elements.xml.in.h:24 msgid "Chromium" msgstr "Chroom" #: ../data/elements.xml.in.h:25 msgid "Manganese" msgstr "Mangaan" #: ../data/elements.xml.in.h:26 msgid "Iron" msgstr "IJzer" #: ../data/elements.xml.in.h:27 msgid "Cobalt" msgstr "Kobalt" #: ../data/elements.xml.in.h:28 msgid "Nickel" msgstr "Nikkel" #: ../data/elements.xml.in.h:29 msgid "Copper" msgstr "Koper" #: ../data/elements.xml.in.h:30 msgid "Zinc" msgstr "Zink" #: ../data/elements.xml.in.h:31 msgid "Gallium" msgstr "" #: ../data/elements.xml.in.h:32 msgid "Germanium" msgstr "" #: ../data/elements.xml.in.h:33 msgid "Arsenic" msgstr "Arsenicum" #: ../data/elements.xml.in.h:34 msgid "Selenium" msgstr "" #: ../data/elements.xml.in.h:35 msgid "Bromine" msgstr "Broom" #: ../data/elements.xml.in.h:36 msgid "Krypton" msgstr "" #: ../data/elements.xml.in.h:37 msgid "Rubidium" msgstr "" #: ../data/elements.xml.in.h:38 msgid "Strontium" msgstr "" #: ../data/elements.xml.in.h:39 msgid "Yttrium" msgstr "" #: ../data/elements.xml.in.h:40 msgid "Zirconium" msgstr "" #: ../data/elements.xml.in.h:41 msgid "Niobium" msgstr "" #: ../data/elements.xml.in.h:42 msgid "Molybdenum" msgstr "Molybdeen" #: ../data/elements.xml.in.h:43 msgid "Technetium" msgstr "" #: ../data/elements.xml.in.h:44 msgid "Ruthenium" msgstr "" #: ../data/elements.xml.in.h:45 msgid "Rhodium" msgstr "" #: ../data/elements.xml.in.h:46 msgid "Palladium" msgstr "" #: ../data/elements.xml.in.h:47 msgid "Silver" msgstr "Zilver" #: ../data/elements.xml.in.h:48 msgid "Cadmium" msgstr "" #: ../data/elements.xml.in.h:49 msgid "Indium" msgstr "" #: ../data/elements.xml.in.h:50 msgid "Tin" msgstr "" #: ../data/elements.xml.in.h:51 msgid "Antimony" msgstr "Antimoon" #: ../data/elements.xml.in.h:52 msgid "Tellurium" msgstr "Telluur" #: ../data/elements.xml.in.h:53 msgid "Iodine" msgstr "Jood" #: ../data/elements.xml.in.h:54 msgid "Xenon" msgstr "" #: ../data/elements.xml.in.h:55 msgid "Cesium" msgstr "" #: ../data/elements.xml.in.h:56 msgid "Barium" msgstr "" #: ../data/elements.xml.in.h:57 msgid "Lanthanum" msgstr "Lanthaan" #: ../data/elements.xml.in.h:58 msgid "Cerium" msgstr "" #: ../data/elements.xml.in.h:59 msgid "Praseodymium" msgstr "" #: ../data/elements.xml.in.h:60 msgid "Neodymium" msgstr "" #: ../data/elements.xml.in.h:61 msgid "Promethium" msgstr "" #: ../data/elements.xml.in.h:62 msgid "Samarium" msgstr "" #: ../data/elements.xml.in.h:63 msgid "Europium" msgstr "" #: ../data/elements.xml.in.h:64 msgid "Gadolinium" msgstr "" #: ../data/elements.xml.in.h:65 msgid "Terbium" msgstr "" #: ../data/elements.xml.in.h:66 msgid "Dysprosium" msgstr "" #: ../data/elements.xml.in.h:67 msgid "Holmium" msgstr "" #: ../data/elements.xml.in.h:68 msgid "Erbium" msgstr "" #: ../data/elements.xml.in.h:69 msgid "Thulium" msgstr "" #: ../data/elements.xml.in.h:70 msgid "Ytterbium" msgstr "" #: ../data/elements.xml.in.h:71 msgid "Lutetium" msgstr "" #: ../data/elements.xml.in.h:72 msgid "Hafnium" msgstr "" #: ../data/elements.xml.in.h:73 msgid "Tantalum" msgstr "Tantaal" #: ../data/elements.xml.in.h:74 msgid "Tungsten" msgstr "" #: ../data/elements.xml.in.h:75 msgid "Rhenium" msgstr "" #: ../data/elements.xml.in.h:76 msgid "Osmium" msgstr "" #: ../data/elements.xml.in.h:77 msgid "Iridium" msgstr "" #: ../data/elements.xml.in.h:78 msgid "Platinum" msgstr "Platina" #: ../data/elements.xml.in.h:79 msgid "Gold" msgstr "Goud" #. Chemical element #: ../data/elements.xml.in.h:81 msgid "!elements!Mercury" msgstr "Kwik" #: ../data/elements.xml.in.h:82 msgid "Thallium" msgstr "" #: ../data/elements.xml.in.h:83 msgid "Lead" msgstr "Lood" #: ../data/elements.xml.in.h:84 msgid "Bismuth" msgstr "Bismut" #: ../data/elements.xml.in.h:85 msgid "Polonium" msgstr "" #: ../data/elements.xml.in.h:86 msgid "Astatine" msgstr "" #: ../data/elements.xml.in.h:87 msgid "Radon" msgstr "" #: ../data/elements.xml.in.h:88 msgid "Francium" msgstr "" #: ../data/elements.xml.in.h:89 msgid "Radium" msgstr "" #: ../data/elements.xml.in.h:90 msgid "Actinium" msgstr "" #: ../data/elements.xml.in.h:91 msgid "Thorium" msgstr "" #: ../data/elements.xml.in.h:92 msgid "Protactinium" msgstr "" #: ../data/elements.xml.in.h:93 msgid "Uranium" msgstr "Uraan" #: ../data/elements.xml.in.h:94 msgid "Neptunium" msgstr "" #: ../data/elements.xml.in.h:95 msgid "Plutonium" msgstr "" #: ../data/elements.xml.in.h:96 msgid "Americium" msgstr "" #: ../data/elements.xml.in.h:97 msgid "Curium" msgstr "" #: ../data/elements.xml.in.h:98 msgid "Berkelium" msgstr "" #: ../data/elements.xml.in.h:99 msgid "Californium" msgstr "" #: ../data/elements.xml.in.h:100 msgid "Einsteinium" msgstr "" #: ../data/elements.xml.in.h:101 msgid "Fermium" msgstr "" #: ../data/elements.xml.in.h:102 msgid "Mendelevium" msgstr "" #: ../data/elements.xml.in.h:103 msgid "Nobelium" msgstr "" #: ../data/elements.xml.in.h:104 msgid "Lawrencium" msgstr "" #: ../data/elements.xml.in.h:105 msgid "Rutherfordium" msgstr "" #: ../data/elements.xml.in.h:106 msgid "Dubnium" msgstr "" #: ../data/elements.xml.in.h:107 msgid "Seaborgium" msgstr "" #: ../data/elements.xml.in.h:108 msgid "Bohrium" msgstr "" #: ../data/elements.xml.in.h:109 msgid "Hassium" msgstr "" #: ../data/elements.xml.in.h:110 msgid "Meitnerium" msgstr "" #: ../data/elements.xml.in.h:111 msgid "Darmstadtium" msgstr "" #: ../data/elements.xml.in.h:112 msgid "Roentgenium" msgstr "" #: ../data/elements.xml.in.h:113 msgid "Copernicium" msgstr "" #: ../data/elements.xml.in.h:114 msgid "Ununtrium" msgstr "" #: ../data/elements.xml.in.h:115 msgid "Flerovium" msgstr "" #: ../data/elements.xml.in.h:116 msgid "Ununpentium" msgstr "" #: ../data/elements.xml.in.h:117 msgid "Livermorium" msgstr "" #: ../data/elements.xml.in.h:118 msgid "Ununseptium" msgstr "Ununseptium" #: ../data/elements.xml.in.h:119 msgid "Ununoctium" msgstr "Ununoctium" #: ../data/functions.xml.in.h:1 msgid "Matrices & Vectors" msgstr "Matrices & vectoren" #: ../data/functions.xml.in.h:2 msgid "Construct Vector" msgstr "Vector construeren" #: ../data/functions.xml.in.h:3 msgid "r:vector" msgstr "" #: ../data/functions.xml.in.h:4 msgid "Returns a vector with listed elements." msgstr "Retourneert een vector met de opgegeven elementen." #. Vector/matrix elements #: ../data/functions.xml.in.h:6 msgid "Elements" msgstr "Elementen" #: ../data/functions.xml.in.h:7 msgid "Generate Vector" msgstr "Vector aanmaken" #: ../data/functions.xml.in.h:8 msgid "r:genvector" msgstr "" #: ../data/functions.xml.in.h:9 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:10 msgid "Function" msgstr "Functie" #: ../data/functions.xml.in.h:11 msgid "Min" msgstr "" #: ../data/functions.xml.in.h:12 msgid "Max" msgstr "" #: ../data/functions.xml.in.h:13 msgid "Dimension / Step size" msgstr "Dimensie / stapgrootte" #: ../data/functions.xml.in.h:14 msgid "Variable" msgstr "Variabele" #: ../data/functions.xml.in.h:15 msgid "Use step size" msgstr "Stapgrootte gebruiken" #: ../data/functions.xml.in.h:16 msgid "Sort" msgstr "Sorteren" #: ../data/functions.xml.in.h:17 msgid "r:sort" msgstr "sorteren" #: ../data/functions.xml.in.h:18 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:19 msgid "Vector" msgstr "" #: ../data/functions.xml.in.h:20 msgid "Ascending" msgstr "Oplopend" #: ../data/functions.xml.in.h:21 msgid "Rank" msgstr "Rangorde" #: ../data/functions.xml.in.h:22 msgid "r:rank" msgstr "rangorde" #: ../data/functions.xml.in.h:23 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:24 msgid "Vector Limits" msgstr "Vectorgrenzen" #: ../data/functions.xml.in.h:25 msgid "r:limits" msgstr "grenzen" #: ../data/functions.xml.in.h:26 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:27 msgid "Lower limit" msgstr "Ondergrens" #: ../data/functions.xml.in.h:28 msgid "Upper limit" msgstr "Bovengrens" #: ../data/functions.xml.in.h:29 msgid "Dimension" msgstr "Dimensie" #: ../data/functions.xml.in.h:30 msgid "r:dimension" msgstr "dimensie" #: ../data/functions.xml.in.h:31 msgid "Returns the number of elements in a vector." msgstr "Retourneert het aantal elementen in een vector." #: ../data/functions.xml.in.h:32 msgid "Merge Vectors" msgstr "Vectoren samenvoegen" #: ../data/functions.xml.in.h:33 msgid "r:mergevectors" msgstr "vectorensamenvoegen" #: ../data/functions.xml.in.h:34 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:35 msgid "Vector 1" msgstr "" #: ../data/functions.xml.in.h:36 msgid "Vector 2" msgstr "" #: ../data/functions.xml.in.h:37 msgid "Construct Matrix" msgstr "Matrix construeren" #: ../data/functions.xml.in.h:38 msgid "r:matrix" msgstr "" #: ../data/functions.xml.in.h:39 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:40 msgid "Rows" msgstr "Rijen" #: ../data/functions.xml.in.h:41 msgid "Columns" msgstr "Kolommen" #: ../data/functions.xml.in.h:42 msgid "Convert Matrix to Vector" msgstr "Matrix naar vector converteren" #: ../data/functions.xml.in.h:43 msgid "r:matrix2vector" msgstr "" #: ../data/functions.xml.in.h:44 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:45 msgid "Matrix" msgstr "" #: ../data/functions.xml.in.h:46 msgid "Matrix Area" msgstr "Matrixbereik" #. Matrix area #: ../data/functions.xml.in.h:48 msgid "r:area" msgstr "oppervlak" #: ../data/functions.xml.in.h:49 msgid "Returns a part of a matrix." msgstr "Retourneert een deel van een matrix." #: ../data/functions.xml.in.h:50 msgid "Start row" msgstr "Startrij" #: ../data/functions.xml.in.h:51 msgid "Start column" msgstr "Startkolom" #: ../data/functions.xml.in.h:52 msgid "End row" msgstr "Einde rij" #: ../data/functions.xml.in.h:53 msgid "End column" msgstr "Einde kolom" #: ../data/functions.xml.in.h:54 msgid "r:rows" msgstr "rijen" #: ../data/functions.xml.in.h:55 msgid "Returns the number of rows in a matrix." msgstr "Retourneert het aantal rijen in een matrix." #: ../data/functions.xml.in.h:56 msgid "r:columns" msgstr "kolommen" #: ../data/functions.xml.in.h:57 msgid "Returns the number of columns in a matrix." msgstr "Retourneert het aantal kolommen in een matrix." #: ../data/functions.xml.in.h:58 msgid "Extract row as vector" msgstr "Rij als vector uit (matrix) halen" #: ../data/functions.xml.in.h:59 msgid "r:row" msgstr "rij" #: ../data/functions.xml.in.h:60 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:61 msgid "Row" msgstr "Rij" #: ../data/functions.xml.in.h:62 msgid "Extract Column as Vector" msgstr "Kolom als vector uit (matrix) halen" #: ../data/functions.xml.in.h:63 msgid "r:column" msgstr "kolom" #: ../data/functions.xml.in.h:64 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:65 msgid "Column" msgstr "Kolom" #: ../data/functions.xml.in.h:66 msgid "r:elements" msgstr "elementen" #: ../data/functions.xml.in.h:67 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:68 msgid "Matrix or vector" msgstr "Matrix of vector" #. Vector/matrix element #: ../data/functions.xml.in.h:70 msgid "Element" msgstr "" #: ../data/functions.xml.in.h:71 msgid "r:element" msgstr "" #: ../data/functions.xml.in.h:72 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:73 msgid "Matrix/vector" msgstr "Matrix/vector" #: ../data/functions.xml.in.h:74 msgid "Row/index" msgstr "Rij/Index" #: ../data/functions.xml.in.h:75 msgid "Transpose" msgstr "Transponeren" #: ../data/functions.xml.in.h:76 msgid "r:transpose" msgstr "transponeren" #: ../data/functions.xml.in.h:77 msgid "Returns the transpose of a matrix." msgstr "Retourneert de getransponeerde van een matrix." #: ../data/functions.xml.in.h:78 msgid "Identity" msgstr "Identiteit" #: ../data/functions.xml.in.h:79 msgid "r:identity" msgstr "identiteit" #: ../data/functions.xml.in.h:80 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:81 msgid "Matrix or rows/columns" msgstr "Matrix of rijen/kolommen" #: ../data/functions.xml.in.h:82 msgid "Determinant" msgstr "" #: ../data/functions.xml.in.h:83 msgid "r:det" msgstr "" #: ../data/functions.xml.in.h:84 msgid "Calculates the determinant of a matrix." msgstr "Berekent de determinant van een matrix." #: ../data/functions.xml.in.h:85 msgid "Permanent" msgstr "" #: ../data/functions.xml.in.h:86 msgid "r:permanent" msgstr "" #: ../data/functions.xml.in.h:87 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:88 msgid "Adjugate (Adjoint)" msgstr "Aangrenzend" #: ../data/functions.xml.in.h:89 msgid "r:adj" msgstr "" #: ../data/functions.xml.in.h:90 msgid "Calculates the adjugate or adjoint of a matrix." msgstr "Berekent de geadjungeerde matrix." #: ../data/functions.xml.in.h:91 msgid "Cofactor" msgstr "" #: ../data/functions.xml.in.h:92 msgid "r:cofactor" msgstr "" #: ../data/functions.xml.in.h:93 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:94 msgid "Matrix Inverse" msgstr "Inverse matrix" #: ../data/functions.xml.in.h:95 msgid "r:inverse" msgstr "" #: ../data/functions.xml.in.h:96 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:97 msgid "Load CSV File" msgstr "Inlezen CSV-bestand" #: ../data/functions.xml.in.h:98 msgid "r:load" msgstr "lees" #: ../data/functions.xml.in.h:99 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:100 msgid "Filename" msgstr "Bestandsnaam" #: ../data/functions.xml.in.h:101 msgid "First data row" msgstr "Eerste gegevensrij" #: ../data/functions.xml.in.h:102 msgid "Separator" msgstr "Scheidingsteken" #: ../data/functions.xml.in.h:103 msgid "Export To CSV File" msgstr "Exporteren naar CSV-bestand" #: ../data/functions.xml.in.h:104 msgid "r:export" msgstr "exporteren" #: ../data/functions.xml.in.h:105 msgid "Exports a matrix to a CSV data file." msgstr "Exporteert een matrix naar een CSV-gegevensbestand." #: ../data/functions.xml.in.h:106 msgid "Norm (length)" msgstr "Norm (lengte)" #: ../data/functions.xml.in.h:107 msgid "r:norm" msgstr "" #: ../data/functions.xml.in.h:108 msgid "Calculates the norm/length of a vector." msgstr "Berekent de norm/lengte van een vector." #: ../data/functions.xml.in.h:109 msgid "Cross Product" msgstr "Uitproduct" #: ../data/functions.xml.in.h:110 msgid "r:cross" msgstr "uitproduct" #: ../data/functions.xml.in.h:111 msgid "Calculates the cross product of two 3-dimensional vectors." msgstr "Berekent het uitproduct van twee 3-dimensionale vectoren." #: ../data/functions.xml.in.h:112 msgid "Combinatorics" msgstr "Combinatoriek" #: ../data/functions.xml.in.h:113 msgid "Factorial" msgstr "Faculteit" #: ../data/functions.xml.in.h:114 #, fuzzy msgid "" "Calculates the factorial of an integer. Multiplies 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:115 msgid "r:factorial" msgstr "faculteit" #: ../data/functions.xml.in.h:116 msgid "Value" msgstr "Waarde" #: ../data/functions.xml.in.h:117 msgid "Double Factorial" msgstr "Dubbele faculteit" #: ../data/functions.xml.in.h:118 msgid "r:factorial2" msgstr "faculteit2" #: ../data/functions.xml.in.h:119 #, fuzzy msgid "" "Calculates the double factorial of an integer. Multiplies 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:120 msgid "Multifactorial" msgstr "Multifaculteit" #: ../data/functions.xml.in.h:121 msgid "r:multifactorial" msgstr "multifaculteit" #: ../data/functions.xml.in.h:122 #, fuzzy msgid "" "Calculates the multifactorial of an integer. Multiplies 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:123 msgid "Binomial Coefficient" msgstr "Binomiaalcoëfficiënt" #: ../data/functions.xml.in.h:124 msgid "r:binomial" msgstr "binomiaal" #: ../data/functions.xml.in.h:125 msgid "Exponent" msgstr "" #: ../data/functions.xml.in.h:126 msgid "Index" msgstr "" #: ../data/functions.xml.in.h:127 msgid "Hyperfactorial" msgstr "Hyperfaculteit" #: ../data/functions.xml.in.h:128 msgid "r:hyperfactorial" msgstr "hyperfaculteit" #: ../data/functions.xml.in.h:129 #, fuzzy msgid "" "Calculates the hyperfactorial of an integer. Multiplies 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:130 msgid "Superfactorial" msgstr "Superfaculteit" #: ../data/functions.xml.in.h:131 msgid "r:superfactorial" msgstr "superfaculteit" #: ../data/functions.xml.in.h:132 #, fuzzy msgid "" "Calculates the superfactorial of an integer. Multiplies 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:133 msgid "Permutations (Variations)" msgstr "Permutaties (Variaties)" #: ../data/functions.xml.in.h:134 msgid "r:perm,variations" msgstr "perm,variaties" #: ../data/functions.xml.in.h:135 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:136 msgid "Objects" msgstr "Objecten" #: ../data/functions.xml.in.h:137 msgid "Size" msgstr "Grootte" #: ../data/functions.xml.in.h:138 msgid "Combinations" msgstr "Combinaties" #: ../data/functions.xml.in.h:139 msgid "r:comb" msgstr "kam" #: ../data/functions.xml.in.h:140 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:141 msgid "Derangements" msgstr "Derangementen" #: ../data/functions.xml.in.h:142 msgid "r:derangements" msgstr "derangementen" #: ../data/functions.xml.in.h:143 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:144 msgid "Number of elements" msgstr "Aantal elementen" #: ../data/functions.xml.in.h:145 msgid "Number Theory" msgstr "Getallentheorie" #: ../data/functions.xml.in.h:146 msgid "Absolute Value" msgstr "Absolute waarde" #: ../data/functions.xml.in.h:147 msgid "r:abs" msgstr "" #: ../data/functions.xml.in.h:148 msgid "Arithmetics" msgstr "Rekenen" #: ../data/functions.xml.in.h:149 msgid "Signum" msgstr "" #: ../data/functions.xml.in.h:150 msgid "r:sgn" msgstr "" #. A numerical value #: ../data/functions.xml.in.h:152 msgid "Number" msgstr "Nummer" #: ../data/functions.xml.in.h:153 msgid "Numerator" msgstr "Teller" #: ../data/functions.xml.in.h:154 msgid "r:numerator" msgstr "noemer" #: ../data/functions.xml.in.h:155 msgid "Denominator" msgstr "Noemer" #: ../data/functions.xml.in.h:156 msgid "r:denominator" msgstr "noemer" #: ../data/functions.xml.in.h:157 msgid "Remainder" msgstr "Rest" #: ../data/functions.xml.in.h:158 msgid "r:rem" msgstr "" #: ../data/functions.xml.in.h:159 msgid "Modulus" msgstr "Modulus" #: ../data/functions.xml.in.h:160 msgid "r:mod" msgstr "." #: ../data/functions.xml.in.h:161 msgid "Negate" msgstr "Ander teken" #: ../data/functions.xml.in.h:162 msgid "r:neg" msgstr "anderteken" #: ../data/functions.xml.in.h:163 msgid "Reciprocal" msgstr "Omgekeerde waarde (x naar 1/x)" #: ../data/functions.xml.in.h:164 msgid "r:inv" msgstr "" #: ../data/functions.xml.in.h:165 msgid "Multiply" msgstr "Vermenigvuldigen" #: ../data/functions.xml.in.h:166 msgid "r:multiply" msgstr "vermenigvuldigen" #: ../data/functions.xml.in.h:167 msgid "Factors" msgstr "Factoren" #: ../data/functions.xml.in.h:168 msgid "Add" msgstr "Optellen" #: ../data/functions.xml.in.h:169 msgid "r:add" msgstr "optellen" #: ../data/functions.xml.in.h:170 msgid "Terms" msgstr "Termen" #: ../data/functions.xml.in.h:171 msgid "Subtract" msgstr "Aftrekken" #: ../data/functions.xml.in.h:172 msgid "r:subtract" msgstr "aftrekken" #: ../data/functions.xml.in.h:173 msgid "Divide" msgstr "Delen" #: ../data/functions.xml.in.h:174 msgid "r:divide" msgstr "delen" #: ../data/functions.xml.in.h:175 msgid "Raise" msgstr "Machtverheffen" #: ../data/functions.xml.in.h:176 msgid "r:raise" msgstr "machtverheffen" #: ../data/functions.xml.in.h:177 msgid "Base" msgstr "Grondtal" #: ../data/functions.xml.in.h:178 msgid "Polynomials" msgstr "Polynomen (veeltermen)" #: ../data/functions.xml.in.h:179 msgid "Coefficient" msgstr "Coëfficiënt" #: ../data/functions.xml.in.h:180 msgid "r:coeff" msgstr "" #: ../data/functions.xml.in.h:181 msgid "Polynomial" msgstr "Polynoom (veelterm)" #: ../data/functions.xml.in.h:182 msgid "Leading Coefficient" msgstr "Eerste coëfficiënt" #: ../data/functions.xml.in.h:183 msgid "r:lcoeff" msgstr "" #: ../data/functions.xml.in.h:184 msgid "Trailing Coefficient" msgstr "Laatste coëfficiënt" #: ../data/functions.xml.in.h:185 msgid "r:tcoeff" msgstr "" #: ../data/functions.xml.in.h:186 msgid "Polynomial Degree" msgstr "Graad van polynoom (veelterm)" #: ../data/functions.xml.in.h:187 msgid "r:degree" msgstr "graad" #: ../data/functions.xml.in.h:188 msgid "Lowest Degree (Valuation)" msgstr "Laagste graad (waardebepaling)" #: ../data/functions.xml.in.h:189 msgid "r:ldegree" msgstr "lgraad" #: ../data/functions.xml.in.h:190 msgid "Content Part" msgstr "Inhoudgedeelte" #: ../data/functions.xml.in.h:191 msgid "r:pcontent" msgstr "pinhoud" #: ../data/functions.xml.in.h:192 msgid "Primitive Part" msgstr "Primitieve deel" #: ../data/functions.xml.in.h:193 msgid "r:primpart" msgstr "" #: ../data/functions.xml.in.h:194 msgid "Unit Part" msgstr "Eenheidsgedeelte" #: ../data/functions.xml.in.h:195 msgid "r:punit" msgstr "peenheid" #: ../data/functions.xml.in.h:196 msgid "Greatest Common Divisor" msgstr "Grootste gemene deler" #: ../data/functions.xml.in.h:197 msgid "r:gcd" msgstr "ggd" #: ../data/functions.xml.in.h:198 msgid "1st value" msgstr "1e waarde" #: ../data/functions.xml.in.h:199 msgid "2nd value" msgstr "2de waarde" #: ../data/functions.xml.in.h:200 msgid "Least Common Multiple" msgstr "Kleinste gemene veelvoud" #: ../data/functions.xml.in.h:201 msgid "r:lcm" msgstr "kgv" #: ../data/functions.xml.in.h:202 msgid "Rounding" msgstr "Afronding" #: ../data/functions.xml.in.h:203 msgid "Round" msgstr "Afronden" #: ../data/functions.xml.in.h:204 msgid "r:round" msgstr "afronden" #: ../data/functions.xml.in.h:205 msgid "Round Downwards" msgstr "Naar beneden afronden" #: ../data/functions.xml.in.h:206 msgid "r:floor" msgstr "" #: ../data/functions.xml.in.h:207 msgid "Round Upwards" msgstr "Naar boven afronden" #: ../data/functions.xml.in.h:208 msgid "r:ceil" msgstr "" #: ../data/functions.xml.in.h:209 msgid "Round Towards Zero" msgstr "Afronden in de richting van nul" #: ../data/functions.xml.in.h:210 msgid "r:trunc" msgstr "afkap" #: ../data/functions.xml.in.h:211 msgid "Extract Integer Part" msgstr "Gehele deel uit (getal) halen" #: ../data/functions.xml.in.h:212 msgid "r:int" msgstr "" #: ../data/functions.xml.in.h:213 msgid "Extract Fractional Part" msgstr "Fractionele deel uit (getal) halen" #: ../data/functions.xml.in.h:214 msgid "r:frac" msgstr "" #: ../data/functions.xml.in.h:215 msgid "Number Bases" msgstr "Grondtallen voor talstelsels" #: ../data/functions.xml.in.h:216 msgid "Number Base" msgstr "Grondtal talstelsel" #: ../data/functions.xml.in.h:217 msgid "r:base" msgstr "grondtal" #: ../data/functions.xml.in.h:218 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:219 msgid "Binary" msgstr "Binair" #: ../data/functions.xml.in.h:220 msgid "r:bin" msgstr "" #: ../data/functions.xml.in.h:221 msgid "Returns an integer from a binary number" msgstr "Converteert een binair getal naar een geheel getal" #: ../data/functions.xml.in.h:222 msgid "Binary number" msgstr "Binair getal" #: ../data/functions.xml.in.h:223 msgid "Octal" msgstr "Octaal" #: ../data/functions.xml.in.h:224 msgid "r:oct" msgstr "" #: ../data/functions.xml.in.h:225 msgid "Returns an integer from an octal number" msgstr "Converteert een octaal getal naar een geheel getal" #: ../data/functions.xml.in.h:226 msgid "Octal number" msgstr "Octaal getal" #: ../data/functions.xml.in.h:227 msgid "Hexadecimal" msgstr "Hexadecimaal" #: ../data/functions.xml.in.h:228 msgid "r:hex" msgstr "" #: ../data/functions.xml.in.h:229 msgid "Returns a value from a hexadecimal number" msgstr "Converteert een hexadecimaal getal naar een getal" #: ../data/functions.xml.in.h:230 msgid "Hexadecimal number" msgstr "Hexadecimaal getal" #: ../data/functions.xml.in.h:231 msgid "Integers" msgstr "Gehele getallen" #: ../data/functions.xml.in.h:232 msgid "Even" msgstr "" #: ../data/functions.xml.in.h:233 msgid "r:even" msgstr "" #: ../data/functions.xml.in.h:234 msgid "Odd" msgstr "Oneven" #: ../data/functions.xml.in.h:235 msgid "r:odd" msgstr "oneven" #: ../data/functions.xml.in.h:236 msgid "Step Functions" msgstr "Stapfuncties" #: ../data/functions.xml.in.h:237 msgid "Heaviside Step Function" msgstr "Heaviside stapfunctie" #: ../data/functions.xml.in.h:238 msgid "r:heaviside" msgstr "" #: ../data/functions.xml.in.h:239 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:240 msgid "Ramp Function" msgstr "Rampfunctie" #: ../data/functions.xml.in.h:241 msgid "r:ramp" msgstr "" #: ../data/functions.xml.in.h:242 msgid "Rectangular Function" msgstr "Rechthoekige functie" #: ../data/functions.xml.in.h:243 msgid "r:rectangular" msgstr "rechthoekig" #: ../data/functions.xml.in.h:244 msgid "Sigmoid Function" msgstr "Sigmoïde functie" #: ../data/functions.xml.in.h:245 msgid "r:sigmoid" msgstr "sigmoïde" #: ../data/functions.xml.in.h:246 msgid "Logit Transformation" msgstr "Logit transformatie" #: ../data/functions.xml.in.h:247 msgid "r:logit" msgstr "" #: ../data/functions.xml.in.h:248 msgid "Triangular Function" msgstr "Driehoekige functie" #: ../data/functions.xml.in.h:249 msgid "r:triangular" msgstr "driehoekig" #: ../data/functions.xml.in.h:250 msgid "Analysis" msgstr "Analyse" #: ../data/functions.xml.in.h:251 msgid "Real Part" msgstr "Reële deel" #: ../data/functions.xml.in.h:252 msgid "r:re" msgstr "" #: ../data/functions.xml.in.h:253 msgid "Complex number" msgstr "Complex getal" #: ../data/functions.xml.in.h:254 msgid "Imaginary Part" msgstr "Imaginaire deel" #: ../data/functions.xml.in.h:255 msgid "r:im" msgstr "" #: ../data/functions.xml.in.h:256 msgid "Gamma Function" msgstr "Gamma-functie" #: ../data/functions.xml.in.h:257 msgid "r:gamma" msgstr "" #: ../data/functions.xml.in.h:258 msgid "Beta Function" msgstr "Beta-functie" #: ../data/functions.xml.in.h:259 msgid "r:beta" msgstr "" #: ../data/functions.xml.in.h:260 msgid "Exponents & Logarithms" msgstr "Exponenten & Logaritmen" #: ../data/functions.xml.in.h:261 msgid "Square Root" msgstr "Vierkantswortel" #: ../data/functions.xml.in.h:262 msgid "au:√,r:sqrt" msgstr "" #: ../data/functions.xml.in.h:263 msgid "Square" msgstr "Vierkant" #: ../data/functions.xml.in.h:264 msgid "r:sq" msgstr "" #: ../data/functions.xml.in.h:265 msgid "Exponential (e^x)" msgstr "Exponent (e^x)" #: ../data/functions.xml.in.h:266 msgid "r:exp" msgstr "" #: ../data/functions.xml.in.h:267 msgid "Natural Logarithm" msgstr "Natuurlijke logaritme" #: ../data/functions.xml.in.h:268 msgid "r:ln" msgstr "" #: ../data/functions.xml.in.h:269 msgid "Base-N Logarithm" msgstr "Logaritme met grondtal N" #: ../data/functions.xml.in.h:270 msgid "r:log" msgstr "" #: ../data/functions.xml.in.h:271 msgid "Lambert W Function (Omega Function, Product Log)" msgstr "Lambert W Functie (Omega Functie, Product Log)" #: ../data/functions.xml.in.h:272 msgid "r:lambertw,productlog" msgstr "" #: ../data/functions.xml.in.h:273 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:274 msgid "Base-2 Logarithm" msgstr "Logaritme met grondtal 2" #: ../data/functions.xml.in.h:275 msgid "rs:log2" msgstr "" #: ../data/functions.xml.in.h:276 msgid "Returns the base n logarithm." msgstr "Retourneert de logaritme met grondtal n." #: ../data/functions.xml.in.h:277 msgid "Base-10 Logarithm" msgstr "Logaritme met grondtal 10" #: ../data/functions.xml.in.h:278 msgid "rs:log10" msgstr "" #: ../data/functions.xml.in.h:279 msgid "Complex Exponential (Cis)" msgstr "Complex Exponentieel (Cis)" #: ../data/functions.xml.in.h:280 msgid "r:cis" msgstr "" #: ../data/functions.xml.in.h:281 msgid "2 raised the to power X" msgstr "2 tot de macht X" #: ../data/functions.xml.in.h:282 msgid "rs:exp2" msgstr "" #: ../data/functions.xml.in.h:283 msgid "10 raised the to power X" msgstr "10 tot de macht X" #: ../data/functions.xml.in.h:284 msgid "rs:exp10" msgstr "" #: ../data/functions.xml.in.h:285 msgid "Cube Root" msgstr "Derdemachtswortel" #: ../data/functions.xml.in.h:286 #, fuzzy msgid "au:∛,r:cbrt" msgstr "a:∞,oneindig" #: ../data/functions.xml.in.h:287 msgid "Nth root" msgstr "N-de wortel" #: ../data/functions.xml.in.h:288 msgid "r:root" msgstr "wortel" #: ../data/functions.xml.in.h:289 msgid "X raised to the power Y" msgstr "X tot de macht Y" #: ../data/functions.xml.in.h:290 msgid "r:pow" msgstr "macht" #: ../data/functions.xml.in.h:291 msgid "Square root (x * pi)" msgstr "Vierkantswortel (x * pi)" #: ../data/functions.xml.in.h:292 msgid "r:sqrtpi" msgstr "" #: ../data/functions.xml.in.h:293 msgid "Returns the non-negative square root of x * pi" msgstr "Retourneert de niet-negatieve vierkantswortel van x * pi" #: ../data/functions.xml.in.h:294 msgid "Non-negative value" msgstr "Niet-negatieve waarde" #: ../data/functions.xml.in.h:295 msgid "Trigonometry" msgstr "Goniometrie" #: ../data/functions.xml.in.h:296 msgid "Sine" msgstr "Sinus" #: ../data/functions.xml.in.h:297 msgid "r:sin" msgstr "" #: ../data/functions.xml.in.h:298 msgid "Angle" msgstr "Hoek" #: ../data/functions.xml.in.h:299 msgid "Cosine" msgstr "Cosinus" #: ../data/functions.xml.in.h:300 msgid "r:cos" msgstr "" #: ../data/functions.xml.in.h:301 msgid "Tangent" msgstr "Tangens" #: ../data/functions.xml.in.h:302 msgid "r:tan" msgstr "" #: ../data/functions.xml.in.h:303 msgid "Inverse Sine" msgstr "Inverse sinus" #: ../data/functions.xml.in.h:304 msgid "r:asin" msgstr "" #: ../data/functions.xml.in.h:305 msgid "Inverse Cosine" msgstr "Inverse cosinus" #: ../data/functions.xml.in.h:306 msgid "r:acos" msgstr "" #: ../data/functions.xml.in.h:307 msgid "Inverse Tangent" msgstr "Inverse tangens" #: ../data/functions.xml.in.h:308 msgid "r:atan" msgstr "" #: ../data/functions.xml.in.h:309 msgid "Hyperbolic Sine" msgstr "Hyperbolische sinus" #: ../data/functions.xml.in.h:310 msgid "r:sinh" msgstr "" #: ../data/functions.xml.in.h:311 msgid "Hyperbolic Cosine" msgstr "Hyperbolische cosinus" #: ../data/functions.xml.in.h:312 msgid "r:cosh" msgstr "" #: ../data/functions.xml.in.h:313 msgid "Hyperbolic Tangent" msgstr "Hyperbolische tangens" #: ../data/functions.xml.in.h:314 msgid "r:tanh" msgstr "" #: ../data/functions.xml.in.h:315 msgid "Inverse Hyperbolic Sine" msgstr "Inverse hyperbolische sinus" #: ../data/functions.xml.in.h:316 msgid "r:asinh" msgstr "" #: ../data/functions.xml.in.h:317 msgid "Inverse Hyperbolic Cosine" msgstr "Inverse hyperbolische cosinus" #: ../data/functions.xml.in.h:318 msgid "r:acosh" msgstr "" #: ../data/functions.xml.in.h:319 msgid "Inverse Hyperbolic Tangent" msgstr "Inverse hyperbolische tangens" #: ../data/functions.xml.in.h:320 msgid "r:atanh" msgstr "" #: ../data/functions.xml.in.h:321 msgid "Radians to Default Angle Unit" msgstr "Radialen naar standaard hoekeenheid" #: ../data/functions.xml.in.h:322 msgid "r:radtodef" msgstr "radnaardef" #: ../data/functions.xml.in.h:323 msgid "Radians" msgstr "Radialen" #: ../data/functions.xml.in.h:324 msgid "Secant" msgstr "Secans" #: ../data/functions.xml.in.h:325 msgid "r:sec" msgstr "" #: ../data/functions.xml.in.h:326 msgid "Cosecant" msgstr "Cosecant" #: ../data/functions.xml.in.h:327 msgid "r:csc" msgstr "" #: ../data/functions.xml.in.h:328 msgid "Cotangent" msgstr "Cotangens" #: ../data/functions.xml.in.h:329 msgid "r:cot" msgstr "" #: ../data/functions.xml.in.h:330 msgid "Hyperbolic Secant" msgstr "Hyperbolische secans" #: ../data/functions.xml.in.h:331 msgid "r:sech" msgstr "" #: ../data/functions.xml.in.h:332 msgid "Hyperbolic Cosecant" msgstr "Hyperbolische cosecans" #: ../data/functions.xml.in.h:333 msgid "r:csch" msgstr "" #: ../data/functions.xml.in.h:334 msgid "Hyperbolic Cotangent" msgstr "Hyperbolische cotangens" #: ../data/functions.xml.in.h:335 msgid "r:coth" msgstr "" #: ../data/functions.xml.in.h:336 msgid "Inverse Secant" msgstr "Inverse secans" #: ../data/functions.xml.in.h:337 msgid "r:asec" msgstr "" #: ../data/functions.xml.in.h:338 msgid "Inverse Cosecant" msgstr "Inverse cosecans" #: ../data/functions.xml.in.h:339 msgid "r:acsc" msgstr "" #: ../data/functions.xml.in.h:340 msgid "Inverse Cotangent" msgstr "Inverse cotangens" #: ../data/functions.xml.in.h:341 msgid "r:acot" msgstr "" #: ../data/functions.xml.in.h:342 msgid "Inverse Hyperbolic Secant" msgstr "Inverse hyperbolische secans" #: ../data/functions.xml.in.h:343 msgid "r:asech" msgstr "" #: ../data/functions.xml.in.h:344 msgid "Inverse Hyperbolic Cosecant" msgstr "Inverse hyperbolische cosecans" #: ../data/functions.xml.in.h:345 msgid "r:acsch" msgstr "" #: ../data/functions.xml.in.h:346 msgid "Inverse Hyperbolic Cotangent" msgstr "Inverse hyperbolische cotangens" #: ../data/functions.xml.in.h:347 msgid "r:acoth" msgstr "" #: ../data/functions.xml.in.h:348 msgid "Miscellaneous" msgstr "Diversen" #: ../data/functions.xml.in.h:349 msgid "Body Mass Index (BMI)" msgstr "Body Mass Index (BMI) (Index voor lichaamsmassa)" #: ../data/functions.xml.in.h:350 msgid "-r:bmi" msgstr "" #: ../data/functions.xml.in.h:351 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:353 msgid "Length" msgstr "Lengte" #: ../data/functions.xml.in.h:354 msgid "Riemann Zeta" msgstr "Riemann Zeta" #: ../data/functions.xml.in.h:355 msgid "r:zeta" msgstr "" #: ../data/functions.xml.in.h:356 msgid "Integral point" msgstr "Gehele waarde" #: ../data/functions.xml.in.h:357 msgid "Roman Number" msgstr "Romeins getal" #: ../data/functions.xml.in.h:358 msgid "r:roman" msgstr "romeins" #: ../data/functions.xml.in.h:359 msgid "Returns the value of a roman number." msgstr "Retourneert de waarde van een Romeins getal." #: ../data/functions.xml.in.h:360 msgid "Roman number" msgstr "Romeins getal" #: ../data/functions.xml.in.h:361 msgid "Kronecker Delta" msgstr "Kronecker Delta" #: ../data/functions.xml.in.h:362 msgid "r:kronecker" msgstr "" #: ../data/functions.xml.in.h:363 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:364 msgid "Value 1 (i)" msgstr "Waarde 1 (i)" #: ../data/functions.xml.in.h:365 msgid "Value 2 (j)" msgstr "Waarde 2 (j)" #: ../data/functions.xml.in.h:366 #, fuzzy msgid "Fibonacci Number" msgstr "Romeins getal" #: ../data/functions.xml.in.h:367 msgid "r:fibonacci" msgstr "" #: ../data/functions.xml.in.h:368 #, fuzzy msgid "Returns the n-th term of the Fibonacci sequence." msgstr "Retourneert het aantal elementen in een vector." #: ../data/functions.xml.in.h:369 #, fuzzy msgid "Index (n)" msgstr "Index" #: ../data/functions.xml.in.h:370 msgid "Statistics" msgstr "Statistiek" #: ../data/functions.xml.in.h:371 msgid "Descriptive Statistics" msgstr "Beschrijvende statistiek" #: ../data/functions.xml.in.h:372 msgid "Sum (total)" msgstr "Som (totaal)" #: ../data/functions.xml.in.h:373 msgid "r:total" msgstr "totaal" #: ../data/functions.xml.in.h:374 msgid "Data" msgstr "Gegevens" #: ../data/functions.xml.in.h:375 msgid "Percentile" msgstr "Percentiel" #: ../data/functions.xml.in.h:376 msgid "r:percentile" msgstr "percentiel" #: ../data/functions.xml.in.h:378 #, no-c-format msgid "Percentile (%)" msgstr "Percentiel (%)" #: ../data/functions.xml.in.h:379 msgid "r:min" msgstr "" #: ../data/functions.xml.in.h:380 msgid "Returns the lowest value." msgstr "Retourneert de kleinste waarde." #: ../data/functions.xml.in.h:381 msgid "r:max" msgstr "" #: ../data/functions.xml.in.h:382 msgid "Returns the highest value." msgstr "Retourneert de grootste waarde." #: ../data/functions.xml.in.h:383 msgid "Mode" msgstr "Modus" #: ../data/functions.xml.in.h:384 msgid "r:mode" msgstr "modus" #: ../data/functions.xml.in.h:385 msgid "Returns the most frequently occurring value." msgstr "Retourneert de meest voorkomende waarde." #: ../data/functions.xml.in.h:386 msgid "Range" msgstr "Bereik" #: ../data/functions.xml.in.h:387 msgid "r:range" msgstr "bereik" #: ../data/functions.xml.in.h:388 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:389 msgid "Median" msgstr "Mediaan" #: ../data/functions.xml.in.h:390 msgid "r:median" msgstr "mediaan" #: ../data/functions.xml.in.h:391 msgid "Quartile" msgstr "Kwartiel" #: ../data/functions.xml.in.h:392 msgid "r:quartile" msgstr "kwartiel" #: ../data/functions.xml.in.h:393 msgid "Decile" msgstr "Deciel" #: ../data/functions.xml.in.h:394 msgid "r:decile" msgstr "deciel" #: ../data/functions.xml.in.h:395 msgid "Interquartile Range" msgstr "Interkwartiel bereik" #: ../data/functions.xml.in.h:396 msgid "r:iqr" msgstr "" #: ../data/functions.xml.in.h:397 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:398 msgid "Number of Samples" msgstr "Aantal monsters" #. Number of samples #: ../data/functions.xml.in.h:400 msgid "r:number" msgstr "getal" #: ../data/functions.xml.in.h:401 msgid "Returns the number of samples." msgstr "Retourneert het aantal monsters." #: ../data/functions.xml.in.h:402 msgid "Random Number" msgstr "Willekeurig getal" #: ../data/functions.xml.in.h:403 msgid "r:rand" msgstr "wilk" #: ../data/functions.xml.in.h:404 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:405 msgid "Ceil" msgstr "Ceil" #: ../data/functions.xml.in.h:406 msgid "Random Number Between Limits" msgstr "Willekeurig getal tussen twee grenswaarden" #: ../data/functions.xml.in.h:407 msgid "r:randbetween" msgstr "wilktussen" #: ../data/functions.xml.in.h:408 msgid "Returns an integer between (including) bottom and top." msgstr "Retourneert een geheel getal tussen onder- en bovengrens (inclusief)." #: ../data/functions.xml.in.h:409 msgid "Bottom" msgstr "Onder" #: ../data/functions.xml.in.h:410 msgid "Top" msgstr "Boven" #: ../data/functions.xml.in.h:411 msgid "Means" msgstr "Gemiddelden" #: ../data/functions.xml.in.h:412 msgid "Mean" msgstr "Gemiddelde" #: ../data/functions.xml.in.h:413 msgid "r:mean,average" msgstr "gemiddelde" #: ../data/functions.xml.in.h:414 msgid "Harmonic Mean" msgstr "Harmonisch gemiddelde" #: ../data/functions.xml.in.h:415 msgid "r:harmmean" msgstr "harmgem" #: ../data/functions.xml.in.h:416 msgid "Geometric Mean" msgstr "Meetkundig gemiddelde" #: ../data/functions.xml.in.h:417 msgid "r:geomean" msgstr "meetkgem" #: ../data/functions.xml.in.h:418 msgid "Trimmed Mean" msgstr "Getrimd gemiddelde" #: ../data/functions.xml.in.h:419 msgid "r:trimmean" msgstr "trimgemidd" #: ../data/functions.xml.in.h:420 msgid "Trimmed percentage (at each end)" msgstr "Getrimd percentage (aan beide kanten)" #: ../data/functions.xml.in.h:421 msgid "Winsorized Mean" msgstr "Gewinsoriseerd gemiddelde" #: ../data/functions.xml.in.h:422 msgid "r:winsormean" msgstr "winsorgemidd" #: ../data/functions.xml.in.h:423 msgid "Winsorized percentage (at each end)" msgstr "Gewinsoriseerd percentage (aan beide kanten)" #: ../data/functions.xml.in.h:424 msgid "Weighted Mean" msgstr "Gewogen gemiddelde" #: ../data/functions.xml.in.h:425 msgid "r:weighmean" msgstr "gewogengemidd" #: ../data/functions.xml.in.h:426 msgid "Weights" msgstr "Gewichten" #: ../data/functions.xml.in.h:427 msgid "Quadratic Mean (RMS)" msgstr "Kwadratisch gemiddelde (RMS)" #: ../data/functions.xml.in.h:428 msgid "r:rms" msgstr "" #: ../data/functions.xml.in.h:429 msgid "Moments" msgstr "Momenten" #: ../data/functions.xml.in.h:430 msgid "Standard Deviation (entire population)" msgstr "Standaarddeviatie (gehele populatie)" #: ../data/functions.xml.in.h:431 msgid "r:stdevp" msgstr "" #: ../data/functions.xml.in.h:432 msgid "Standard Deviation (random sampling)" msgstr "Standaarddeviatie (willekeurige steekproef)" #: ../data/functions.xml.in.h:433 msgid "r:stdev" msgstr "" #: ../data/functions.xml.in.h:434 msgid "Variance (entire population)" msgstr "Variantie (gehele populatie)" #: ../data/functions.xml.in.h:435 msgid "r:varp" msgstr "" #: ../data/functions.xml.in.h:436 msgid "Variance (random sampling)" msgstr "Variantie (willekeurige steekproef)" #: ../data/functions.xml.in.h:437 msgid "r:var" msgstr "" #: ../data/functions.xml.in.h:438 msgid "Standard Error" msgstr "Standaardfout" #: ../data/functions.xml.in.h:439 msgid "r:stderr" msgstr "" #: ../data/functions.xml.in.h:440 msgid "Mean Deviation" msgstr "Gemiddelde afwijking" #: ../data/functions.xml.in.h:441 msgid "r:meandev" msgstr "gemiddev" #: ../data/functions.xml.in.h:442 msgid "Covariance" msgstr "Covariantie" #: ../data/functions.xml.in.h:443 msgid "r:cov,r:covar" msgstr "" #: ../data/functions.xml.in.h:444 msgid "Data 1" msgstr "Gegevens 1" #: ../data/functions.xml.in.h:445 msgid "Data 2" msgstr "Gegevens 2" #: ../data/functions.xml.in.h:446 msgid "Pooled Variance" msgstr "Pooled variantie" #: ../data/functions.xml.in.h:447 msgid "r:poolvar" msgstr "" #: ../data/functions.xml.in.h:448 msgid "Regression" msgstr "Regressie" #: ../data/functions.xml.in.h:449 msgid "Statistical Correlation" msgstr "Statistische correlatie" #: ../data/functions.xml.in.h:450 msgid "r:cor" msgstr "" #: ../data/functions.xml.in.h:451 msgid "Pearson's Correlation Coefficient" msgstr "Pearson's correlatiecoëfficiënt" #: ../data/functions.xml.in.h:452 msgid "r:pearson,r:correl" msgstr "" #: ../data/functions.xml.in.h:453 msgid "Spearman's Rho" msgstr "Spearman's Rho" #: ../data/functions.xml.in.h:454 msgid "r:spearman" msgstr "" #: ../data/functions.xml.in.h:455 msgid "Durbin-Watson" msgstr "Durbin-Watson" #: ../data/functions.xml.in.h:456 msgid "r:durbinwatson" msgstr "" #: ../data/functions.xml.in.h:457 msgid "Statistical Tests" msgstr "Statistische testen" #: ../data/functions.xml.in.h:458 msgid "Unpaired T-Test" msgstr "Ongepaarde T-proef" #: ../data/functions.xml.in.h:459 msgid "r:ttest" msgstr "" #: ../data/functions.xml.in.h:460 msgid "Paired T-Test" msgstr "Gepaarde t-proef" #: ../data/functions.xml.in.h:461 msgid "r:pttest" msgstr "" #: ../data/functions.xml.in.h:462 msgid "Distribution" msgstr "Distributie" #: ../data/functions.xml.in.h:463 msgid "Rayleigh Distribution" msgstr "Rayleigh-verdeling" #: ../data/functions.xml.in.h:464 msgid "r:rayleigh" msgstr "" #: ../data/functions.xml.in.h:465 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:466 msgid "X" msgstr "X" #: ../data/functions.xml.in.h:467 msgid "Sigma" msgstr "Sigma" #: ../data/functions.xml.in.h:468 msgid "Rayleigh Tail Distribution" msgstr "Rayleigh-staartverdeling" #: ../data/functions.xml.in.h:469 msgid "r:rayleightail" msgstr "rayleighstaart" #: ../data/functions.xml.in.h:470 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:471 msgid "Pareto Distribution" msgstr "Paretoverdeling" #: ../data/functions.xml.in.h:472 msgid "r:pareto" msgstr "" #: ../data/functions.xml.in.h:473 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:474 msgid "Scale" msgstr "Schaal" #: ../data/functions.xml.in.h:475 msgid "Logistic Distribution" msgstr "Logistische verdeling" #: ../data/functions.xml.in.h:476 msgid "r:logistic" msgstr "logistisch" #: ../data/functions.xml.in.h:477 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:478 msgid "Date & Time" msgstr "Datum & Tijd" #: ../data/functions.xml.in.h:479 msgid "Days between two dates" msgstr "Aantal dagen tussen twee data" #: ../data/functions.xml.in.h:480 msgid "r:days" msgstr "dagen" #: ../data/functions.xml.in.h:481 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:482 msgid "First date" msgstr "Eerste datum" #: ../data/functions.xml.in.h:483 msgid "Second date" msgstr "Tweede datum" #: ../data/functions.xml.in.h:484 msgid "Day counting basis" msgstr "Basis dagtelling" #: ../data/functions.xml.in.h:485 msgid "Financial function mode" msgstr "Financiële functiemodus" #: ../data/functions.xml.in.h:486 msgid "Years between two dates" msgstr "Jaren tussen twee data" #: ../data/functions.xml.in.h:487 msgid "r:yearfrac" msgstr "jaarfrac" #: ../data/functions.xml.in.h:488 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:489 msgid "Week of Year" msgstr "Week van het jaar" #: ../data/functions.xml.in.h:490 msgid "r:week" msgstr "" #: ../data/functions.xml.in.h:491 msgid "Date" msgstr "Datum" #: ../data/functions.xml.in.h:492 msgid "Week begins on Sunday" msgstr "Week begint op zondag" #: ../data/functions.xml.in.h:493 msgid "Day of Week" msgstr "Dag van de week" #: ../data/functions.xml.in.h:494 msgid "r:weekday" msgstr "weekdag" #: ../data/functions.xml.in.h:495 msgid "Month" msgstr "Maand" #: ../data/functions.xml.in.h:496 msgid "r:month" msgstr "maand" #: ../data/functions.xml.in.h:497 msgid "Day of Month" msgstr "Dag van de maand" #: ../data/functions.xml.in.h:498 msgid "r:day" msgstr "dag" #: ../data/functions.xml.in.h:499 msgid "Year" msgstr "Jaar" #: ../data/functions.xml.in.h:500 msgid "r:year" msgstr "jaar" #: ../data/functions.xml.in.h:501 msgid "Day of Year" msgstr "Dag van het jaar" #: ../data/functions.xml.in.h:502 msgid "r:yearday" msgstr "jaardag" #: ../data/functions.xml.in.h:503 msgid "Current Time" msgstr "Huidige tijd" #: ../data/functions.xml.in.h:504 msgid "r:time" msgstr "tijd" #: ../data/functions.xml.in.h:505 msgid "Standard Date Format" msgstr "Standaardnotatie voor datum" #: ../data/functions.xml.in.h:506 msgid "r:isodate" msgstr "" #: ../data/functions.xml.in.h:507 msgid "Local Date Format" msgstr "Lokale datumnotatie" #: ../data/functions.xml.in.h:508 msgid "r:localdate" msgstr "lokaledatum" #: ../data/functions.xml.in.h:509 msgid "Date to Unix Timestamp" msgstr "Datum naar Unix-timestamp" #: ../data/functions.xml.in.h:510 msgid "r:timestamp" msgstr "" #: ../data/functions.xml.in.h:511 msgid "Unix Timestamp to Date" msgstr "Unix Timestamp naar datum" #: ../data/functions.xml.in.h:512 msgid "r:stamptodate" msgstr "stampnaardatum" #: ../data/functions.xml.in.h:513 msgid "Timestamp" msgstr "Timestamp" #: ../data/functions.xml.in.h:514 msgid "Add Days" msgstr "Dagen bijtellen" #: ../data/functions.xml.in.h:515 msgid "r:addDays" msgstr "dagen bijtellen" #: ../data/functions.xml.in.h:516 msgid "Days" msgstr "Dagen" #: ../data/functions.xml.in.h:517 msgid "Add Months" msgstr "Maanden bijtellen" #: ../data/functions.xml.in.h:518 msgid "r:addMonths" msgstr "maanden bijtellen" #: ../data/functions.xml.in.h:519 msgid "Months" msgstr "Maanden" #: ../data/functions.xml.in.h:520 msgid "Add Years" msgstr "Jaren bijtellen" #: ../data/functions.xml.in.h:521 msgid "r:addYears" msgstr "jaren bijtellen" #: ../data/functions.xml.in.h:522 msgid "Years" msgstr "Jaren" #: ../data/functions.xml.in.h:523 msgid "Add Time" msgstr "Tijd optellen" #: ../data/functions.xml.in.h:524 msgid "r:addTime" msgstr "tijd bijtellen" #: ../data/functions.xml.in.h:525 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:526 ../data/units.xml.in.h:132 msgid "Time" msgstr "Tijd" #: ../data/functions.xml.in.h:527 msgid "Utilities" msgstr "Hulpmiddelen" #: ../data/functions.xml.in.h:528 msgid "ASCII Value" msgstr "ASCII-waarde" #: ../data/functions.xml.in.h:529 msgid "r:code" msgstr "" #: ../data/functions.xml.in.h:530 msgid "Character" msgstr "Karakter" #: ../data/functions.xml.in.h:531 msgid "ASCII Char" msgstr "ASCII-kar" #: ../data/functions.xml.in.h:532 msgid "r:char" msgstr "" #: ../data/functions.xml.in.h:533 msgid "Length of string" msgstr "Lengte van karakterrij" #: ../data/functions.xml.in.h:534 msgid "r:len" msgstr "" #: ../data/functions.xml.in.h:535 msgid "Text" msgstr "Tekst" #: ../data/functions.xml.in.h:536 msgid "Concatenate Strings" msgstr "Karakterrijen samenvoegen" #: ../data/functions.xml.in.h:537 msgid "r:concatenate" msgstr "samenvoegen" #: ../data/functions.xml.in.h:538 msgid "Text string 1" msgstr "Tekstrij 1" #: ../data/functions.xml.in.h:539 msgid "Text string 2" msgstr "Tekstrij 2" #: ../data/functions.xml.in.h:540 msgid "Replace" msgstr "Vervangen" #: ../data/functions.xml.in.h:541 msgid "r:replace" msgstr "vervangen" #: ../data/functions.xml.in.h:542 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:543 msgid "Expression" msgstr "Expressie" #: ../data/functions.xml.in.h:544 msgid "Original value" msgstr "Originele waarde" #: ../data/functions.xml.in.h:545 msgid "New value" msgstr "Nieuwe waarde" #: ../data/functions.xml.in.h:546 msgid "Precalculate expression" msgstr "Voorbereken expressie" #: ../data/functions.xml.in.h:547 msgid "Strip Units" msgstr "Eenheden verwijderen" #: ../data/functions.xml.in.h:548 msgid "r:nounit,strip_units" msgstr "geeneenheid,eenheden_weg" #: ../data/functions.xml.in.h:549 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:550 msgid "Process Vector Elements" msgstr "Vector-elementen verwerken" #: ../data/functions.xml.in.h:551 msgid "r:process" msgstr "verwerken" #: ../data/functions.xml.in.h:552 msgid "Element variable" msgstr "Elementvariabele" #: ../data/functions.xml.in.h:553 msgid "Index variable" msgstr "Indexvariabele" #: ../data/functions.xml.in.h:554 msgid "Vector variable" msgstr "Vectorvariabele" #: ../data/functions.xml.in.h:555 msgid "Process Matrix Elements" msgstr "Matrix-elementen verwerken" #: ../data/functions.xml.in.h:556 msgid "r:processm" msgstr "" #: ../data/functions.xml.in.h:557 msgid "Row variable" msgstr "Rijvariabele" #: ../data/functions.xml.in.h:558 msgid "Column variable" msgstr "Kolomvariabele" #: ../data/functions.xml.in.h:559 msgid "Matrix variable" msgstr "Matrixvariabele" #: ../data/functions.xml.in.h:560 msgid "Custom Sum of Elements" msgstr "Aangepaste som van elementen" #: ../data/functions.xml.in.h:561 msgid "r:csum" msgstr "csom" #: ../data/functions.xml.in.h:562 msgid "First element" msgstr "Eerste element" #: ../data/functions.xml.in.h:563 msgid "Last element" msgstr "Laatste element" #: ../data/functions.xml.in.h:564 msgid "Initial value" msgstr "Beginwaarde" #: ../data/functions.xml.in.h:565 msgid "Value variable" msgstr "Waarde variabele" #: ../data/functions.xml.in.h:566 msgid "Select Vector Elements" msgstr "Vectorelementen selecteren" #: ../data/functions.xml.in.h:567 msgid "r:select" msgstr "selecteer" #: ../data/functions.xml.in.h:568 msgid "Condition" msgstr "Conditie" #: ../data/functions.xml.in.h:569 msgid "Select first match" msgstr "Eerste overeenkomst secteren" #: ../data/functions.xml.in.h:570 msgid "r:function" msgstr "functie" #: ../data/functions.xml.in.h:571 msgid "Arguments" msgstr "Argumenten" #: ../data/functions.xml.in.h:572 msgid "Title" msgstr "Titel" #: ../data/functions.xml.in.h:573 msgid "r:title" msgstr "titel" #: ../data/functions.xml.in.h:575 msgid "Display Error" msgstr "Weergavefout" #: ../data/functions.xml.in.h:576 msgid "r:error" msgstr "fout" #: ../data/functions.xml.in.h:577 msgid "Message" msgstr "Bericht" #: ../data/functions.xml.in.h:578 msgid "Display Warning" msgstr "Waarschuwing weergeven" #: ../data/functions.xml.in.h:579 msgid "r:warning" msgstr "waarschuwing" #: ../data/functions.xml.in.h:580 msgid "Display Message" msgstr "Bericht weergeven" #: ../data/functions.xml.in.h:581 msgid "r:message" msgstr "bericht" #: ../data/functions.xml.in.h:582 msgid "Save as Variable" msgstr "Opslaan als variabele" #: ../data/functions.xml.in.h:583 msgid "r:save" msgstr "opslaan" #: ../data/functions.xml.in.h:584 msgid "Category" msgstr "Categorie" #: ../data/functions.xml.in.h:585 msgid "RPN Stack Register" msgstr "RPN-register in stapelgeheugen" #: ../data/functions.xml.in.h:586 msgid "r:register" msgstr "" #: ../data/functions.xml.in.h:587 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:588 msgid "RPN Stack Vector" msgstr "RPN-vector in stapelgeheugen" #: ../data/functions.xml.in.h:589 msgid "r:stack" msgstr "stapelgeheugen" #: ../data/functions.xml.in.h:590 msgid "Returns the RPN stack as a vector." msgstr "Retourneert de inhoud van het RPN-stapelgeheugen als een vector." #: ../data/functions.xml.in.h:591 msgid "Is Number" msgstr "Is een getal" #: ../data/functions.xml.in.h:592 msgid "r:isNumber" msgstr "isGetal" #: ../data/functions.xml.in.h:593 msgid "Is Real" msgstr "Is een reëel getal" #: ../data/functions.xml.in.h:594 msgid "r:isReal" msgstr "isReëel" #: ../data/functions.xml.in.h:595 msgid "Is Rational" msgstr "Is een rationaal getal" #: ../data/functions.xml.in.h:596 msgid "r:isRational" msgstr "isRationaal" #: ../data/functions.xml.in.h:597 msgid "Is Integer" msgstr "Is een geheel getal" #: ../data/functions.xml.in.h:598 msgid "r:isInteger" msgstr "isGeheel" #: ../data/functions.xml.in.h:599 msgid "Represents Number" msgstr "Geeft een getal weer" #: ../data/functions.xml.in.h:600 msgid "r:representsNumber" msgstr "isGetal" #: ../data/functions.xml.in.h:601 msgid "Represents Real" msgstr "Geeft een reëel getal weer" #: ../data/functions.xml.in.h:602 msgid "r:representsReal" msgstr "isReëel" #: ../data/functions.xml.in.h:603 msgid "Represents Rational" msgstr "Geeft een rationaal getal weer" #: ../data/functions.xml.in.h:604 msgid "r:representsRational" msgstr "isRationaalgetal" #: ../data/functions.xml.in.h:605 msgid "Represents Integer" msgstr "Geeft een geheel getal weer" #: ../data/functions.xml.in.h:606 msgid "r:representsInteger" msgstr "isGeheelgetal" #: ../data/functions.xml.in.h:607 msgid "Logical" msgstr "Logisch" #: ../data/functions.xml.in.h:608 msgid "For...Do" msgstr "For...Do" #: ../data/functions.xml.in.h:609 msgid "r:for" msgstr "" #: ../data/functions.xml.in.h:610 msgid "Initial value of counter" msgstr "Beginwaarde van teller" #: ../data/functions.xml.in.h:611 msgid "Counter variable" msgstr "Tellervariabele" #: ../data/functions.xml.in.h:612 msgid "For condition" msgstr "For-voorwaarde" #: ../data/functions.xml.in.h:613 msgid "Counter update function" msgstr "Functie voor bijwerken van de teller" #: ../data/functions.xml.in.h:614 msgid "Do function" msgstr "Do-functie" #: ../data/functions.xml.in.h:615 msgid "If...Then...Else" msgstr "If...Then...Else" #: ../data/functions.xml.in.h:616 msgid "r:if" msgstr "" #: ../data/functions.xml.in.h:617 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:618 msgid "Expression if condition is met" msgstr "Expressie indien aan conditie wordt voldaan" #: ../data/functions.xml.in.h:619 msgid "Expression if condition is NOT met" msgstr "Expressie indien NIET aan conditie wordt voldaan" #: ../data/functions.xml.in.h:620 msgid "Logical Exclusive OR" msgstr "Booleaanse XOR" #: ../data/functions.xml.in.h:621 msgid "r:xor" msgstr "" #: ../data/functions.xml.in.h:622 msgid "Value 1" msgstr "Waarde 1" #: ../data/functions.xml.in.h:623 msgid "Value 2" msgstr "Waarde 2" #: ../data/functions.xml.in.h:624 msgid "Bitwise Exclusive OR" msgstr "Bitsgewijs XOR" #: ../data/functions.xml.in.h:625 msgid "r:bitxor" msgstr "" #: ../data/functions.xml.in.h:626 msgid "Bitwise Shift" msgstr "Bitsgewijs verschuiven (shift)" #: ../data/functions.xml.in.h:627 msgid "r:shift" msgstr "" #: ../data/functions.xml.in.h:628 msgid "Bits" msgstr "Bits" #: ../data/functions.xml.in.h:629 msgid "Algebra" msgstr "Algebra" #: ../data/functions.xml.in.h:630 msgid "Sum" msgstr "Som" #: ../data/functions.xml.in.h:631 msgid "au:Σ,r:sum" msgstr "au:Σ,som" #: ../data/functions.xml.in.h:632 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:633 msgid "Term expression" msgstr "Expressie voor term" #: ../data/functions.xml.in.h:634 msgid "Lower limit (i)" msgstr "Ondergrens (i)" #: ../data/functions.xml.in.h:635 msgid "Upper limit (n)" msgstr "Bovengrens (n)" #: ../data/functions.xml.in.h:636 msgid "Product" msgstr "Product" #: ../data/functions.xml.in.h:637 msgid "au:Π,r:product" msgstr "" #: ../data/functions.xml.in.h:638 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:639 msgid "Factor expression" msgstr "Expressie voor factor" #: ../data/functions.xml.in.h:640 msgid "Solve for multiple variables" msgstr "Oplossen voor meerdere variabelen" #: ../data/functions.xml.in.h:641 msgid "r:multisolve" msgstr "meerdereoplossen" #: ../data/functions.xml.in.h:642 msgid "Equation vector" msgstr "Vergelijkingsvector" #: ../data/functions.xml.in.h:643 msgid "Variable vector" msgstr "Variabele vector" #: ../data/functions.xml.in.h:644 msgid "Solve equation" msgstr "Vergelijking oplossen" #: ../data/functions.xml.in.h:645 msgid "r:solve" msgstr "oplossen" #: ../data/functions.xml.in.h:646 msgid "Equation" msgstr "Vergelijking" #: ../data/functions.xml.in.h:647 msgid "With respect to" msgstr "Met betrekking tot" #: ../data/functions.xml.in.h:648 msgid "Solve for two variables" msgstr "Oplossen voor twee variabelen" #: ../data/functions.xml.in.h:649 msgid "r:solve2" msgstr "oplossen2" #: ../data/functions.xml.in.h:650 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:651 msgid "Equation 1" msgstr "Vergelijking 1" #: ../data/functions.xml.in.h:652 msgid "Equation 2" msgstr "Vergelijking 2" #: ../data/functions.xml.in.h:653 msgid "Variable 1" msgstr "Variabele 1" #: ../data/functions.xml.in.h:654 msgid "Variable 2" msgstr "Variabele 2" #: ../data/functions.xml.in.h:655 msgid "Find Linear Function" msgstr "Lineaire functie bepalen" #: ../data/functions.xml.in.h:656 msgid "r:linearfunction" msgstr "lineairefunctie" #: ../data/functions.xml.in.h:657 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:658 msgid "x1" msgstr "" #: ../data/functions.xml.in.h:659 msgid "y1" msgstr "" #: ../data/functions.xml.in.h:660 msgid "x2" msgstr "" #: ../data/functions.xml.in.h:661 msgid "y2" msgstr "" #: ../data/functions.xml.in.h:662 msgid "Calculus" msgstr "Calculus" #: ../data/functions.xml.in.h:663 #, fuzzy msgid "Differentiate" msgstr "Percentiel" #: ../data/functions.xml.in.h:664 msgid "r:diff" msgstr "" #: ../data/functions.xml.in.h:665 msgid "Order" msgstr "Orde" #: ../data/functions.xml.in.h:666 msgid "Integrate" msgstr "Integreren" #: ../data/functions.xml.in.h:667 msgid "r:integrate" msgstr "integreren" #: ../data/functions.xml.in.h:668 msgid "Variable of integration" msgstr "Integratievariabele" #: ../data/functions.xml.in.h:669 msgid "Extreme Values" msgstr "Uiterste waarden" #: ../data/functions.xml.in.h:670 msgid "r:extremum" msgstr "uiterste" #: ../data/functions.xml.in.h:671 msgid "Geometry" msgstr "Meetkunde" #: ../data/functions.xml.in.h:672 msgid "Triangle" msgstr "Driehoek" #: ../data/functions.xml.in.h:673 msgid "Hypotenuse" msgstr "Hypotenusa" #: ../data/functions.xml.in.h:674 msgid "r:hypot" msgstr "" #: ../data/functions.xml.in.h:675 msgid "Side A" msgstr "Zijde A" #: ../data/functions.xml.in.h:676 msgid "Side B" msgstr "Zijde B" #: ../data/functions.xml.in.h:677 msgid "Triangle Area" msgstr "Oppervlakte van driehoek" #: ../data/functions.xml.in.h:678 msgid "r:triangle" msgstr "driehoek" #: ../data/functions.xml.in.h:679 msgid "Height" msgstr "Hoogte" #: ../data/functions.xml.in.h:680 msgid "Triangle Perimeter" msgstr "Omtrek van driehoek" #: ../data/functions.xml.in.h:681 msgid "r:triangle_perimeter" msgstr "driehoek_omtrek" #: ../data/functions.xml.in.h:682 msgid "Circle" msgstr "Cirkel" #: ../data/functions.xml.in.h:683 msgid "Circle Area" msgstr "Cirkeloppervlak" #: ../data/functions.xml.in.h:684 msgid "r:circle" msgstr "cirkel" #: ../data/functions.xml.in.h:685 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:686 msgid "Radius" msgstr "Straal" #: ../data/functions.xml.in.h:687 msgid "Circle Circumference" msgstr "Cirkelomtrek" #: ../data/functions.xml.in.h:688 msgid "r:circumference" msgstr "cirkelomtrek" #: ../data/functions.xml.in.h:689 msgid "Cylinder" msgstr "Cilinder" #: ../data/functions.xml.in.h:690 msgid "Cylinder Volume" msgstr "Volume van cilinder" #: ../data/functions.xml.in.h:691 msgid "r:cylinder" msgstr "cilinder" #: ../data/functions.xml.in.h:692 msgid "Surface Area of Cylinder" msgstr "Oppervlaktegrootte van cilinder" #: ../data/functions.xml.in.h:693 msgid "r:cylinder_sa" msgstr "cilinder_opp" #: ../data/functions.xml.in.h:694 msgid "Cone" msgstr "Kegel" #: ../data/functions.xml.in.h:695 msgid "Cone Volume" msgstr "Volume van kegel" #: ../data/functions.xml.in.h:696 msgid "r:cone" msgstr "kegel" #: ../data/functions.xml.in.h:697 msgid "Surface Area of Cone" msgstr "Oppervlaktegrootte van kegel" #: ../data/functions.xml.in.h:698 msgid "r:cone_sa" msgstr "kegel_opp" #: ../data/functions.xml.in.h:699 msgid "Sphere" msgstr "Bol" #: ../data/functions.xml.in.h:700 msgid "Sphere Volume" msgstr "Volume van bol" #: ../data/functions.xml.in.h:701 msgid "r:sphere" msgstr "bol" #: ../data/functions.xml.in.h:702 msgid "Surface Area of Sphere" msgstr "Oppervlaktegrootte van bol" #: ../data/functions.xml.in.h:703 msgid "r:sphere_sa" msgstr "bol_oppervlak" #: ../data/functions.xml.in.h:704 msgid "Square Area" msgstr "Oppervlakte van vierkant" #: ../data/functions.xml.in.h:705 msgid "r:square" msgstr "vierkant" #: ../data/functions.xml.in.h:706 msgid "Length of side" msgstr "Lengte van zijde" #: ../data/functions.xml.in.h:707 msgid "Square Perimeter" msgstr "Omtrek van vierkant" #: ../data/functions.xml.in.h:708 msgid "r:square_perimeter" msgstr "vierkant_omtrek" #: ../data/functions.xml.in.h:709 msgid "Cube" msgstr "Derdemacht" #: ../data/functions.xml.in.h:710 msgid "Cube Volume" msgstr "Volume kubus" #: ../data/functions.xml.in.h:711 msgid "r:cube" msgstr "kubus" #: ../data/functions.xml.in.h:712 msgid "Surface Area of Cube" msgstr "Oppervlaktegrootte van kubus" #: ../data/functions.xml.in.h:713 msgid "r:cube_sa" msgstr "kubus_opp" #: ../data/functions.xml.in.h:714 msgid "Rectangle" msgstr "Rechthoek" #: ../data/functions.xml.in.h:715 msgid "Rectangle Area" msgstr "Oppervlak rechthoek" #: ../data/functions.xml.in.h:716 msgid "r:rect" msgstr "" #: ../data/functions.xml.in.h:717 msgid "Width" msgstr "Breedte" #: ../data/functions.xml.in.h:718 msgid "Rectangle Perimeter" msgstr "Omtrek rechthoek" #: ../data/functions.xml.in.h:719 msgid "r:rect_perimeter" msgstr "rect_omtrek" #: ../data/functions.xml.in.h:720 msgid "Prism" msgstr "Prisma" #: ../data/functions.xml.in.h:721 msgid "Volume of Rectangular Prism" msgstr "Inhoud van rechthoekig prisma" #: ../data/functions.xml.in.h:722 msgid "r:rectprism" msgstr "rectprisma" #: ../data/functions.xml.in.h:723 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:724 msgid "Surface Area of Rectangular Prism" msgstr "Oppervlaktegrootte van rechthoekig prisma" #: ../data/functions.xml.in.h:725 msgid "r:rectprism_sa" msgstr "rectprisma_opp" #: ../data/functions.xml.in.h:726 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:727 msgid "Volume of Triangular Prism" msgstr "Inhoud van driehoekig prisma" #: ../data/functions.xml.in.h:728 msgid "r:triangleprism" msgstr "driehoekprisma" #: ../data/functions.xml.in.h:729 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:730 msgid "Pyramid" msgstr "Piramide" #: ../data/functions.xml.in.h:731 msgid "Pyramid Volume" msgstr "Volume van piramide" #: ../data/functions.xml.in.h:732 msgid "r:pyramid" msgstr "piramide" #: ../data/functions.xml.in.h:733 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:734 msgid "Length of base" msgstr "Lengte van basis" #: ../data/functions.xml.in.h:735 msgid "Width of base" msgstr "Basislengte" #: ../data/functions.xml.in.h:736 msgid "Volume of Regular Tetrahedron" msgstr "Inhoud van regelmatig viervlak (tetraëder)" #: ../data/functions.xml.in.h:737 msgid "r:tetrahedron" msgstr "tetraëder" #: ../data/functions.xml.in.h:738 msgid "Surface Area of Regular Tetrahedron" msgstr "Oppervlaktegrootte van regelmatig viervlak (tetraëder)" #: ../data/functions.xml.in.h:739 msgid "r:tetrahedron_sa" msgstr "tetraëder_opp" #: ../data/functions.xml.in.h:740 msgid "Height of Regular Tetrahedron" msgstr " Hoogte van een regelmatig viervlak (tetraëder)" #: ../data/functions.xml.in.h:741 msgid "r:tetrahedron_height" msgstr "tetraëder_hoogte" #: ../data/functions.xml.in.h:742 msgid "Volume of Square Pyramid" msgstr "Inhoud van vierkant prisma" #: ../data/functions.xml.in.h:743 msgid "r:sqpyramid" msgstr "vierkpiramide" #: ../data/functions.xml.in.h:744 msgid "Surface Area of Square Pyramid" msgstr "Oppervlaktegrootte van vierkante piramide" #: ../data/functions.xml.in.h:745 msgid "r:sqpyramid_sa" msgstr "vierkpiramide_opp" #: ../data/functions.xml.in.h:746 msgid "Height of Square Pyramid" msgstr "Hoogte van een vierkante piramide" #: ../data/functions.xml.in.h:747 msgid "r:sqpyramid_height" msgstr "midhoogte_vierkpiramide" #: ../data/functions.xml.in.h:748 msgid "Parallelogram" msgstr "Parallellogram" #: ../data/functions.xml.in.h:749 msgid "Parallelogram Area" msgstr "Oppervlak van parallellogram" #: ../data/functions.xml.in.h:750 msgid "r:parallelogram" msgstr "parallellogram" #: ../data/functions.xml.in.h:751 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:752 msgid "Parallelogram Perimeter" msgstr "Omtrek van parallellogram" #: ../data/functions.xml.in.h:753 msgid "r:parallelogram_perimeter" msgstr "parallellogram_omtrek" #: ../data/functions.xml.in.h:754 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:755 msgid "Trapezoid" msgstr "Trapezium" #: ../data/functions.xml.in.h:756 msgid "Trapezoid Area" msgstr "Oppervlakte van trapezium" #: ../data/functions.xml.in.h:757 msgid "r:trapezoid" msgstr "trapezium" #: ../data/functions.xml.in.h:758 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:759 msgid "Economics" msgstr "Economie" #: ../data/functions.xml.in.h:760 msgid "Microeconomics" msgstr "Microëconomie" #: ../data/functions.xml.in.h:761 msgid "Elasticity" msgstr "Elasticiteit" #: ../data/functions.xml.in.h:762 msgid "r:elasticity" msgstr "elasticiteit" #: ../data/functions.xml.in.h:763 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:764 msgid "Demand function" msgstr "Vraagfunctie" #: ../data/functions.xml.in.h:765 msgid "Price" msgstr "Prijs" #: ../data/functions.xml.in.h:766 msgid "Price variable" msgstr "Prijsvariabele" #: ../data/functions.xml.in.h:767 msgid "Consumer Surplus" msgstr "Consumentenoverschot" #: ../data/functions.xml.in.h:768 msgid "r:csurplus" msgstr "" #: ../data/functions.xml.in.h:769 msgid "Supply function or price" msgstr "Aanbodfunctie of prijs" #: ../data/functions.xml.in.h:770 msgid "Quantity variabel" msgstr "Hoeveelheidvariabele" #: ../data/functions.xml.in.h:771 msgid "Producer Surplus" msgstr "Producentenoverschot" #: ../data/functions.xml.in.h:772 msgid "r:psurplus" msgstr "" #: ../data/functions.xml.in.h:773 msgid "Supply function" msgstr "Aanbodfunctie" #: ../data/functions.xml.in.h:774 msgid "Demand function or price" msgstr "Vraagfunctie of prijs" #: ../data/functions.xml.in.h:775 msgid "Finance" msgstr "Financiën" #: ../data/functions.xml.in.h:776 msgid "Sum-of-Years Digits Depreciation" msgstr "Afschrijving volgens som der jaren" #: ../data/functions.xml.in.h:777 msgid "r:syd" msgstr "" #: ../data/functions.xml.in.h:778 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:779 msgid "Cost" msgstr "Kosten" #: ../data/functions.xml.in.h:780 msgid "Salvage value" msgstr "Restwaarde" #: ../data/functions.xml.in.h:781 msgid "Life" msgstr "Levensduur" #: ../data/functions.xml.in.h:782 msgid "Period" msgstr "Termijn" #: ../data/functions.xml.in.h:783 msgid "Straight Line Depreciation" msgstr "Gelijkblijvende afschrijving" #: ../data/functions.xml.in.h:784 msgid "r:sln" msgstr "" #: ../data/functions.xml.in.h:785 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:786 msgid "Present Value" msgstr "Huidige waarde" #: ../data/functions.xml.in.h:787 msgid "r:pv" msgstr "" #: ../data/functions.xml.in.h:788 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:789 msgid "Interest rate" msgstr "Rentepercentage" #: ../data/functions.xml.in.h:790 msgid "Number of periods" msgstr "Aantal termijnen" #: ../data/functions.xml.in.h:791 msgid "Payment made each period" msgstr "Termijnbetaling" #: ../data/functions.xml.in.h:792 msgid "Future value" msgstr "Toekomstige waarde" #: ../data/functions.xml.in.h:793 msgid "Type" msgstr "Type" #: ../data/functions.xml.in.h:794 msgid "Nominal Interest Rate" msgstr "Nominaal rentepercentage" #: ../data/functions.xml.in.h:795 msgid "r:nominal" msgstr "nominaal" #: ../data/functions.xml.in.h:796 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:797 msgid "Effective interest rate" msgstr "Effectief rentepercentage" #: ../data/functions.xml.in.h:798 msgid "Periods" msgstr "Termijnen" #: ../data/functions.xml.in.h:799 msgid "Zero Coupon" msgstr "Zonder coupons" #: ../data/functions.xml.in.h:800 msgid "r:zero_coupon" msgstr "geen_coupon" #: ../data/functions.xml.in.h:801 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:802 msgid "Face value" msgstr "Nominale waarde" #: ../data/functions.xml.in.h:803 msgid "Treasury Bill Yield" msgstr "Opbrengst kortlopende overheidsobligatie zonder coupons" #: ../data/functions.xml.in.h:804 msgid "r:tbillyield" msgstr "" #: ../data/functions.xml.in.h:805 msgid "Returns the yield for a treasury bill." msgstr "" "Berekent de opbrengst van een kortlopende overheidsobligatie zonder coupons." #: ../data/functions.xml.in.h:806 msgid "Settlement date" msgstr "Afwikkeldatum" #: ../data/functions.xml.in.h:807 msgid "Maturity date" msgstr "Vervaldatum" #: ../data/functions.xml.in.h:808 msgid "Price per $100 face value" msgstr "Prijs per €100 nominale waarde" #: ../data/functions.xml.in.h:809 msgid "Treasury Bill Price" msgstr "Prijs kortlopende overheidsobligatie zonder coupons" #: ../data/functions.xml.in.h:810 msgid "r:tbillprice" msgstr "" #: ../data/functions.xml.in.h:811 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:812 msgid "Discount rate" msgstr "Discontopercentage" #: ../data/functions.xml.in.h:813 msgid "Treasury Bill Equivalent" msgstr "Equivalent van kortlopende overheidsobligatie zonder coupons" #: ../data/functions.xml.in.h:814 msgid "r:tbilleq" msgstr "" #: ../data/functions.xml.in.h:815 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:816 msgid "Interest paid on a given period of an investment (ISPMT)" msgstr "Rente betaald over een gegeven investeringstermijn (ISPMT)" #: ../data/functions.xml.in.h:817 msgid "r:ispmt" msgstr "" #: ../data/functions.xml.in.h:818 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:819 msgid "Periodic interest rate" msgstr "Periodiek rentepercentage" #: ../data/functions.xml.in.h:820 msgid "Amortizement period" msgstr "Amortisatieperiode" #: ../data/functions.xml.in.h:821 msgid "Present value" msgstr "Huidige waarde" #: ../data/functions.xml.in.h:822 msgid "Payment for a loan" msgstr "Betaling voor een lening" #: ../data/functions.xml.in.h:823 msgid "r:pmt" msgstr "" #: ../data/functions.xml.in.h:824 #, fuzzy 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. Note that the " "interest rate here refers to the rate for each period and if you calculate " "with an annual rate, each period will be interpreted as a whole year (to get " "monthly payments, divide the result by 12)." 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:825 msgid "Rate" msgstr "" #: ../data/functions.xml.in.h:826 msgid "Periods of an investment" msgstr "Termijnen van een investering" #: ../data/functions.xml.in.h:827 msgid "r:nper" msgstr "nterm" #: ../data/functions.xml.in.h:828 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:829 msgid "Duration" msgstr "Duur" #: ../data/functions.xml.in.h:830 msgid "r:duration" msgstr "tijdsduur" #: ../data/functions.xml.in.h:831 msgid "Calculates the duration of a security." msgstr "Berekent de looptijd van een waardepapier." #: ../data/functions.xml.in.h:833 #, no-c-format msgid "Annual coupon rate (%)" msgstr "Jaarlijkse couponopbrengst (%)" #: ../data/functions.xml.in.h:835 #, no-c-format msgid "Annualized yield (%)" msgstr "Teruggerekende opbrengst per jaar (%)" #. Reccurance #: ../data/functions.xml.in.h:837 msgid "Frequency" msgstr "Frequentie" #: ../data/functions.xml.in.h:838 msgid "Periods for investment to attain desired value" msgstr "Termijnen waarin een investering de gewenste waarde bereikt" #: ../data/functions.xml.in.h:839 msgid "r:g_duration" msgstr "g_duur" #: ../data/functions.xml.in.h:840 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:841 msgid "Payment of an annuity going towards principal (PPMT)" msgstr "Aflossingsdeel van een termijn van een annuïteit (PPMT)" #: ../data/functions.xml.in.h:842 msgid "r:ppmt" msgstr "" #: ../data/functions.xml.in.h:843 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:844 msgid "Desired future value" msgstr "Gewenste toekomstige waarde" #: ../data/functions.xml.in.h:845 msgid "Effective Interest Rate" msgstr "Effectief rentepercentage" #: ../data/functions.xml.in.h:846 msgid "r:effect" msgstr "" #: ../data/functions.xml.in.h:847 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:848 msgid "Nominal interest rate" msgstr "Nominaal rentepercentage" #: ../data/functions.xml.in.h:849 msgid "Future Value" msgstr "Toekomstige waarde" #: ../data/functions.xml.in.h:850 msgid "r:fv" msgstr "" #: ../data/functions.xml.in.h:851 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:852 msgid "Return on continuously compounded interest" msgstr "Opbrengst van continu samengestelde rente" #: ../data/functions.xml.in.h:853 msgid "r:continuous" msgstr "continu" #: ../data/functions.xml.in.h:854 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:855 msgid "Principal" msgstr "Hoofdsom" #: ../data/functions.xml.in.h:856 msgid "Compound" msgstr "Samengesteld" #: ../data/functions.xml.in.h:857 msgid "r:compound" msgstr "samenstellen" #: ../data/functions.xml.in.h:858 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:859 msgid "Periods per year" msgstr "Termijnen per jaar" #: ../data/functions.xml.in.h:860 msgid "Payment of an annuity going towards interest (IPMT)" msgstr "Interestdeel van een termijn van een annuïteit (IPMT)" #: ../data/functions.xml.in.h:861 msgid "r:ipmt" msgstr "" #: ../data/functions.xml.in.h:862 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:863 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:864 msgid "r:intrate" msgstr "renteperc" #: ../data/functions.xml.in.h:865 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:866 msgid "Investment" msgstr "Investering" #: ../data/functions.xml.in.h:867 msgid "Redemption" msgstr "Aflossing" #: ../data/functions.xml.in.h:868 msgid "Dollar Fraction" msgstr "Dollar fractie" #: ../data/functions.xml.in.h:869 msgid "r:dollarfr" msgstr "" #: ../data/functions.xml.in.h:870 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:871 msgid "Decimal dollar" msgstr "Decimale dollar" #: ../data/functions.xml.in.h:872 msgid "Denominator of fraction" msgstr "Noemer van breuk" #: ../data/functions.xml.in.h:873 msgid "Dollar Decimal" msgstr "Dollar decimaal" #: ../data/functions.xml.in.h:874 msgid "r:dollarde" msgstr "" #: ../data/functions.xml.in.h:875 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:876 msgid "Fractional dollar" msgstr "Dollar als breuk" #: ../data/functions.xml.in.h:877 msgid "Amount received at maturity for a security bond" msgstr "Ontvangen bedrag voor een waardepapier op vervaldatum" #: ../data/functions.xml.in.h:878 msgid "r:received" msgstr "ontvangen" #: ../data/functions.xml.in.h:879 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:880 msgid "Discount rate for a security" msgstr "Discontopercentage voor een waardepapier" #: ../data/functions.xml.in.h:881 msgid "r:disc" msgstr "kort" #: ../data/functions.xml.in.h:882 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:883 msgid "Accrued interest of security paying at maturity" msgstr "Totale rente van waardepapier op vervaldatum" #: ../data/functions.xml.in.h:884 msgid "r:accrintm" msgstr "" #: ../data/functions.xml.in.h:885 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:886 msgid "Issue date" msgstr "Uitgiftedatum" #: ../data/functions.xml.in.h:887 msgid "Annual rate of security" msgstr "Jaarlijkse rente van waardepapier" #: ../data/functions.xml.in.h:888 msgid "Par value" msgstr "Nominale waarde" #: ../data/functions.xml.in.h:889 msgid "Accrued interest of security with periodic interest payments" msgstr "Totale rente van waardepapier met periodieke renteuitkeringen" #: ../data/functions.xml.in.h:890 msgid "r:accrint" msgstr "" #: ../data/functions.xml.in.h:891 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:892 msgid "First interest" msgstr "Eerste rente" #: ../data/functions.xml.in.h:893 msgid "Number of coupons to be paid" msgstr "Aantal te betalen coupons" #: ../data/functions.xml.in.h:894 msgid "r:coupnum" msgstr "" #: ../data/functions.xml.in.h:895 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:896 #, fuzzy msgid "Price per $100 face value of a discounted security" msgstr "Prijs per €100 nominale waarde van een waardepapier" #: ../data/functions.xml.in.h:897 msgid "r:pricedisc" msgstr "prijskorting" #: ../data/functions.xml.in.h:898 #, fuzzy msgid "" "Calculates and returns the price per $100 face value of a discounted " "security. 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:899 msgid "Discount" msgstr "Korting" #: ../data/functions.xml.in.h:900 msgid "Price per $100 face value of a security" msgstr "Prijs per €100 nominale waarde van een waardepapier" #: ../data/functions.xml.in.h:901 msgid "r:pricemat" msgstr "prijsmat" #: ../data/functions.xml.in.h:902 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:903 msgid "Annual yield" msgstr "Opbrengst per jaar" #: ../data/functions.xml.in.h:904 msgid "Level-Coupon Bond" msgstr "Obligatie met gelijkblijvende coupons" #: ../data/functions.xml.in.h:905 msgid "r:level_coupon" msgstr "gelijke_coupon" #: ../data/functions.xml.in.h:906 msgid "Calculates the value of a level-coupon bond." msgstr "Berekent de waarde van een obligatie met gelijkblijvende coupons." #: ../data/functions.xml.in.h:907 msgid "Coupon rate" msgstr "Couponrente" #: ../data/functions.xml.in.h:908 msgid "Coupons per year" msgstr "Aantal coupons per jaar" #: ../data/functions.xml.in.h:909 msgid "Market interest rate" msgstr "Marktrente" #: ../data/planets.xml.in.h:1 msgid "Earth" msgstr "Aarde" #: ../data/planets.xml.in.h:2 msgid "Mars" msgstr "" #. Planet #: ../data/planets.xml.in.h:4 msgid "!planets!Mercury" msgstr "Mercurius" #: ../data/planets.xml.in.h:5 msgid "Venus" msgstr "" #: ../data/planets.xml.in.h:6 msgid "Jupiter" msgstr "" #: ../data/planets.xml.in.h:7 msgid "Saturn" msgstr "Saturnus" #: ../data/planets.xml.in.h:8 msgid "Neptune" msgstr "Neptunus" #: ../data/planets.xml.in.h:9 msgid "Pluto" msgstr "" #: ../data/planets.xml.in.h:10 msgid "Uranus" msgstr "" #. Unit category #: ../data/units.xml.in.h:2 msgid "!units!Length" msgstr "Lengte" #: ../data/units.xml.in.h:3 msgid "Meter" msgstr "" #: ../data/units.xml.in.h:4 msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "a:m,meter,p:meters" #: ../data/units.xml.in.h:5 msgid "Kilometer" msgstr "" #: ../data/units.xml.in.h:6 msgid "Decimeter" msgstr "" #: ../data/units.xml.in.h:7 msgid "Centimeter" msgstr "" #: ../data/units.xml.in.h:8 msgid "Millimeter" msgstr "Milimeter" #: ../data/units.xml.in.h:9 msgid "Nautical Mile" msgstr "Nautische mijl" #: ../data/units.xml.in.h:10 msgid "r:nautical_mile,p:nautical_miles" msgstr "nautische_mijl,p:nautische_mijlen" #: ../data/units.xml.in.h:11 msgid "Ångström" msgstr "" #: ../data/units.xml.in.h:12 msgid "aru:Å,u:ångström,angstrom" msgstr "" #: ../data/units.xml.in.h:13 msgid "U.S. Survey Inch" msgstr "" #: ../data/units.xml.in.h:14 msgid "ar:US_in,US_inch,p:US_inches" msgstr "" #: ../data/units.xml.in.h:15 msgid "Inch" msgstr "" #: ../data/units.xml.in.h:16 msgid "ar:in,inch,p:inches" msgstr "" #: ../data/units.xml.in.h:17 msgid "Hand" msgstr "" #: ../data/units.xml.in.h:18 msgid "r:hand,p:hands" msgstr "" #: ../data/units.xml.in.h:19 msgid "Foot" msgstr "Voet" #: ../data/units.xml.in.h:20 msgid "ar:ft,foot,p:feet" msgstr "" #: ../data/units.xml.in.h:21 msgid "U.S. Survey Foot" msgstr "" #: ../data/units.xml.in.h:22 msgid "ar:US_ft,US_foot,p:US_feet" msgstr "" #: ../data/units.xml.in.h:23 msgid "Link" msgstr "" #: ../data/units.xml.in.h:24 msgid "ar:li,link,p:links" msgstr "" #: ../data/units.xml.in.h:25 msgid "Yard" msgstr "" #: ../data/units.xml.in.h:26 msgid "ar:yd,yard,p:yards" msgstr "" #: ../data/units.xml.in.h:27 msgid "Rod (pole/perch)" msgstr "" #: ../data/units.xml.in.h:28 msgid "ar:rd,rod,p:rods" msgstr "" #: ../data/units.xml.in.h:29 msgid "Fathom" msgstr "Vadem" #: ../data/units.xml.in.h:30 msgid "r:fathom,p:fathoms" msgstr "vadem,p:vadems" #: ../data/units.xml.in.h:31 msgid "Chain" msgstr "" #: ../data/units.xml.in.h:32 msgid "ar:ch,chain,p:chains" msgstr "" #: ../data/units.xml.in.h:33 msgid "Furlong" msgstr "" #: ../data/units.xml.in.h:34 msgid "ar:fur,furlong,p:furlongs" msgstr "" #: ../data/units.xml.in.h:35 msgid "Mile" msgstr "Mijl" #: ../data/units.xml.in.h:36 msgid "ar:mi,mile,p:miles" msgstr "a:mi,mijl,p:mijlen" #: ../data/units.xml.in.h:37 msgid "U.S. Survey Mile" msgstr "" #: ../data/units.xml.in.h:38 msgid "ar:US_mi,US_mile,p:US_miles" msgstr "" #: ../data/units.xml.in.h:39 msgid "Mil (1/1000 in)" msgstr "" #: ../data/units.xml.in.h:40 msgid "r:mil,p:mils" msgstr "" #: ../data/units.xml.in.h:41 msgid "Astronomical Unit" msgstr "Astronomische eenheid" #: ../data/units.xml.in.h:42 msgid "ar:AU,astronomical_unit,p:astronomical_units" msgstr "a:AU,astronomische_eenheid,p:astronomische_eenheden" #: ../data/units.xml.in.h:43 msgid "Light Year" msgstr "Lichtjaar" #: ../data/units.xml.in.h:44 msgid "ar:ly,lightyear,p:lightyears" msgstr "a:lj,lichtjaar,p:lichtjaren" #: ../data/units.xml.in.h:45 msgid "Parsec" msgstr "" #: ../data/units.xml.in.h:46 msgid "ar:pc,parsec,p:parsecs" msgstr "" #: ../data/units.xml.in.h:47 msgid "Pied du roi (French Royal Foot)" msgstr "Pied du roi (Franse koninklijke voet)" #: ../data/units.xml.in.h:48 msgid "r:pied_du_roi" msgstr "" #: ../data/units.xml.in.h:49 msgid "Pouce (French Royal Inch)" msgstr "Pouce (Franse koninklijke duim)" #: ../data/units.xml.in.h:50 msgid "r:pouce" msgstr "" #: ../data/units.xml.in.h:51 msgid "Ligne" msgstr "Ligne (1/40 inch)" #: ../data/units.xml.in.h:52 msgid "r:ligne" msgstr "" #: ../data/units.xml.in.h:53 msgid "Toise" msgstr "" #: ../data/units.xml.in.h:54 msgid "r:toise" msgstr "" #. Unit category #: ../data/units.xml.in.h:56 msgid "!units!Angle" msgstr "Hoek" #: ../data/units.xml.in.h:57 msgid "Plane Angle" msgstr "Vlakke hoek" #: ../data/units.xml.in.h:58 msgid "Meter per Meter" msgstr "Meter per meter" #: ../data/units.xml.in.h:59 msgid "Radian" msgstr "Radiaal" #: ../data/units.xml.in.h:60 msgid "ar:rad,radian,p:radians" msgstr "a:rad,radiaal,p:radialen" #: ../data/units.xml.in.h:61 msgid "Degree" msgstr "Graad" #: ../data/units.xml.in.h:62 msgid "ar:deg,au:°,degree,p:degrees" msgstr "a:grd,au:°,graad,p:graden" #: ../data/units.xml.in.h:63 msgid "Gradian (Gon)" msgstr "Grad (Gon)" #: ../data/units.xml.in.h:64 msgid "ar:gra,gradian,p:gradians,gon,p:gons" msgstr "a:gra,grad,p:grads,gon,p:gons" #: ../data/units.xml.in.h:65 msgid "Arcminute" msgstr "Boogminuut" #: ../data/units.xml.in.h:66 msgid "r:arcminute,p:arcminutes" msgstr "boogminuut,p:boogminuten" #: ../data/units.xml.in.h:67 msgid "Arcsecond" msgstr "Boogseconde" #: ../data/units.xml.in.h:68 msgid "r:arcsecond,p:arcseconds" msgstr "boogseconde,p:boogseconden" #: ../data/units.xml.in.h:69 msgid "Turn" msgstr "Slag" #: ../data/units.xml.in.h:70 msgid "r:turn,p:turns" msgstr "slag,p:slagen" #: ../data/units.xml.in.h:71 msgid "Solid Angle" msgstr "Ruimtehoek" #: ../data/units.xml.in.h:72 msgid "Square Meter per Square Meter" msgstr "Vierkante meter per vierkante meter" #: ../data/units.xml.in.h:73 msgid "Steradian" msgstr "Steradiaal" #: ../data/units.xml.in.h:74 msgid "ar:sr,steradian,p:steradians" msgstr "a:sr,steradiaal,p:steradialen" #: ../data/units.xml.in.h:75 msgid "Angular Acceleration" msgstr "Hoekversnelling" #: ../data/units.xml.in.h:76 msgid "Radians per Second Squared" msgstr "Radialen per seconde kwadraat" #: ../data/units.xml.in.h:77 msgid "Angular Velocity" msgstr "Hoeksnelheid" #: ../data/units.xml.in.h:78 msgid "Radians per Second" msgstr "Radialen per seconde" #. Unit category #: ../data/units.xml.in.h:80 msgid "!units!Mass" msgstr "Massa" #: ../data/units.xml.in.h:81 msgid "Gram" msgstr "" #: ../data/units.xml.in.h:82 msgid "ar:g,gram,p:grams" msgstr "a:g,gram,p:grammen" #: ../data/units.xml.in.h:83 msgid "Kilogram" msgstr "" #: ../data/units.xml.in.h:84 msgid "Hectogram" msgstr "" #: ../data/units.xml.in.h:85 msgid "Metric Ton (Tonne)" msgstr "Metrische ton (Ton)" #: ../data/units.xml.in.h:86 msgid "ar:t,tonne,p:tonnes,ton,p:tons" msgstr "a:t,ton,p:tonnen" #: ../data/units.xml.in.h:87 msgid "Grain" msgstr "" #: ../data/units.xml.in.h:88 msgid "ar:gr,grain,p:grains" msgstr "" #: ../data/units.xml.in.h:89 msgid "Pennyweight" msgstr "" #: ../data/units.xml.in.h:90 msgid "ar:pwt,pennyweight,p:pennyweights" msgstr "" #: ../data/units.xml.in.h:91 msgid "Ounce (troy)" msgstr "" #: ../data/units.xml.in.h:92 msgid "ar:oz_t,troy_ounce,p:troy_ounces" msgstr "" #: ../data/units.xml.in.h:93 msgid "Pound (troy)" msgstr "" #: ../data/units.xml.in.h:94 msgid "ar:lb_t,troy_pound,p:troy_pounds" msgstr "" #: ../data/units.xml.in.h:95 msgid "Dram" msgstr "" #: ../data/units.xml.in.h:96 msgid "ar:dr,dram,p:drams" msgstr "" #: ../data/units.xml.in.h:97 msgid "Ounce" msgstr "" #: ../data/units.xml.in.h:98 msgid "ar:oz,ounce,p:ounces" msgstr "" #: ../data/units.xml.in.h:99 msgid "Pound" msgstr "" #: ../data/units.xml.in.h:100 msgid "ar:lb,pound,p:pounds" msgstr "" #: ../data/units.xml.in.h:101 msgid "Short Hundredweight" msgstr "Short hundredweight" #: ../data/units.xml.in.h:102 msgid "ar:cwt,hundredweight,p:hundredweights" msgstr "" #: ../data/units.xml.in.h:103 msgid "Long Hundredweight" msgstr "Long hundredweight" #: ../data/units.xml.in.h:104 msgid "ar:l_cwt,long_hundredweight,p:long_hundredweights" msgstr "" #: ../data/units.xml.in.h:105 msgid "Short Ton" msgstr "Short ton" #: ../data/units.xml.in.h:106 msgid "ar:s_ton,short_ton,p:short_tons" msgstr "" #: ../data/units.xml.in.h:107 msgid "Long Ton" msgstr "Long ton" #: ../data/units.xml.in.h:108 msgid "ar:l_ton,long_ton,p:long_tons" msgstr "" #: ../data/units.xml.in.h:109 msgid "Stone" msgstr "" #: ../data/units.xml.in.h:110 msgid "r:stone,p:stones" msgstr "" #: ../data/units.xml.in.h:111 msgid "Cental" msgstr "" #: ../data/units.xml.in.h:112 msgid "r:cental,p:centals" msgstr "" #: ../data/units.xml.in.h:113 msgid "Carat" msgstr "Karaat" #: ../data/units.xml.in.h:114 msgid "r:carat,p:carats" msgstr "karaat" #: ../data/units.xml.in.h:115 msgid "Pfund" msgstr "Pond" #: ../data/units.xml.in.h:116 msgid "r:pfund" msgstr "" #: ../data/units.xml.in.h:117 msgid "Zentner" msgstr "" #: ../data/units.xml.in.h:118 msgid "r:zentner" msgstr "" #: ../data/units.xml.in.h:120 msgid "Kilogram per Cubic Meter" msgstr "Kilogram per kubieke meter" #: ../data/units.xml.in.h:121 msgid "Gram per Cubic Decimeter" msgstr "Gram per kubieke decimeter" #: ../data/units.xml.in.h:122 msgid "Gram per Cubic Centimeter" msgstr "Gram per kubieke centimeter" #: ../data/units.xml.in.h:123 #, fuzzy msgid "Atomic Mass" msgstr "Atomaire massa-eenheid" #: ../data/units.xml.in.h:124 msgid "Gram per Mole" msgstr "Gram per mol" #: ../data/units.xml.in.h:125 msgid "Atomic Mass Unit" msgstr "Atomaire massa-eenheid" #: ../data/units.xml.in.h:126 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:127 msgid "Dalton" msgstr "" #: ../data/units.xml.in.h:128 #, fuzzy msgid "ar:Da,dalton,p:daltons" msgstr "a:rad,radiaal,p:radialen" #: ../data/units.xml.in.h:129 #, fuzzy msgid "Kilodalton" msgstr "Kilowattuur" #: ../data/units.xml.in.h:130 msgid "Mass Fraction" msgstr "Massafractie" #: ../data/units.xml.in.h:131 msgid "Kilogram per Kilogram" msgstr "Kilogram per kilogram" #: ../data/units.xml.in.h:133 msgid "Second" msgstr "Seconde" #: ../data/units.xml.in.h:134 msgid "ar:s,second,p:seconds" msgstr "a:s,seconde,p:seconden" #: ../data/units.xml.in.h:135 msgid "Minute" msgstr "Minuut" #: ../data/units.xml.in.h:136 msgid "ar:min,minute,p:minutes" msgstr "a:min,minuut,p:minuten" #: ../data/units.xml.in.h:137 msgid "Hour" msgstr "Uur" #: ../data/units.xml.in.h:138 msgid "ar:h,hour,p:hours" msgstr "a:h,uur,p:uren" #: ../data/units.xml.in.h:139 msgid "Day" msgstr "Dag" #: ../data/units.xml.in.h:140 msgid "ar:d,day,p:days" msgstr "a:d,dag,p:dagen" #: ../data/units.xml.in.h:141 msgid "Week" msgstr "" #: ../data/units.xml.in.h:142 msgid "r:week,p:weeks" msgstr "week,p:weken" #: ../data/units.xml.in.h:143 msgid "Fortnight" msgstr "" #: ../data/units.xml.in.h:144 msgid "r:fortnight,p:fortnights" msgstr "" #: ../data/units.xml.in.h:145 msgid "Julian Year" msgstr "Juliaans jaar" #: ../data/units.xml.in.h:146 msgid "r:year,p:years" msgstr "jaar,p:jaren" #. Unit category #: ../data/units.xml.in.h:148 msgid "!units!Frequency" msgstr "Frequentie" #: ../data/units.xml.in.h:149 msgid "Hertz" msgstr "" #: ../data/units.xml.in.h:150 msgid "ar:Hz,hertz" msgstr "" #: ../data/units.xml.in.h:151 msgid "Electricity" msgstr "Elektriciteit" #: ../data/units.xml.in.h:152 msgid "Electric Current" msgstr "Elektrische stroom" #: ../data/units.xml.in.h:153 msgid "Ampere" msgstr "" #: ../data/units.xml.in.h:154 msgid "ar:A,ampere,p:amperes" msgstr "" #: ../data/units.xml.in.h:155 msgid "Abampere" msgstr "" #: ../data/units.xml.in.h:156 msgid "r:abampere,a:abA,a:aA,p:abamperes" msgstr "" #: ../data/units.xml.in.h:157 msgid "Current Density" msgstr "Stroomdichtheid" #: ../data/units.xml.in.h:158 msgid "Ampere per Meter Squared" msgstr "Ampere per meter kwadraat" #: ../data/units.xml.in.h:159 msgid "Electric Charge" msgstr "Elektrische lading" #: ../data/units.xml.in.h:160 msgid "Second Ampere" msgstr "Seconde ampere" #: ../data/units.xml.in.h:161 msgid "Coulomb" msgstr "" #: ../data/units.xml.in.h:162 msgid "ar:C,coulomb,p:coulombs" msgstr "" #: ../data/units.xml.in.h:163 msgid "Abcoulomb" msgstr "" #: ../data/units.xml.in.h:164 msgid "r:abcoulomb,p:abcoulombs,a:abC,a:aC" msgstr "" #: ../data/units.xml.in.h:165 msgid "Statcoloumb (Franklin)" msgstr "" #: ../data/units.xml.in.h:166 msgid "r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins" msgstr "" #: ../data/units.xml.in.h:167 msgid "Electric Charge Density" msgstr "Elektrische ladingsdichtheid" #: ../data/units.xml.in.h:168 msgid "Coulomb per Cubic Meter" msgstr "Coulomb per kubieke meter" #: ../data/units.xml.in.h:169 msgid "Electric Flux Density" msgstr "Elektrische fluxdichtheid" #: ../data/units.xml.in.h:170 msgid "Coulomb per Meter Squared" msgstr "Coulomb per vierkante meter" #: ../data/units.xml.in.h:171 msgid "Electric Potential" msgstr "Elektrische potentiaal" #: ../data/units.xml.in.h:172 msgid "Watt per Ampere" msgstr "Watt per ampere" #: ../data/units.xml.in.h:173 msgid "Volt" msgstr "" #: ../data/units.xml.in.h:174 msgid "ar:V,volt,p:volts" msgstr "" #: ../data/units.xml.in.h:175 msgid "Statvolt" msgstr "" #: ../data/units.xml.in.h:176 msgid "r:statvolt,p:statvolts,a:statV" msgstr "" #: ../data/units.xml.in.h:177 msgid "Abvolt" msgstr "" #: ../data/units.xml.in.h:178 msgid "r:abvolt,p:abvolts,a:abV" msgstr "" #: ../data/units.xml.in.h:179 msgid "Capacitance" msgstr "Capaciteit" #: ../data/units.xml.in.h:180 msgid "Coulomb per Volt" msgstr "Coulomb per volt" #: ../data/units.xml.in.h:181 msgid "Farad" msgstr "" #: ../data/units.xml.in.h:182 msgid "ar:F,farad,p:farads" msgstr "" #: ../data/units.xml.in.h:183 msgid "Electric Resistance" msgstr "Elektrische weerstand" #: ../data/units.xml.in.h:184 msgid "Volt per Ampere" msgstr "Volt per ampere" #: ../data/units.xml.in.h:185 msgid "Ohm" msgstr "" #: ../data/units.xml.in.h:186 msgid "au:Ω,r:ohm,p:ohms" msgstr "au:Ω,ohm" #: ../data/units.xml.in.h:187 msgid "Abohm" msgstr "" #: ../data/units.xml.in.h:188 msgid "r:abohm,p:abohms,au:abΩ" msgstr "" #: ../data/units.xml.in.h:189 msgid "Statohm" msgstr "" #: ../data/units.xml.in.h:190 msgid "r:statohm,p:statohms,au:statΩ" msgstr "" #: ../data/units.xml.in.h:191 msgid "Electric Conductance" msgstr "Elektrisch geleidingsvermogen" #: ../data/units.xml.in.h:192 msgid "Ampere per Volt" msgstr "Ampere per volt" #: ../data/units.xml.in.h:193 msgid "Siemens" msgstr "" #: ../data/units.xml.in.h:194 msgid "ar:S,siemens" msgstr "" #: ../data/units.xml.in.h:195 msgid "Electric Field Strength" msgstr "Elektrische veldsterkte" #: ../data/units.xml.in.h:196 msgid "Volt per Meter" msgstr "Volt per meter" #: ../data/units.xml.in.h:197 msgid "Permittivity" msgstr "Permittiviteit" #: ../data/units.xml.in.h:198 msgid "Farad per Meter" msgstr "Farad per meter" #: ../data/units.xml.in.h:199 msgid "Inductance" msgstr "Zelfinductie" #: ../data/units.xml.in.h:200 msgid "Weber per Ampere" msgstr "Weber per ampere" #: ../data/units.xml.in.h:201 msgid "Henry" msgstr "" #: ../data/units.xml.in.h:202 msgid "ar:H,henry,p:henrys" msgstr "" #: ../data/units.xml.in.h:203 msgid "Permeability" msgstr "Permeabiliteit" #: ../data/units.xml.in.h:204 msgid "Henry per Meter" msgstr "Henry per meter" #: ../data/units.xml.in.h:205 msgid "Temperature" msgstr "Temperatuur" #: ../data/units.xml.in.h:206 msgid "Kelvin" msgstr "Kelvin" #: ../data/units.xml.in.h:207 msgid "ar:K,kelvin,p:kelvins" msgstr "" #: ../data/units.xml.in.h:208 msgid "Degree Celsius" msgstr "Graden Celsius" #: ../data/units.xml.in.h:209 #, fuzzy msgid "" "ar:oC,au:°C,au:℃,r:celsius,p:celsius,centigrade,p:centigrades" msgstr "grd,°,graad,graden" #: ../data/units.xml.in.h:210 msgid "Degree Rankine" msgstr "Graden Rankine" #: ../data/units.xml.in.h:211 msgid "ar:oR,au:°R,r:rankine" msgstr "" #: ../data/units.xml.in.h:212 msgid "Degree Fahrenheit" msgstr "Graden Fahrenheit" #: ../data/units.xml.in.h:213 msgid "ar:oF,au:°F,au:℉,r:fahrenheit" msgstr "" #: ../data/units.xml.in.h:214 msgid "Substance" msgstr "Stofhoeveelheid" #: ../data/units.xml.in.h:215 msgid "Mole" msgstr "Mol" #: ../data/units.xml.in.h:216 msgid "ar:mol,mole,p:moles" msgstr "a:mol,mol,p:molen" #: ../data/units.xml.in.h:217 msgid "Einstein" msgstr "" #: ../data/units.xml.in.h:218 msgid "r:einstein,p:einsteins" msgstr "" #: ../data/units.xml.in.h:219 msgid "Substance Concentration" msgstr "Concentratie van stof" #: ../data/units.xml.in.h:220 msgid "Mole per Cubic Meter" msgstr "Mol per kubieke meter" #: ../data/units.xml.in.h:221 msgid "Catalytic Activity" msgstr "Katalitische activiteit" #: ../data/units.xml.in.h:222 msgid "Reciprocal Seconds Mole" msgstr "Omgekeerde seconden mol" #: ../data/units.xml.in.h:223 msgid "Katal" msgstr "" #: ../data/units.xml.in.h:224 msgid "ar:kat,katal,p:katals" msgstr "" #: ../data/units.xml.in.h:225 msgid "Catalytic Concentration" msgstr "Catalitische concentratie" #: ../data/units.xml.in.h:226 msgid "Katal per Cubic Meter" msgstr "Katal per kubieke meter" #: ../data/units.xml.in.h:227 msgid "Light" msgstr "Licht" #: ../data/units.xml.in.h:228 msgid "Luminous Intensity" msgstr "Lichtsterkte" #: ../data/units.xml.in.h:229 msgid "Candela" msgstr "" #: ../data/units.xml.in.h:230 msgid "ar:cd,candela,p:candelas" msgstr "" #: ../data/units.xml.in.h:231 msgid "Luminance" msgstr "Luminantie" #: ../data/units.xml.in.h:232 msgid "Candela per Meter Squared" msgstr "Candela per vierkante meter" #: ../data/units.xml.in.h:233 msgid "Stilb" msgstr "" #: ../data/units.xml.in.h:234 msgid "ar:sb,stilb,p:stilbs" msgstr "" #: ../data/units.xml.in.h:235 msgid "Luminous Flux" msgstr "Lichtstroom" #: ../data/units.xml.in.h:236 msgid "Candela Steradian" msgstr "Candela-steradiaal" #: ../data/units.xml.in.h:237 msgid "Lumen" msgstr "" #: ../data/units.xml.in.h:238 msgid "ar:lm,lumen,p:lumens" msgstr "a:lm,lumen" #: ../data/units.xml.in.h:239 msgid "Illuminance" msgstr "Verlichtingssterkte" #: ../data/units.xml.in.h:240 msgid "Lumen per Meter Squared" msgstr "Lumen per vierkante meter" #: ../data/units.xml.in.h:241 msgid "Lumen per Foot Squared" msgstr "Lumen per vierkante voet" #: ../data/units.xml.in.h:242 msgid "Lux" msgstr "" #: ../data/units.xml.in.h:243 msgid "ar:lx,lux" msgstr "" #: ../data/units.xml.in.h:244 msgid "Foot-Candle" msgstr "" #: ../data/units.xml.in.h:245 msgid "ar:fc,footcandle,p:footcandles" msgstr "" #: ../data/units.xml.in.h:246 msgid "Phot" msgstr "" #: ../data/units.xml.in.h:247 msgid "ar:ph,phot,p:phots" msgstr "" #: ../data/units.xml.in.h:248 msgid "Radiant Intensity" msgstr "Stralingsintensiteit" #: ../data/units.xml.in.h:249 msgid "Watt per Steradian" msgstr "Watt per steradiaal" #: ../data/units.xml.in.h:250 msgid "Irradiance" msgstr "Irradiantie" #: ../data/units.xml.in.h:251 msgid "Watt per Meter Squared" msgstr "Watt per meter kwadraat" #: ../data/units.xml.in.h:252 msgid "Einstein per Meter Squared per Second" msgstr "Einstein per vierkante meter per seconde" #: ../data/units.xml.in.h:253 msgid "Microeinstein per Meter Squared per Second" msgstr "Micro-einstein per vierkante meter per seconde" #: ../data/units.xml.in.h:254 msgid "Radiance" msgstr "Radiantie" #: ../data/units.xml.in.h:255 msgid "Watt per Square Meter Steradian" msgstr "Watt per vierkante meter per steradiaal" #: ../data/units.xml.in.h:256 msgid "Area" msgstr "Oppervlak" #: ../data/units.xml.in.h:257 msgid "Square Meter" msgstr "Vierkante meter" #: ../data/units.xml.in.h:258 msgid "Square Kilometer" msgstr "Vierkante kilometer" #: ../data/units.xml.in.h:259 msgid "Are" msgstr "" #: ../data/units.xml.in.h:260 msgid "ar:a,are,p:ares" msgstr "" #: ../data/units.xml.in.h:261 msgid "Hectare" msgstr "" #: ../data/units.xml.in.h:262 msgid "Barn" msgstr "" #: ../data/units.xml.in.h:263 msgid "ar:b,barn,p:barns" msgstr "" #: ../data/units.xml.in.h:264 msgid "Rood" msgstr "" #: ../data/units.xml.in.h:265 msgid "r:rood,p:roods" msgstr "" #: ../data/units.xml.in.h:266 msgid "Acre" msgstr "" #: ../data/units.xml.in.h:267 msgid "r:acre,p:acres" msgstr "" #: ../data/units.xml.in.h:268 msgid "Section" msgstr "Sectie" #: ../data/units.xml.in.h:269 msgid "r:section,p:sections" msgstr "sectie,p:secties" #: ../data/units.xml.in.h:270 msgid "Township" msgstr "" #: ../data/units.xml.in.h:271 msgid "r:township,p:townships" msgstr "" #: ../data/units.xml.in.h:272 msgid "Square Foot" msgstr "Vierkante voet" #: ../data/units.xml.in.h:273 msgid "Square Inch" msgstr "Vierkante inch" #: ../data/units.xml.in.h:274 msgid "Square Mile" msgstr "Vierkante mijl" #: ../data/units.xml.in.h:275 msgid "Volume" msgstr "" #: ../data/units.xml.in.h:276 msgid "Cubic Meter" msgstr "Kubieke meter" #: ../data/units.xml.in.h:277 msgid "Liter" msgstr "" #: ../data/units.xml.in.h:278 msgid "ar:L,a:l,liter,p:liters,litre,p:litres" msgstr "a:L,a:l,liter,p:liters" #: ../data/units.xml.in.h:279 msgid "Milliliter" msgstr "Mililiter" #: ../data/units.xml.in.h:280 msgid "Centiliter" msgstr "" #: ../data/units.xml.in.h:281 msgid "Deciliter" msgstr "" #: ../data/units.xml.in.h:282 msgid "Cubic Inch" msgstr "Kubieke inch" #: ../data/units.xml.in.h:283 msgid "Fuel Economy" msgstr "Brandstofgebruik" #: ../data/units.xml.in.h:284 msgid "Liter per Kilometer" msgstr "Liter per kilometer" #: ../data/units.xml.in.h:285 msgid "Kilometer per Liter" msgstr "Kilometer per liter" #: ../data/units.xml.in.h:286 msgid "Miles per Gallon" msgstr "" #: ../data/units.xml.in.h:287 msgid "a-cr:mpg" msgstr "" #: ../data/units.xml.in.h:288 msgid "Cooking" msgstr "Koken" #: ../data/units.xml.in.h:289 msgid "Teaspoon" msgstr "Theelepel" #: ../data/units.xml.in.h:290 msgid "r:teaspoon,p:teaspoons" msgstr "theelepel,p:theelepels" #: ../data/units.xml.in.h:291 msgid "Dessertspoon" msgstr "Dessertlepel" #: ../data/units.xml.in.h:292 msgid "r:dessertspoon,p:dessertspoons" msgstr "dessertlepel,p:dessertlepels" #: ../data/units.xml.in.h:293 msgid "Tablespoon" msgstr "Eetlepel" #: ../data/units.xml.in.h:294 msgid "r:tablespoon,p:tablespoons" msgstr "eetlepel,p:eetlepels" #: ../data/units.xml.in.h:295 msgid "Cup" msgstr "Kop" #: ../data/units.xml.in.h:296 msgid "r:cup,p:cups" msgstr "kop,p:koppen" #: ../data/units.xml.in.h:297 msgid "Imperial Capacity" msgstr "" #: ../data/units.xml.in.h:298 msgid "Imperial Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:299 msgid "ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces" msgstr "" #: ../data/units.xml.in.h:300 msgid "Imperial Gill" msgstr "" #: ../data/units.xml.in.h:301 msgid "ar:UK_gi,imperial_gill,p:imperial_gills" msgstr "" #: ../data/units.xml.in.h:302 msgid "Imperial Pint" msgstr "" #: ../data/units.xml.in.h:303 msgid "ar:UK_pt,imperial_pint,p:imperial_pints" msgstr "" #: ../data/units.xml.in.h:304 msgid "Imperial Quart" msgstr "" #: ../data/units.xml.in.h:305 msgid "ar:UK_qt,imperial_quart,p:imperial_quarts" msgstr "" #: ../data/units.xml.in.h:306 msgid "Imperial Gallon" msgstr "" #: ../data/units.xml.in.h:307 msgid "ar:UK_gal,imperial_gallon,p:imperial_gallons" msgstr "" #: ../data/units.xml.in.h:308 msgid "Imperial Minim" msgstr "" #: ../data/units.xml.in.h:309 msgid "r:imperial_minim,p:imperial_minims" msgstr "" #: ../data/units.xml.in.h:310 msgid "Imperial Fluid Scuple" msgstr "" #: ../data/units.xml.in.h:311 msgid "r:imperial_fluid_scuple,p:imperial_fluid_scuples" msgstr "" #: ../data/units.xml.in.h:312 msgid "Imperial Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:313 msgid "ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms" msgstr "" #: ../data/units.xml.in.h:314 msgid "Imperial Bushel" msgstr "" #: ../data/units.xml.in.h:315 msgid "ar:UK_bu,imperial_bushel,p:imperial_bushels" msgstr "" #: ../data/units.xml.in.h:316 msgid "U.S. Capacity" msgstr "" #: ../data/units.xml.in.h:317 msgid "U.S. Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:318 msgid "ar:fl_oz,fluid_ounce,p:fluid_ounces" msgstr "" #: ../data/units.xml.in.h:319 msgid "U.S. Gill" msgstr "" #: ../data/units.xml.in.h:320 msgid "ar:gi,gill,p:gills" msgstr "" #: ../data/units.xml.in.h:321 msgid "U.S. Liquid Pints" msgstr "" #: ../data/units.xml.in.h:322 msgid "ar:liq_pt,liquid_pint,p:liquid_pints" msgstr "" #: ../data/units.xml.in.h:323 msgid "U.S. Liquid Quarts" msgstr "" #: ../data/units.xml.in.h:324 msgid "ar:liq_qt,liquid_quart,p:liquid_quarts" msgstr "" #: ../data/units.xml.in.h:325 msgid "U.S. Minim" msgstr "" #: ../data/units.xml.in.h:326 msgid "r:minim,p:minims" msgstr "" #: ../data/units.xml.in.h:327 msgid "U.S. Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:328 msgid "ar:fl_dr,fluid_drachm,p:fluid_drachms" msgstr "" #: ../data/units.xml.in.h:329 msgid "U.S. Dry Pint" msgstr "" #: ../data/units.xml.in.h:330 msgid "ar:dry_pt,dry_pint,p:dry_pints" msgstr "" #: ../data/units.xml.in.h:331 msgid "U.S. Dry Quart" msgstr "" #: ../data/units.xml.in.h:332 msgid "ar:dry_qt,dry_quart,p:dry_quarts" msgstr "" #: ../data/units.xml.in.h:333 msgid "U.S. Peck" msgstr "" #: ../data/units.xml.in.h:334 msgid "ar:pk,peck,p:pecks" msgstr "" #: ../data/units.xml.in.h:335 msgid "U.S. Bushel" msgstr "" #: ../data/units.xml.in.h:336 msgid "ar:bu,bushel,p:bushels" msgstr "" #: ../data/units.xml.in.h:337 msgid "U.S. Gallon" msgstr "" #: ../data/units.xml.in.h:338 msgid "ar:gal,gallon,p:gallons" msgstr "" #: ../data/units.xml.in.h:339 #, fuzzy msgid "U.S. Barrel (oil)" msgstr "U.S. Barrell (olie)" #: ../data/units.xml.in.h:340 #, fuzzy msgid "ar:bbl,barrel,p:barrels" msgstr "bar" #: ../data/units.xml.in.h:341 msgid "Specific Volume" msgstr "Soortelijk volume" #: ../data/units.xml.in.h:342 msgid "Cubic Meter per Kilogram" msgstr "Kubieke meter per kilogram" #: ../data/units.xml.in.h:343 msgid "Speed" msgstr "Snelheid" #: ../data/units.xml.in.h:344 msgid "Meter per Second" msgstr "Meter per seconde" #: ../data/units.xml.in.h:345 msgid "Kilometer per Hour" msgstr "Kilometer per uur" #: ../data/units.xml.in.h:346 msgid "Nautical Mile per Hour" msgstr "Nautische mijl per uur" #: ../data/units.xml.in.h:347 msgid "Knot" msgstr "Knoop" #: ../data/units.xml.in.h:348 msgid "r:knot,p:knots" msgstr "knoop,p:knopen" #: ../data/units.xml.in.h:349 msgid "Miles per Hour" msgstr "" #: ../data/units.xml.in.h:350 msgid "a-cr:mph" msgstr "" #: ../data/units.xml.in.h:351 msgid "Acceleration" msgstr "Versnelling" #: ../data/units.xml.in.h:352 msgid "Meter per Second Squared" msgstr "Meter per seconde kwadraat" #: ../data/units.xml.in.h:353 msgid "Galileo" msgstr "" #: ../data/units.xml.in.h:354 msgid "ar:Gal,galileo,p:galileos" msgstr "" #: ../data/units.xml.in.h:355 msgid "Gee" msgstr "" #: ../data/units.xml.in.h:356 msgid "r:gee,p:gees" msgstr "" #: ../data/units.xml.in.h:357 msgid "Magnetism" msgstr "Magnetisme" #: ../data/units.xml.in.h:358 msgid "Wave Number" msgstr "Golfgetal" #: ../data/units.xml.in.h:359 msgid "Reciprocal Meter" msgstr "Omgekeerde meter" #: ../data/units.xml.in.h:360 msgid "Magnetic Field Strength" msgstr "Magnetische veldsterkte" #: ../data/units.xml.in.h:361 msgid "Ampere per Meter" msgstr "Ampere per meter" #: ../data/units.xml.in.h:362 msgid "Oersted" msgstr "" #: ../data/units.xml.in.h:363 msgid "ar:Oe,oersted,p:oersteds" msgstr "Oe,oersted,oersteds" #: ../data/units.xml.in.h:364 msgid "Magnetic Flux" msgstr "Magnetische flux" #: ../data/units.xml.in.h:365 msgid "Volt Seconds" msgstr "Volt seconden" #: ../data/units.xml.in.h:366 msgid "Weber" msgstr "" #: ../data/units.xml.in.h:367 msgid "ar:Wb,weber,p:webers" msgstr "" #: ../data/units.xml.in.h:368 msgid "Maxwell" msgstr "" #: ../data/units.xml.in.h:369 msgid "ar:Mx,maxwell,p:maxwells" msgstr "" #: ../data/units.xml.in.h:370 msgid "Magnetic Flux Density" msgstr "Magnetische fluxdichtheid" #: ../data/units.xml.in.h:371 msgid "Weber per Meter Squared" msgstr "Weber per meter kwadraat" #: ../data/units.xml.in.h:372 msgid "Tesla" msgstr "" #: ../data/units.xml.in.h:373 msgid "ar:T,tesla,p:teslas" msgstr "" #: ../data/units.xml.in.h:374 msgid "Gauss" msgstr "" #: ../data/units.xml.in.h:375 msgid "r:gauss" msgstr "" #: ../data/units.xml.in.h:376 msgid "Force" msgstr "Kracht" #: ../data/units.xml.in.h:377 msgid "Meter Kilogram per Second Squared" msgstr "Meter kilogram per seconde kwadraat" #: ../data/units.xml.in.h:378 msgid "Newton" msgstr "" #: ../data/units.xml.in.h:379 msgid "ar:N,newton,p:newtons" msgstr "" #: ../data/units.xml.in.h:380 msgid "Dyne" msgstr "" #: ../data/units.xml.in.h:381 msgid "ar:dyn,dyne,p:dynes" msgstr "" #: ../data/units.xml.in.h:382 msgid "Pound-force" msgstr "" #: ../data/units.xml.in.h:383 msgid "ar:lbf,pound_force" msgstr "" #: ../data/units.xml.in.h:384 msgid "Pound Foot per Second Squared" msgstr "Pound Foot per seconde kwadraat" #: ../data/units.xml.in.h:385 msgid "Poundal" msgstr "" #: ../data/units.xml.in.h:386 msgid "r:poundal,p:poundals,a:pdl" msgstr "" #: ../data/units.xml.in.h:387 msgid "Pond (Gram-Force)" msgstr "Pond (gram-kracht)" #: ../data/units.xml.in.h:388 msgid "r:pond,p:ponds,a:gf" msgstr "pond,p:ponden,a:gf" #: ../data/units.xml.in.h:389 msgid "Kilopond (Kilogram-Force)" msgstr "Kilopond (Kilogram-kracht)" #: ../data/units.xml.in.h:390 msgid "Moment of Force" msgstr "Krachtmoment" #: ../data/units.xml.in.h:391 msgid "Newton Meter" msgstr "Newtonmeter" #: ../data/units.xml.in.h:392 msgid "Pressure" msgstr "Druk" #: ../data/units.xml.in.h:393 msgid "Newton per Meter Squared" msgstr "Newton per vierkante meter" #: ../data/units.xml.in.h:394 msgid "Pound-force per Square Inch" msgstr "Pound-force per inch kwadraat" #: ../data/units.xml.in.h:395 msgid "Pascal" msgstr "" #: ../data/units.xml.in.h:396 msgid "ar:Pa,pascal,p:pascals" msgstr "" #: ../data/units.xml.in.h:397 msgid "Pound-force per Square Inch (psi)" msgstr "Pound-force per inch kwadraat (psi)" #: ../data/units.xml.in.h:398 msgid "a-cr:psi" msgstr "" #: ../data/units.xml.in.h:399 msgid "Bar" msgstr "" #: ../data/units.xml.in.h:400 msgid "r:bar,p:bars" msgstr "bar" #: ../data/units.xml.in.h:401 msgid "Atmosphere" msgstr "Atmosfeer" #: ../data/units.xml.in.h:402 msgid "ar:atm,atmosphere,p:atmospheres" msgstr "a:atm,atmosfeer" #: ../data/units.xml.in.h:403 msgid "Torr" msgstr "" #: ../data/units.xml.in.h:404 msgid "r:torr,p:torrs" msgstr "" #: ../data/units.xml.in.h:405 msgid "Millimeter of Mercury" msgstr "Milimeter kwik" #: ../data/units.xml.in.h:406 msgid "ar:mmHg" msgstr "" #: ../data/units.xml.in.h:407 msgid "Inch of Mercury" msgstr "Inches kwik" #: ../data/units.xml.in.h:408 msgid "ar:inHg" msgstr "" #: ../data/units.xml.in.h:409 msgid "Dynamic Viscosity" msgstr "Dynamische viscositeit" #: ../data/units.xml.in.h:410 msgid "Pascal Second" msgstr "Pascal seconde" #: ../data/units.xml.in.h:411 msgid "Poise" msgstr "" #: ../data/units.xml.in.h:412 msgid "ar:P,poise,p:poises" msgstr "" #: ../data/units.xml.in.h:413 msgid "Kinematic Viscosity" msgstr "Kinematische viscositeit" #: ../data/units.xml.in.h:414 msgid "Square Meter per Second" msgstr "Vierkante meter per seconde" #: ../data/units.xml.in.h:415 msgid "Stokes" msgstr "" #: ../data/units.xml.in.h:416 msgid "ar:St,stokes" msgstr "" #: ../data/units.xml.in.h:417 msgid "Surface Tension" msgstr "Oppervlaktespanning" #: ../data/units.xml.in.h:418 msgid "Newton per Meter" msgstr "Newton per meter" #: ../data/units.xml.in.h:419 msgid "Energy" msgstr "Energie" #: ../data/units.xml.in.h:420 msgid "Joule" msgstr "" #: ../data/units.xml.in.h:421 msgid "ar:J,joule,p:joules" msgstr "" #: ../data/units.xml.in.h:422 msgid "Watt Hour" msgstr "Wattuur" #: ../data/units.xml.in.h:423 msgid "Kilowatt Hour" msgstr "Kilowattuur" #: ../data/units.xml.in.h:424 msgid "Calorie (international table)" msgstr "Calorie (internationale tabel)" #: ../data/units.xml.in.h:425 msgid "ais:cal_IT,ar:cal,c:calorie,cp:calories" msgstr "ais:cal_IT,a:cal,c:calorie,cp:calorieën" #: ../data/units.xml.in.h:426 msgid "Calorie (capital C)" msgstr "Calorie (hoofdletter C)" #: ../data/units.xml.in.h:427 msgid "cr:Calorie,cp:Calories" msgstr "c:Calorie,cp:Calorieën" #: ../data/units.xml.in.h:428 msgid "Calorie (thermochemical)" msgstr "Calorie (thermochemisch)" #: ../data/units.xml.in.h:429 msgid "ars:cal_th" msgstr "as:cal_th" #: ../data/units.xml.in.h:430 msgid "Gram of TNT" msgstr "Gram TNT" #: ../data/units.xml.in.h:431 msgid "a-cr:gTNT,gramTNT" msgstr "" #: ../data/units.xml.in.h:432 msgid "Ton of TNT" msgstr "Ton TNT" #: ../data/units.xml.in.h:433 msgid "a-cr:tTNT,tonTNT" msgstr "" #: ../data/units.xml.in.h:434 msgid "Calorie (15 degrees Celsius)" msgstr "Calorie (15 graden Celcius)" #: ../data/units.xml.in.h:435 msgid "ars:cal_fifteen" msgstr "as:cal_fifteen" #: ../data/units.xml.in.h:436 msgid "Calorie (mean)" msgstr "Calorie (gemiddeld)" #: ../data/units.xml.in.h:437 msgid "ars:cal_mean" msgstr "as:cal_gemiddeld" #: ../data/units.xml.in.h:438 msgid "British Thermal Unit (IT)" msgstr "" #: ../data/units.xml.in.h:439 msgid "ar:Btu" msgstr "" #: ../data/units.xml.in.h:440 msgid "Electron Volt" msgstr "Elektronvolt" #: ../data/units.xml.in.h:441 msgid "ar:eV,electron_volt,p:electron_volts" msgstr "" #: ../data/units.xml.in.h:442 msgid "Erg" msgstr "" #: ../data/units.xml.in.h:443 msgid "r:erg,p:ergs" msgstr "" #: ../data/units.xml.in.h:444 msgid "Foe" msgstr "" #: ../data/units.xml.in.h:445 msgid "r:foe,p:foes" msgstr "" #: ../data/units.xml.in.h:446 msgid "Foot-Pound Force" msgstr "" #: ../data/units.xml.in.h:447 msgid "Hartree" msgstr "" #: ../data/units.xml.in.h:448 msgid "ar:Ha,as:E_h,hartree" msgstr "" #: ../data/units.xml.in.h:449 #, fuzzy msgid "Rydberg" msgstr "Rydberg constante" #: ../data/units.xml.in.h:450 msgid "ar:Ry,s:rydberg_unit" msgstr "" #: ../data/units.xml.in.h:451 msgid "Specific Energy" msgstr "Soortelijke energie" #: ../data/units.xml.in.h:452 msgid "Joule per Kilogram" msgstr "Joule per kilogram" #: ../data/units.xml.in.h:453 msgid "Power" msgstr "Vermogen" #: ../data/units.xml.in.h:454 msgid "Joule per Second" msgstr "Joule per seconde" #: ../data/units.xml.in.h:455 msgid "Watt" msgstr "Watt" #: ../data/units.xml.in.h:456 msgid "ar:W,watt,p:watts" msgstr "" #: ../data/units.xml.in.h:457 msgid "Horse Power" msgstr "Paardekracht (Engels)" #: ../data/units.xml.in.h:458 msgid "ar:hp,horsepower,p:horsepowers" msgstr "" #: ../data/units.xml.in.h:459 msgid "Pferdestärke" msgstr "Paardekracht (metrisch)" #: ../data/units.xml.in.h:460 msgid "ar:PS,u:pferdestärke" msgstr "pk,paardekracht,paardekrachten" #: ../data/units.xml.in.h:461 msgid "Entropy" msgstr "Entropie" #: ../data/units.xml.in.h:462 msgid "Joule per Kelvin" msgstr "Joule per Kelvin" #: ../data/units.xml.in.h:463 msgid "Specific Entropy" msgstr "Soortelijke entropie" #: ../data/units.xml.in.h:464 msgid "Joule per Kilogram Kelvin" msgstr "Joule per kilogram Kelvin" #: ../data/units.xml.in.h:465 msgid "Thermal Conductivity" msgstr "Thermisch geleidingsvermogen" #: ../data/units.xml.in.h:466 msgid "Watt per Meter Kelvin" msgstr "Watt per meter Kelvin" #: ../data/units.xml.in.h:467 msgid "Energy Density" msgstr "Energiedichtheid" #: ../data/units.xml.in.h:468 msgid "Joule per Cubic Meter" msgstr "Joule per kubieke meter" #: ../data/units.xml.in.h:469 msgid "Molar Energy" msgstr "Molaire energie" #: ../data/units.xml.in.h:470 msgid "Joule per Mole" msgstr "Joule per mol" #: ../data/units.xml.in.h:471 msgid "Molar Entropy" msgstr "Molaire entropy" #: ../data/units.xml.in.h:472 msgid "Joule per Mole Kelvin" msgstr "Joule per mol Kelvin" #: ../data/units.xml.in.h:473 msgid "Radioactivity" msgstr "Radioactiviteit" #: ../data/units.xml.in.h:474 msgid "Becquerel" msgstr "" #: ../data/units.xml.in.h:475 msgid "ar:Bq,becquerel,p:becquerels" msgstr "" #: ../data/units.xml.in.h:476 msgid "Curie" msgstr "" #: ../data/units.xml.in.h:477 msgid "ar:Ci,curie,p:curies" msgstr "" #: ../data/units.xml.in.h:478 msgid "Absorbed Dose" msgstr "Absorptiedosis" #: ../data/units.xml.in.h:479 msgid "Gray" msgstr "" #: ../data/units.xml.in.h:480 msgid "ar:Gy,gray,p:grays" msgstr "" #: ../data/units.xml.in.h:481 msgid "Rad" msgstr "" #: ../data/units.xml.in.h:482 msgid "r:rad_radioactivity" msgstr "" #: ../data/units.xml.in.h:483 msgid "Dose Equivalent" msgstr "Dosisequivalent" #: ../data/units.xml.in.h:484 msgid "Sievert" msgstr "" #: ../data/units.xml.in.h:485 msgid "ar:Sv,sievert,p:sieverts" msgstr "" #: ../data/units.xml.in.h:486 msgid "Rem" msgstr "" #: ../data/units.xml.in.h:487 msgid "r:rem_radioactivity" msgstr "" #: ../data/units.xml.in.h:488 msgid "Exposure" msgstr "Belichting" #: ../data/units.xml.in.h:489 msgid "Coulomb per Kilogram" msgstr "Coulomb per kilogram" #: ../data/units.xml.in.h:490 msgid "Roentgen" msgstr "" #: ../data/units.xml.in.h:491 msgid "ar:R,roentgen,p:roentgens" msgstr "" #: ../data/units.xml.in.h:492 msgid "Absorbed Dose Rate" msgstr "Absorptiesnelheid" #: ../data/units.xml.in.h:493 msgid "Gray per Second" msgstr "Gray per seconde" #: ../data/units.xml.in.h:494 msgid "Ratio" msgstr "Verhouding" #: ../data/units.xml.in.h:495 msgid "Neper" msgstr "" #: ../data/units.xml.in.h:496 msgid "ar:Np,neper,p:nepers" msgstr "" #: ../data/units.xml.in.h:497 msgid "Bel" msgstr "" #: ../data/units.xml.in.h:498 msgid "ar:B,bel,p:bels" msgstr "" #: ../data/units.xml.in.h:499 msgid "Decibel" msgstr "" #: ../data/units.xml.in.h:500 msgid "Information" msgstr "Informatie" #: ../data/units.xml.in.h:501 msgid "Bit" msgstr "" #: ../data/units.xml.in.h:502 msgid "r:bit,p:bits" msgstr "" #: ../data/units.xml.in.h:503 msgid "Byte (8-bit)" msgstr "" #: ../data/units.xml.in.h:504 msgid "r:byte,p:bytes,octet,p:octets" msgstr "" #: ../data/units.xml.in.h:505 msgid "Nibble" msgstr "Nibble" #: ../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 "Tribble" msgstr "" #: ../data/units.xml.in.h:508 msgid "r:tribble,p:tribbles" msgstr "" #: ../data/units.xml.in.h:509 msgid "Word (16-bit)" msgstr "" #: ../data/units.xml.in.h:510 msgid "r:word,p:words" msgstr "woord,p:woorden" #: ../data/units.xml.in.h:511 msgid "Kilobyte" msgstr "" #: ../data/units.xml.in.h:512 msgid "Kibibyte" msgstr "" #: ../data/units.xml.in.h:513 msgid "Mebibyte" msgstr "" #: ../data/units.xml.in.h:514 msgid "Gibibyte" msgstr "" #: ../data/units.xml.in.h:515 msgid "Megabyte" msgstr "" #: ../data/units.xml.in.h:516 msgid "Gigabyte" msgstr "" #: ../data/units.xml.in.h:517 msgid "Terabyte" msgstr "" #: ../data/units.xml.in.h:518 msgid "Kilobit" msgstr "" #: ../data/units.xml.in.h:519 msgid "Kibibit" msgstr "" #: ../data/units.xml.in.h:520 msgid "Mebibit" msgstr "" #: ../data/units.xml.in.h:521 msgid "Gibibit" msgstr "" #: ../data/units.xml.in.h:522 msgid "Megabit" msgstr "" #: ../data/units.xml.in.h:523 msgid "Gigabit" msgstr "" #: ../data/units.xml.in.h:524 msgid "Terabit" msgstr "" #: ../data/units.xml.in.h:525 msgid "Typography" msgstr "Typografie" #: ../data/units.xml.in.h:526 msgid "PostScript Point" msgstr "" #: ../data/units.xml.in.h:527 msgid "ar:pt,a:pts,point,p:points" msgstr "" #: ../data/units.xml.in.h:528 msgid "PostScript Pica" msgstr "" #: ../data/units.xml.in.h:529 msgid "r:pica,p:picas" msgstr "" #: ../data/units.xml.in.h:530 msgid "ATA Pica" msgstr "" #: ../data/units.xml.in.h:531 msgid "r:ata_pica,p:ata_picas" msgstr "" #: ../data/units.xml.in.h:532 msgid "ATA Point" msgstr "" #: ../data/units.xml.in.h:533 msgid "r:ata_point,a:ata_pt,p:ata_points" msgstr "" #: ../data/units.xml.in.h:534 msgid "New Didot Point" msgstr "Nieuwe Didot Point" #: ../data/units.xml.in.h:535 msgid "r:new_didot" msgstr "nieuwe_didot" #: ../data/units.xml.in.h:536 msgid "Didot Point" msgstr "" #: ../data/units.xml.in.h:537 msgid "r:didot,a:dd" msgstr "" #: ../data/units.xml.in.h:538 msgid "Cicero" msgstr "" #: ../data/units.xml.in.h:539 msgid "r:cicero" msgstr "" #: ../data/variables.xml.in.h:1 msgid "Small Numbers" msgstr "Kleine getallen" #: ../data/variables.xml.in.h:2 msgid "Per Mille" msgstr "Per mille" #: ../data/variables.xml.in.h:3 msgid "r:permille,au:‰" msgstr "" #: ../data/variables.xml.in.h:4 msgid "Per Myriad" msgstr "Per myriad" #: ../data/variables.xml.in.h:5 msgid "r:permyriad,au:‱" msgstr "" #: ../data/variables.xml.in.h:6 msgid "Percent" msgstr "Procent" #: ../data/variables.xml.in.h:8 #, fuzzy, no-c-format msgid "a:%,r:percent" msgstr "percentiel" #: ../data/variables.xml.in.h:9 msgid "Large Numbers" msgstr "Grote getallen" #: ../data/variables.xml.in.h:10 msgid "Googolplex" msgstr "Googolplex" #: ../data/variables.xml.in.h:11 msgid "r:googolplex" msgstr "" #: ../data/variables.xml.in.h:12 msgid "Googol" msgstr "Googol" #: ../data/variables.xml.in.h:13 msgid "r:googol" msgstr "" #: ../data/variables.xml.in.h:14 msgid "Centillion" msgstr "Quinquagintiljard" #: ../data/variables.xml.in.h:15 msgid "-r:centillion" msgstr "quinquagintiljard" #: ../data/variables.xml.in.h:16 msgid "Vigintillion" msgstr "Deciljard" #: ../data/variables.xml.in.h:17 msgid "-r:vigintillion" msgstr "deciljard" #: ../data/variables.xml.in.h:18 msgid "Novemdecillion" msgstr "deciljoen" #: ../data/variables.xml.in.h:19 msgid "-r:novemdecillion" msgstr "deciljoen" #: ../data/variables.xml.in.h:20 msgid "Octodecillion" msgstr "Noniljard" #: ../data/variables.xml.in.h:21 msgid "-r:octodecillion" msgstr "noniljard" #: ../data/variables.xml.in.h:22 msgid "Septendecillion" msgstr "Noniljoen" #: ../data/variables.xml.in.h:23 msgid "-r:septendecillion" msgstr "noniljoen" #: ../data/variables.xml.in.h:24 msgid "Sexdecillion" msgstr "Octiljard" #: ../data/variables.xml.in.h:25 msgid "-r:sexdecillion" msgstr "octiljard" #: ../data/variables.xml.in.h:26 msgid "Quindecillion" msgstr "Octiljoen" #: ../data/variables.xml.in.h:27 msgid "-r:quindecillion" msgstr "octiljoen" #: ../data/variables.xml.in.h:28 msgid "Quattuordecillion" msgstr "Septiljard" #: ../data/variables.xml.in.h:29 msgid "-r:quattuordecillion" msgstr "septiljard" #: ../data/variables.xml.in.h:30 msgid "Tredecillion" msgstr "Septiljoen" #: ../data/variables.xml.in.h:31 msgid "-r:tredecillion" msgstr "septiljoen" #: ../data/variables.xml.in.h:32 msgid "Duodecillion" msgstr "Sextiljard" #: ../data/variables.xml.in.h:33 msgid "-r:duodecillion" msgstr "sextiljard" #: ../data/variables.xml.in.h:34 msgid "Undecillion" msgstr "Sextiljoen" #: ../data/variables.xml.in.h:35 msgid "-r:undecillion" msgstr "sextiljoen" #: ../data/variables.xml.in.h:36 msgid "Decillion" msgstr "Quintiljard" #: ../data/variables.xml.in.h:37 msgid "-r:decillion" msgstr "quintiljard" #: ../data/variables.xml.in.h:38 msgid "Nonillion" msgstr "Quintiljoen" #: ../data/variables.xml.in.h:39 msgid "-r:nonillion" msgstr "quintiljoen" #: ../data/variables.xml.in.h:40 msgid "Octillion" msgstr "Quadriljard" #: ../data/variables.xml.in.h:41 msgid "-r:octillion" msgstr "quadriljard" #: ../data/variables.xml.in.h:42 msgid "Septillion" msgstr "Quadriljoen" #: ../data/variables.xml.in.h:43 msgid "-r:septillion" msgstr "quadriljoen" #: ../data/variables.xml.in.h:44 msgid "Sextillion" msgstr "Triljard" #: ../data/variables.xml.in.h:45 msgid "-r:sextillion" msgstr "triljard" #: ../data/variables.xml.in.h:46 msgid "Quintillion" msgstr "Triljoen" #: ../data/variables.xml.in.h:47 msgid "-r:quintillion" msgstr "triljoen" #: ../data/variables.xml.in.h:48 msgid "Quadrillion" msgstr "Biljard" #: ../data/variables.xml.in.h:49 msgid "-r:quadrillion" msgstr "biljard" #: ../data/variables.xml.in.h:50 msgid "Trillion" msgstr "Biljoen" #: ../data/variables.xml.in.h:51 msgid "-r:trillion" msgstr "biljoen" #: ../data/variables.xml.in.h:52 msgid "Billion" msgstr "Miljard" #: ../data/variables.xml.in.h:53 msgid "-r:billion" msgstr "miljard" #: ../data/variables.xml.in.h:54 msgid "Million" msgstr "Miljoen" #: ../data/variables.xml.in.h:55 msgid "-r:million" msgstr "miljoen" #: ../data/variables.xml.in.h:56 msgid "Thousand" msgstr "Duizend" #: ../data/variables.xml.in.h:57 msgid "-r:thousand" msgstr "duizend" #: ../data/variables.xml.in.h:58 msgid "Hundred" msgstr "Honderd" #: ../data/variables.xml.in.h:59 msgid "-r:hundred" msgstr "honderd" #: ../data/variables.xml.in.h:60 msgid "Physical Constants" msgstr "Natuurkundige constanten" #: ../data/variables.xml.in.h:61 msgid "Universal Constants" msgstr "Universele constanten" #: ../data/variables.xml.in.h:62 msgid "Speed of Light in Vacuum" msgstr "Lichtsnelheid in vacuüm" #: ../data/variables.xml.in.h:63 msgid "ar:c,speed_of_light" msgstr "a:c,licht_snelheid" #: ../data/variables.xml.in.h:64 msgid "Planck Time" msgstr "Plancktijd" #: ../data/variables.xml.in.h:65 msgid "r:planck_time,ais:t_P" msgstr "planck_tijd,ais:t_P" #: ../data/variables.xml.in.h:66 msgid "Planck Temperature" msgstr "Plancktemperatuur" #: ../data/variables.xml.in.h:67 msgid "r:planck_temperature,ais:T_P" msgstr "planck_temperatuur,ais:T_P" #: ../data/variables.xml.in.h:68 msgid "Planck Mass" msgstr "Planckmassa" #: ../data/variables.xml.in.h:69 msgid "r:planck_mass,ais:m_P" msgstr "planck_massa,ais:m_P" #: ../data/variables.xml.in.h:70 msgid "Planck Length" msgstr "Plancklengte" #: ../data/variables.xml.in.h:71 msgid "r:planck_length,ais:l_P" msgstr "planck_lengte,ais:l_P" #: ../data/variables.xml.in.h:72 msgid "Planck Constant" msgstr "Planck constante" #: ../data/variables.xml.in.h:73 #, fuzzy msgid "r:planck,au:ℎ" msgstr "gouden,φ" #: ../data/variables.xml.in.h:74 msgid "Planck Constant over 2 pi" msgstr "Planck constante gedeeld door 2 pi" #: ../data/variables.xml.in.h:75 msgid "r:planck2pi,au:ℏ" msgstr "" #: ../data/variables.xml.in.h:76 msgid "Newtonian Constant of Gravitation" msgstr "Newtons zwaartekrachtconstante" #: ../data/variables.xml.in.h:77 msgid "r:newtonian_constant,a:G" msgstr "newton_constante,a:G" #: ../data/variables.xml.in.h:78 msgid "Electric Constant (Permittivity of Free Space)" msgstr "Elektrische constante (permittiviteit vrije ruimte)" #: ../data/variables.xml.in.h:79 msgid "r:electric_constant,aisu:ε_0" msgstr "elektrische_constante,aisu:ε_0" #: ../data/variables.xml.in.h:80 msgid "Magnetic Constant (Permeability of Free Space)" msgstr "Magnetische constante (permeabiliteit vrije ruimte)" #: ../data/variables.xml.in.h:81 msgid "r:magnetic_constant,aisu:μ_0" msgstr "magnetische_constante,aisu:μ_0" #: ../data/variables.xml.in.h:82 msgid "Characteristic Impedance of Vacuum" msgstr "Karakteristieke impedantie vacuüm" #: ../data/variables.xml.in.h:83 msgid "r:characteristic_impedance,ais:Z_0" msgstr "karakteristieke_impedantie,ais:Z_0" #: ../data/variables.xml.in.h:84 msgid "Electromagnetic Constants" msgstr "Elektromagnetische constanten" #: ../data/variables.xml.in.h:85 msgid "Bohr Magneton" msgstr "" #: ../data/variables.xml.in.h:86 msgid "r:bohr_magneton,aisu:μ_B" msgstr "" #: ../data/variables.xml.in.h:87 msgid "Conductance Quantum" msgstr "Geleidingsvermogen kwantum" #: ../data/variables.xml.in.h:88 msgid "r:conductance_quantum,ais:G_0" msgstr "geleidings_kwantum,ais:G_0" #: ../data/variables.xml.in.h:89 msgid "Elementary Charge" msgstr "Elementaire lading" #: ../data/variables.xml.in.h:90 msgid "r:elementary_charge,ais:e_charge" msgstr "elementaire_lading,ais:e_lading" #: ../data/variables.xml.in.h:91 msgid "Josephson Constant" msgstr "Josephson constante" #: ../data/variables.xml.in.h:92 msgid "r:josephson,ais:K_J" msgstr "" #: ../data/variables.xml.in.h:93 msgid "Magnetic Flux Quantum" msgstr "Magnetische flux kwantum" #: ../data/variables.xml.in.h:94 msgid "r:magnetic_flux_quantum,aisu:Φ_0" msgstr "magnetische_flux_kwantum,aisu:Φ_0" #: ../data/variables.xml.in.h:95 msgid "Nuclear Magneton" msgstr "Nucleaire magneton" #: ../data/variables.xml.in.h:96 msgid "r:nuclear_magneton,aisu:μ_N" msgstr "nucleaire_magneton,aisu:μ_N" #: ../data/variables.xml.in.h:97 msgid "von Klitzing Constant" msgstr "von Klitzing constante" #: ../data/variables.xml.in.h:98 msgid "r:klitzing,ais:R_K" msgstr "" #: ../data/variables.xml.in.h:99 msgid "Atomic and Nuclear Constants" msgstr "Atomaire- en nucleaire constanten" #: ../data/variables.xml.in.h:100 msgid "Alpha Particle Mass" msgstr "Massa alfadeeltje" #: ../data/variables.xml.in.h:101 msgid "r:alpha_particle_mass,aisu:m_α" msgstr "alfa_deeltje_massa,aisu:m_α" #: ../data/variables.xml.in.h:102 msgid "Bohr Radius" msgstr "Bohr-straal" #: ../data/variables.xml.in.h:103 #, fuzzy msgid "r:bohr_radius,ais:a_0" msgstr "eerste_straling,ais:c_1" #: ../data/variables.xml.in.h:104 msgid "Classical Electron Radius" msgstr "Klassieke straal elektron" #: ../data/variables.xml.in.h:105 msgid "r:classical_electron_radius,ais:r_e" msgstr "klassieke_electron_radius,ais:r_e" #: ../data/variables.xml.in.h:106 msgid "Compton Wavelength" msgstr "Compton golflengte" #: ../data/variables.xml.in.h:107 msgid "r:compton_wavelength,aisu:λ_C" msgstr "compton_golflengte,aisu:λ_C" #: ../data/variables.xml.in.h:108 msgid "Electron Mass" msgstr "Elektronmassa" #: ../data/variables.xml.in.h:109 msgid "r:electron_mass,ais:m_e" msgstr "elektron_massa,ais:m_e" #: ../data/variables.xml.in.h:110 msgid "Helion Mass" msgstr "Helionmassa" #: ../data/variables.xml.in.h:111 msgid "r:helion_mass,ais:m_h" msgstr "helion_massa,ais:m_h" #: ../data/variables.xml.in.h:112 msgid "Neutron Mass" msgstr "Neutronmassa" #: ../data/variables.xml.in.h:113 msgid "r:neutron_mass,ais:m_n" msgstr "neutron_massa,ais:m_n" #: ../data/variables.xml.in.h:114 msgid "Proton Mass" msgstr "Protonmassa" #: ../data/variables.xml.in.h:115 msgid "r:proton_mass,ais:m_p" msgstr "proton_massa,ais:m_p" #: ../data/variables.xml.in.h:116 msgid "Rydberg Constant" msgstr "Rydberg constante" #: ../data/variables.xml.in.h:117 msgid "r:rydberg,aisu:R_∞" msgstr "" #: ../data/variables.xml.in.h:118 msgid "Tau Mass" msgstr "Tau massa" #: ../data/variables.xml.in.h:119 msgid "r:tau_mass,aisu:m_τ" msgstr "tau_massa,aisu:m_τ" #: ../data/variables.xml.in.h:120 msgid "Physico-Chemical Constants" msgstr "Fysisch-chemische constanten" #: ../data/variables.xml.in.h:121 msgid "Atomic Mass Constant" msgstr "Atomaire massaconstante" #: ../data/variables.xml.in.h:122 msgid "r:atomic_mass,ais:m_u" msgstr "atoommassa,ais:m_u" #: ../data/variables.xml.in.h:123 msgid "Avogadro Constant" msgstr "Avogadro's constante" #: ../data/variables.xml.in.h:124 msgid "r:avogadro,ais:N_A" msgstr "" #: ../data/variables.xml.in.h:125 msgid "Boltzmann Constant" msgstr "Constante van Boltzmann" #: ../data/variables.xml.in.h:126 #, fuzzy msgid "r:boltzmann,ais:k_B" msgstr "proton_massa,ais:m_p" #: ../data/variables.xml.in.h:127 msgid "Faraday Constant" msgstr "Faraday constante" #: ../data/variables.xml.in.h:128 msgid "r:faraday" msgstr "" #: ../data/variables.xml.in.h:129 msgid "First Radiation Constant" msgstr "Eerste stralingsconstante" #: ../data/variables.xml.in.h:130 msgid "r:first_radiation,ais:c_1" msgstr "eerste_straling,ais:c_1" #: ../data/variables.xml.in.h:131 msgid "Ideal Gas Constant" msgstr "Ideale gasconstante" #: ../data/variables.xml.in.h:132 msgid "r:ideal_gas" msgstr "ideale_gas" #: ../data/variables.xml.in.h:133 msgid "Second Radiation Constant" msgstr "Tweede stralingsconstante" #: ../data/variables.xml.in.h:134 msgid "r:second_radiation,ais:c_2" msgstr "tweede_straling,aisc_2" #: ../data/variables.xml.in.h:135 msgid "Basic Constants" msgstr "Basisconstanten" #: ../data/variables.xml.in.h:136 msgid "Golden Ratio" msgstr "Gulden snede" #: ../data/variables.xml.in.h:137 msgid "r:golden,au:φ" msgstr "gouden,φ" #: ../data/variables.xml.in.h:138 msgid "Omega Constant" msgstr "Omega constante" #: ../data/variables.xml.in.h:139 msgid "r:omega" msgstr "" #: ../data/variables.xml.in.h:140 msgid "Pythagoras' Constant (sqrt 2)" msgstr "Pythagoras constante (sqrt 2)" #: ../data/variables.xml.in.h:141 msgid "r:pythagoras" msgstr "" #: ../data/variables.xml.in.h:142 msgid "Apery's Constant" msgstr "Apery's constante" #: ../data/variables.xml.in.h:143 msgid "r:apery" msgstr "" #: ../data/variables.xml.in.h:144 msgid "Base of Natural Logarithms (e)" msgstr "Grondtal natuurlijke logaritmen (e)" #: ../data/variables.xml.in.h:145 msgid "r:e" msgstr "" #: ../data/variables.xml.in.h:146 msgid "Archimedes' Constant (pi)" msgstr "Archimede's constante (pi)" #: ../data/variables.xml.in.h:147 msgid "au:π,r:pi" msgstr "" #: ../data/variables.xml.in.h:148 msgid "Euler's Constant" msgstr "Euler's constante" #: ../data/variables.xml.in.h:149 msgid "au:γ,r:euler" msgstr "" #: ../data/variables.xml.in.h:150 msgid "Catalan's Constant" msgstr "Catalan's constante" #: ../data/variables.xml.in.h:151 msgid "r:catalan" msgstr "" #: ../data/variables.xml.in.h:152 msgid "Special Numbers" msgstr "Bijzondere getallen" #: ../data/variables.xml.in.h:153 msgid "Imaginary i (sqrt -1)" msgstr "Imaginaire i (sqrt -1)" #: ../data/variables.xml.in.h:154 msgid "r:i" msgstr "." #: ../data/variables.xml.in.h:155 msgid "Infinity" msgstr "Oneindig" #: ../data/variables.xml.in.h:156 msgid "a:∞,r:infinity" msgstr "a:∞,oneindig" #: ../data/variables.xml.in.h:157 msgid "Positive Infinity" msgstr "Positief oneindig" #: ../data/variables.xml.in.h:158 msgid "r:plus_infinity" msgstr "plus_oneindig" #: ../data/variables.xml.in.h:159 msgid "Negative Infinity" msgstr "Negatief oneindig" #: ../data/variables.xml.in.h:160 msgid "r:minus_infinity" msgstr "min_oneindig" #: ../data/variables.xml.in.h:161 msgid "Undefined" msgstr "Ongedefinieerd" #: ../data/variables.xml.in.h:162 msgid "r:undefined" msgstr "ongedefinieerd" #: ../data/variables.xml.in.h:163 msgid "False" msgstr "Onwaar" #: ../data/variables.xml.in.h:164 msgid "r:false,r:no" msgstr "onwaar,nee" #: ../data/variables.xml.in.h:165 msgid "True" msgstr "Waar" #: ../data/variables.xml.in.h:166 msgid "r:true,r:yes" msgstr "waar,ja" #: ../data/variables.xml.in.h:167 msgid "Unknowns" msgstr "Onbekenden" #: ../data/variables.xml.in.h:168 msgid "r:x" msgstr "" #: ../data/variables.xml.in.h:169 msgid "r:y" msgstr "" #: ../data/variables.xml.in.h:170 msgid "r:z" msgstr "" #~ msgid "Ionization Potential" #~ msgstr "Ionisatiepotentiaal" #~ msgid "r:ionization" #~ msgstr "ionisatie" #~ msgid "Covalent Radius" #~ msgstr "Covalente straal" #~ msgid "r:covalent" #~ msgstr "covalent" #~ msgid "Ununbium" #~ msgstr "Ununbium" #~ msgid "Ununquadium" #~ msgstr "Ununquadium" #~ msgid "Ununhexium" #~ msgstr "Ununhexium" #, fuzzy #~ msgid "Value 1 (n)" #~ msgstr "Waarde 1 (i)" #~ msgid "Price per $100 face value of a security bond" #~ msgstr "Prijs per €100 nominale waarde van een obligatie" #~ msgid "Derive" #~ msgstr "Afleiden" libqalculate-0.9.10/po-defs/fr.po0000644000175000017500000050476312727774611013525 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: 2016-06-14 14:33+0200\n" "PO-Revision-Date: 2006-12-06 15:54-0500\n" "Last-Translator: Nicolas Laug \n" "Language-Team: Français \n" "Language: \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 "Currency" msgstr "Monnaie" #: ../data/currencies.xml.in.h:2 msgid "European Euros" msgstr "Euros européens" #: ../data/currencies.xml.in.h:3 msgid "ar:EUR,au:€,euro,p:euros" msgstr "" #: ../data/currencies.xml.in.h:4 msgid "U.S. Dollars" msgstr "Dollar US" #: ../data/currencies.xml.in.h:5 msgid "a:$,ar:USD,dollar,p:dollars" msgstr "" #: ../data/currencies.xml.in.h:6 msgid "Japanese Yen" msgstr "Yen japonais" #: ../data/currencies.xml.in.h:7 msgid "ar:JPY,au:¥,yen" msgstr "" #: ../data/currencies.xml.in.h:8 msgid "Danish Kroner" msgstr "Couronne danoise" #: ../data/currencies.xml.in.h:9 msgid "ar:DKK" msgstr "" #: ../data/currencies.xml.in.h:10 msgid "British Pounds" msgstr "Livre sterling" #: ../data/currencies.xml.in.h:11 msgid "ar:GBP,au:£" msgstr "" #: ../data/currencies.xml.in.h:12 msgid "Thai Baht" msgstr "Baht thailandais" #: ../data/currencies.xml.in.h:13 msgid "ar:THB" msgstr "" #: ../data/currencies.xml.in.h:14 msgid "Swedish Krona" msgstr "Couronne suédoise" #: ../data/currencies.xml.in.h:15 msgid "ar:SEK" msgstr "" #: ../data/currencies.xml.in.h:16 msgid "Swiss Francs" msgstr "Franc suisse" #: ../data/currencies.xml.in.h:17 msgid "ar:CHF" msgstr "" #: ../data/currencies.xml.in.h:18 msgid "Icelandic Krona" msgstr "Couronne islandaise" #: ../data/currencies.xml.in.h:19 msgid "ar:ISK" msgstr "" #: ../data/currencies.xml.in.h:20 msgid "Norwegian Kroner" msgstr "Couronne norvégienne" #: ../data/currencies.xml.in.h:21 msgid "ar:NOK" msgstr "" #: ../data/currencies.xml.in.h:22 msgid "Bulgarian Lev" msgstr "Lev bulgare" #: ../data/currencies.xml.in.h:23 msgid "lev,ar:BGN" msgstr "" #: ../data/currencies.xml.in.h:24 msgid "Russian Ruble" msgstr "Rouble russe" #: ../data/currencies.xml.in.h:25 msgid "ar:RUB,au:₽,ruble" msgstr "ar:RUB,au:₽,rouble" #: ../data/currencies.xml.in.h:26 msgid "Philippine Peso" msgstr "Peso philippin" #: ../data/currencies.xml.in.h:27 msgid "ar:PHP,au:₱" msgstr "" #: ../data/currencies.xml.in.h:28 msgid "Malaysian Ringgit" msgstr "Ringgit malaisien" #: ../data/currencies.xml.in.h:29 msgid "ar:MYR" msgstr "" #: ../data/currencies.xml.in.h:30 msgid "Croatian Kuna" msgstr "Kuna croate" #: ../data/currencies.xml.in.h:31 msgid "ar:HRK" msgstr "" #: ../data/currencies.xml.in.h:32 msgid "Yuan Renminbi (PR China)" msgstr "Yuan renminbi (rep. pop. de Chine)" #: ../data/currencies.xml.in.h:33 msgid "ar:CNY" msgstr "" #: ../data/currencies.xml.in.h:34 msgid "Indonesian Rupiah" msgstr "Rouple indonésienne" #: ../data/currencies.xml.in.h:35 msgid "ar:IDR,rupiah" msgstr "" #: ../data/currencies.xml.in.h:36 msgid "Czech Koruna" msgstr "Koruna tchèque" #: ../data/currencies.xml.in.h:37 msgid "ar:CZK" msgstr "" #: ../data/currencies.xml.in.h:38 msgid "Hungarian Forint" msgstr "Florin hongrois" #: ../data/currencies.xml.in.h:39 msgid "forint,ar:HUF" msgstr "florint hongrois,ar:HUF" #: ../data/currencies.xml.in.h:40 msgid "Polish Zloty" msgstr "Zloty polonais" #: ../data/currencies.xml.in.h:41 msgid "zloty,ar:PLN" msgstr "" #: ../data/currencies.xml.in.h:42 msgid "Romanian New Leu" msgstr "Nouveau Leu roumain" #: ../data/currencies.xml.in.h:43 msgid "leu,ar:RON" msgstr "" #: ../data/currencies.xml.in.h:44 msgid "Turkish New Lira" msgstr "Nouvelle livre turque" #: ../data/currencies.xml.in.h:45 msgid "ar:TRY,au:₺" msgstr "" #: ../data/currencies.xml.in.h:46 msgid "Australian Dollars" msgstr "Dollar australien" #: ../data/currencies.xml.in.h:47 msgid "ar:AUD" msgstr "" #: ../data/currencies.xml.in.h:48 msgid "Canadian Dollars" msgstr "Dollar canadien" #: ../data/currencies.xml.in.h:49 msgid "ar:CAD" msgstr "" #: ../data/currencies.xml.in.h:50 msgid "Hong Kong Dollars" msgstr "Dollar de Hong Kong" #: ../data/currencies.xml.in.h:51 msgid "ar:HKD" msgstr "" #: ../data/currencies.xml.in.h:52 msgid "New Zealand Dollars" msgstr "Dollars néo-zélandais" #: ../data/currencies.xml.in.h:53 msgid "ar:NZD" msgstr "" #: ../data/currencies.xml.in.h:54 msgid "Singapore Dollars" msgstr "Dollar de Singapour" #: ../data/currencies.xml.in.h:55 msgid "ar:SGD" msgstr "" #: ../data/currencies.xml.in.h:56 msgid "South Korean Won" msgstr "Won sud corréenne" #: ../data/currencies.xml.in.h:57 msgid "ar:KRW,au:₩,won" msgstr "" #: ../data/currencies.xml.in.h:58 msgid "South African Rand" msgstr "Rand sudafricaine" #: ../data/currencies.xml.in.h:59 msgid "ar:ZAR" msgstr "" #: ../data/currencies.xml.in.h:60 msgid "Indian Rupee" msgstr "" #: ../data/currencies.xml.in.h:61 msgid "ar:INR,au:₹,rupee" msgstr "" #: ../data/currencies.xml.in.h:62 msgid "Israeli New Sheqel" msgstr "" #: ../data/currencies.xml.in.h:63 msgid "ar:ILS,au:₪,sheqel" msgstr "" #: ../data/currencies.xml.in.h:64 msgid "Mexican Peso" msgstr "" #: ../data/currencies.xml.in.h:65 msgid "ar:MXN" msgstr "" #: ../data/currencies.xml.in.h:66 msgid "Brazilian Real" msgstr "" #: ../data/currencies.xml.in.h:67 msgid "ar:BRL" msgstr "" #: ../data/currencies.xml.in.h:68 msgid "Euro Cent" msgstr "centime d'Euro" #: ../data/currencies.xml.in.h:69 msgid "r:eurocent,p:eurocents" msgstr "" #: ../data/currencies.xml.in.h:70 msgid "Cent (USD)" msgstr "" #: ../data/currencies.xml.in.h:71 msgid "au:¢,r:cent,p:cents" msgstr "" #: ../data/currencies.xml.in.h:72 msgid "Belgian Franc" msgstr "Franc belge" #: ../data/currencies.xml.in.h:73 msgid "ar:BEF" msgstr "" #: ../data/currencies.xml.in.h:74 msgid "Greek Drachma" msgstr "Drachme grecque" #: ../data/currencies.xml.in.h:75 msgid "ar:GRD,au:₯,drachma" msgstr "" #: ../data/currencies.xml.in.h:76 msgid "French Franc" msgstr "Franc français" #: ../data/currencies.xml.in.h:77 msgid "ar:FRF,au:₣,franc" msgstr "" #: ../data/currencies.xml.in.h:78 msgid "Italian Lira" msgstr "Lire italienne" #: ../data/currencies.xml.in.h:79 msgid "ar:ITL,au:₤,lira" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:80 msgid "Dutch Guilder" msgstr "Florin néerlandais" #: ../data/currencies.xml.in.h:81 msgid "ar:NLG,guilder" msgstr "ar:NLG,florin" #: ../data/currencies.xml.in.h:82 msgid "Portuguese Escudo" msgstr "Escudo portugais" #: ../data/currencies.xml.in.h:83 msgid "ar:PTE,escudo" msgstr "" #: ../data/currencies.xml.in.h:84 msgid "Deutsche Mark" msgstr "" #: ../data/currencies.xml.in.h:85 msgid "ar:DEM,mark" msgstr "" #: ../data/currencies.xml.in.h:86 msgid "Spanish Peseta" msgstr "Peseta espagnole" #: ../data/currencies.xml.in.h:87 msgid "ar:ESP,au:₧,peseta,p:pesetas" msgstr "" #: ../data/currencies.xml.in.h:88 msgid "Irish Pound" msgstr "Livre irlandaise" #: ../data/currencies.xml.in.h:89 msgid "ar:IEP" msgstr "" #: ../data/currencies.xml.in.h:90 msgid "Luxembourg Franc" msgstr "Franc luxembourgeois" #: ../data/currencies.xml.in.h:91 msgid "ar:LUF" msgstr "" #: ../data/currencies.xml.in.h:92 msgid "Austrian Schilling" msgstr "Shilling autrichien" #: ../data/currencies.xml.in.h:93 msgid "ar:ATS,schilling" msgstr "" #: ../data/currencies.xml.in.h:94 msgid "Finnish Markka" msgstr "Markka finnois" #: ../data/currencies.xml.in.h:95 msgid "ar:FIM,markka" msgstr "" #: ../data/currencies.xml.in.h:96 msgid "Slovenian Tolar" msgstr "Tolar slovène" #: ../data/currencies.xml.in.h:97 msgid "ar:SIT,tolar" msgstr "" #: ../data/currencies.xml.in.h:98 msgid "Cypriot Pound" msgstr "Livre chypriote" #: ../data/currencies.xml.in.h:99 msgid "ar:CYP" msgstr "" #: ../data/currencies.xml.in.h:100 msgid "Estonian Kroon" msgstr "Kroon estonienne" #: ../data/currencies.xml.in.h:101 msgid "ar:EEK,kroon,p:krooni" msgstr "" #: ../data/currencies.xml.in.h:102 msgid "Slovak Koruna" msgstr "Couronne slovaque" #: ../data/currencies.xml.in.h:103 msgid "ar:SKK" msgstr "" #: ../data/currencies.xml.in.h:104 msgid "Maltese Lira" msgstr "Lire maltaise" #: ../data/currencies.xml.in.h:105 msgid "ar:MTL" msgstr "" #: ../data/currencies.xml.in.h:106 msgid "Latvian Lats" msgstr "Lats letton" #: ../data/currencies.xml.in.h:107 msgid "lats,ar:LVL" msgstr "" #: ../data/currencies.xml.in.h:108 msgid "Lithuanian Litas" msgstr "Litas lituanien" #: ../data/currencies.xml.in.h:109 msgid "litas,ar:LTL" msgstr "" #: ../data/datasets.xml.in.h:1 msgid "Data Sets" msgstr "Ensembles de Données" #. Data set for chemical elements #: ../data/datasets.xml.in.h:3 msgid "!datasets!Elements" msgstr "" #: ../data/datasets.xml.in.h:4 msgid "r:atom" msgstr "r:atome" #. Object argument for chemical elements data set #: ../data/datasets.xml.in.h:6 msgid "!datasets!Element" msgstr "" #: ../data/datasets.xml.in.h:7 msgid "Symbol" msgstr "Symbole" #: ../data/datasets.xml.in.h:8 msgid "r:symbol" msgstr "r:symbole" #. Chemical elements number #: ../data/datasets.xml.in.h:10 msgid "!datasets!Number" msgstr "Nombre" #. Chemical elements number #: ../data/datasets.xml.in.h:12 msgid "!datasets!r:number" msgstr "r:nombre" #: ../data/datasets.xml.in.h:13 ../data/functions.xml.in.h:574 msgid "Name" msgstr "Nom" #: ../data/datasets.xml.in.h:14 msgid "r:name" msgstr "r:nom" #: ../data/datasets.xml.in.h:15 msgid "Classification" msgstr "" #: ../data/datasets.xml.in.h:16 #, fuzzy 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 Polyatomic Non-Metal 9 Diatomic Non-" "Metal 10 Noble Gas 11 Unknown chemical properties" msgstr "" "Un nombre qui représente un groupe d'éléments: 1 Métal Alcalin 2 " "Métal Alcalino-Terreux 3 Lanthanide 4 Actinide 5 Métal de " "transition 6 Métal 7 Métalloïde 8 Non-métal 9 " "Halogène 10 Gaz Noble 11 Transactinide" #: ../data/datasets.xml.in.h:17 msgid "r:class" msgstr "r:classe" #: ../data/datasets.xml.in.h:18 ../data/functions.xml.in.h:352 msgid "Weight" msgstr "Poids" #: ../data/datasets.xml.in.h:19 msgid "r:weight,mass" msgstr "r:poids,masse" #: ../data/datasets.xml.in.h:20 msgid "Boiling Point" msgstr "" #: ../data/datasets.xml.in.h:21 msgid "r:boiling" msgstr "" #: ../data/datasets.xml.in.h:22 msgid "Melting Point" msgstr "" #: ../data/datasets.xml.in.h:23 msgid "r:melting" msgstr "" #: ../data/datasets.xml.in.h:24 ../data/units.xml.in.h:119 msgid "Density" msgstr "Densité" #: ../data/datasets.xml.in.h:25 #, fuzzy msgid "Density at 295K" msgstr "Densité" #: ../data/datasets.xml.in.h:26 msgid "r:density" msgstr "r:densité" #: ../data/datasets.xml.in.h:27 msgid "X Position" msgstr "Position en X" #: ../data/datasets.xml.in.h:28 msgid "r:x_pos" msgstr "" #: ../data/datasets.xml.in.h:29 msgid "Y Position" msgstr "Position en Y" #: ../data/datasets.xml.in.h:30 msgid "r:y_pos" msgstr "" #: ../data/datasets.xml.in.h:31 msgid "Planets" msgstr "Planètes" #: ../data/datasets.xml.in.h:32 msgid "r:planet" msgstr "r:planète" #: ../data/datasets.xml.in.h:33 msgid "Planet" msgstr "Planète" #: ../data/datasets.xml.in.h:34 msgid "Orbital Period (Year)" msgstr "Période Orbitale (Année)" #. Orbital period for planet #: ../data/datasets.xml.in.h:36 msgid "!datasets!r:year" msgstr "r:année" #: ../data/datasets.xml.in.h:37 msgid "Average Orbital Speed" msgstr "Vitesse Orbitale Moyenne" #: ../data/datasets.xml.in.h:38 msgid "r:speed" msgstr "r:vitesse" #: ../data/datasets.xml.in.h:39 msgid "Eccentricity" msgstr "Excentricité" #: ../data/datasets.xml.in.h:40 msgid "r:eccentricity" msgstr "r:excentricité" #: ../data/datasets.xml.in.h:41 msgid "Inclination" msgstr "Inclinaison" #: ../data/datasets.xml.in.h:42 msgid "r:inclination" msgstr "r:inclinaison" #: ../data/datasets.xml.in.h:43 msgid "Number of Satellites" msgstr "Nombre de Satellites" #: ../data/datasets.xml.in.h:44 msgid "r:satellites" msgstr "" #. Planet mass #: ../data/datasets.xml.in.h:46 msgid "!datasets!Mass" msgstr "Masse" #: ../data/datasets.xml.in.h:47 msgid "r:mass" msgstr "r:masse" #: ../data/datasets.xml.in.h:48 msgid "Mean Density" msgstr "Densité Moyenne" #: ../data/datasets.xml.in.h:49 msgid "Surface Area" msgstr "Aire" #. Surface area of planet #: ../data/datasets.xml.in.h:51 msgid "!datasets!r:area" msgstr "r:aire" #: ../data/datasets.xml.in.h:52 msgid "Equatorial Gravity" msgstr "Gravité Équatoriale" #: ../data/datasets.xml.in.h:53 msgid "r:gravity" msgstr "r:gravité" #: ../data/datasets.xml.in.h:54 msgid "Mean Surface Temperature" msgstr "Température Moyenne de Surface" #: ../data/datasets.xml.in.h:55 msgid "r:temperature" msgstr "r:température" #: ../data/elements.xml.in.h:1 msgid "Hydrogen" msgstr "Hydrogène" #: ../data/elements.xml.in.h:2 msgid "Helium" msgstr "Hélium" #: ../data/elements.xml.in.h:3 msgid "Lithium" msgstr "" #: ../data/elements.xml.in.h:4 msgid "Beryllium" msgstr "Béryllium" #: ../data/elements.xml.in.h:5 msgid "Boron" msgstr "Bore" #: ../data/elements.xml.in.h:6 msgid "Carbon" msgstr "Carbone" #: ../data/elements.xml.in.h:7 msgid "Nitrogen" msgstr "Azote" #: ../data/elements.xml.in.h:8 msgid "Oxygen" msgstr "Oxygène" #: ../data/elements.xml.in.h:9 msgid "Fluorine" msgstr "Fluor" #: ../data/elements.xml.in.h:10 msgid "Neon" msgstr "Néon" #: ../data/elements.xml.in.h:11 msgid "Sodium" msgstr "" #: ../data/elements.xml.in.h:12 msgid "Magnesium" msgstr "Magnésium" #: ../data/elements.xml.in.h:13 msgid "Aluminum" msgstr "" #: ../data/elements.xml.in.h:14 msgid "Silicon" msgstr "Silicium" #: ../data/elements.xml.in.h:15 msgid "Phosphorus" msgstr "Phosphore" #: ../data/elements.xml.in.h:16 msgid "Sulfur" msgstr "Soufre" #: ../data/elements.xml.in.h:17 msgid "Chlorine" msgstr "Chlore" #: ../data/elements.xml.in.h:18 msgid "Argon" msgstr "" #: ../data/elements.xml.in.h:19 msgid "Potassium" msgstr "" #: ../data/elements.xml.in.h:20 msgid "Calcium" msgstr "" #: ../data/elements.xml.in.h:21 msgid "Scandium" msgstr "" #: ../data/elements.xml.in.h:22 msgid "Titanium" msgstr "Titane" #: ../data/elements.xml.in.h:23 msgid "Vanadium" msgstr "" #: ../data/elements.xml.in.h:24 msgid "Chromium" msgstr "Chrome" #: ../data/elements.xml.in.h:25 msgid "Manganese" msgstr "Manganèse" #: ../data/elements.xml.in.h:26 msgid "Iron" msgstr "Fer" #: ../data/elements.xml.in.h:27 msgid "Cobalt" msgstr "" #: ../data/elements.xml.in.h:28 msgid "Nickel" msgstr "" #: ../data/elements.xml.in.h:29 msgid "Copper" msgstr "Cuivre" #: ../data/elements.xml.in.h:30 msgid "Zinc" msgstr "" #: ../data/elements.xml.in.h:31 msgid "Gallium" msgstr "" #: ../data/elements.xml.in.h:32 msgid "Germanium" msgstr "" #: ../data/elements.xml.in.h:33 msgid "Arsenic" msgstr "" #: ../data/elements.xml.in.h:34 msgid "Selenium" msgstr "Sélénium" #: ../data/elements.xml.in.h:35 msgid "Bromine" msgstr "Brome" #: ../data/elements.xml.in.h:36 msgid "Krypton" msgstr "" #: ../data/elements.xml.in.h:37 msgid "Rubidium" msgstr "" #: ../data/elements.xml.in.h:38 msgid "Strontium" msgstr "" #: ../data/elements.xml.in.h:39 msgid "Yttrium" msgstr "" #: ../data/elements.xml.in.h:40 msgid "Zirconium" msgstr "" #: ../data/elements.xml.in.h:41 msgid "Niobium" msgstr "" #: ../data/elements.xml.in.h:42 msgid "Molybdenum" msgstr "Molybdène" #: ../data/elements.xml.in.h:43 msgid "Technetium" msgstr "Technétium" #: ../data/elements.xml.in.h:44 msgid "Ruthenium" msgstr "" #: ../data/elements.xml.in.h:45 msgid "Rhodium" msgstr "" #: ../data/elements.xml.in.h:46 msgid "Palladium" msgstr "" #: ../data/elements.xml.in.h:47 msgid "Silver" msgstr "Argent" #: ../data/elements.xml.in.h:48 msgid "Cadmium" msgstr "" #: ../data/elements.xml.in.h:49 msgid "Indium" msgstr "" #: ../data/elements.xml.in.h:50 msgid "Tin" msgstr "Étain" #: ../data/elements.xml.in.h:51 msgid "Antimony" msgstr "Antimoine" #: ../data/elements.xml.in.h:52 msgid "Tellurium" msgstr "Tellure" #: ../data/elements.xml.in.h:53 msgid "Iodine" msgstr "Iode" #: ../data/elements.xml.in.h:54 msgid "Xenon" msgstr "Xénon" #: ../data/elements.xml.in.h:55 msgid "Cesium" msgstr "Césium" #: ../data/elements.xml.in.h:56 msgid "Barium" msgstr "Baryum" #: ../data/elements.xml.in.h:57 msgid "Lanthanum" msgstr "Lanthane" #: ../data/elements.xml.in.h:58 msgid "Cerium" msgstr "Cérium" #: ../data/elements.xml.in.h:59 msgid "Praseodymium" msgstr "Praséodyme" #: ../data/elements.xml.in.h:60 msgid "Neodymium" msgstr "Néodyme" #: ../data/elements.xml.in.h:61 msgid "Promethium" msgstr "Prométhium" #: ../data/elements.xml.in.h:62 msgid "Samarium" msgstr "" #: ../data/elements.xml.in.h:63 msgid "Europium" msgstr "" #: ../data/elements.xml.in.h:64 msgid "Gadolinium" msgstr "" #: ../data/elements.xml.in.h:65 msgid "Terbium" msgstr "" #: ../data/elements.xml.in.h:66 msgid "Dysprosium" msgstr "" #: ../data/elements.xml.in.h:67 msgid "Holmium" msgstr "" #: ../data/elements.xml.in.h:68 msgid "Erbium" msgstr "" #: ../data/elements.xml.in.h:69 msgid "Thulium" msgstr "" #: ../data/elements.xml.in.h:70 msgid "Ytterbium" msgstr "" #: ../data/elements.xml.in.h:71 msgid "Lutetium" msgstr "" #: ../data/elements.xml.in.h:72 msgid "Hafnium" msgstr "" #: ../data/elements.xml.in.h:73 msgid "Tantalum" msgstr "Tantale" #: ../data/elements.xml.in.h:74 msgid "Tungsten" msgstr "Tungstène" #: ../data/elements.xml.in.h:75 msgid "Rhenium" msgstr "Rhénium" #: ../data/elements.xml.in.h:76 msgid "Osmium" msgstr "" #: ../data/elements.xml.in.h:77 msgid "Iridium" msgstr "" #: ../data/elements.xml.in.h:78 msgid "Platinum" msgstr "Platine" #: ../data/elements.xml.in.h:79 msgid "Gold" msgstr "Or" #. Chemical element #: ../data/elements.xml.in.h:81 msgid "!elements!Mercury" msgstr "Mercure" #: ../data/elements.xml.in.h:82 msgid "Thallium" msgstr "" #: ../data/elements.xml.in.h:83 msgid "Lead" msgstr "Plomb" #: ../data/elements.xml.in.h:84 msgid "Bismuth" msgstr "" #: ../data/elements.xml.in.h:85 msgid "Polonium" msgstr "" #: ../data/elements.xml.in.h:86 msgid "Astatine" msgstr "Astate" #: ../data/elements.xml.in.h:87 msgid "Radon" msgstr "" #: ../data/elements.xml.in.h:88 msgid "Francium" msgstr "" #: ../data/elements.xml.in.h:89 msgid "Radium" msgstr "" #: ../data/elements.xml.in.h:90 msgid "Actinium" msgstr "" #: ../data/elements.xml.in.h:91 msgid "Thorium" msgstr "" #: ../data/elements.xml.in.h:92 msgid "Protactinium" msgstr "" #: ../data/elements.xml.in.h:93 msgid "Uranium" msgstr "" #: ../data/elements.xml.in.h:94 msgid "Neptunium" msgstr "" #: ../data/elements.xml.in.h:95 msgid "Plutonium" msgstr "" #: ../data/elements.xml.in.h:96 msgid "Americium" msgstr "" #: ../data/elements.xml.in.h:97 msgid "Curium" msgstr "" #: ../data/elements.xml.in.h:98 msgid "Berkelium" msgstr "Berkélium" #: ../data/elements.xml.in.h:99 msgid "Californium" msgstr "" #: ../data/elements.xml.in.h:100 msgid "Einsteinium" msgstr "" #: ../data/elements.xml.in.h:101 msgid "Fermium" msgstr "" #: ../data/elements.xml.in.h:102 msgid "Mendelevium" msgstr "" #: ../data/elements.xml.in.h:103 msgid "Nobelium" msgstr "" #: ../data/elements.xml.in.h:104 msgid "Lawrencium" msgstr "" #: ../data/elements.xml.in.h:105 msgid "Rutherfordium" msgstr "" #: ../data/elements.xml.in.h:106 msgid "Dubnium" msgstr "" #: ../data/elements.xml.in.h:107 msgid "Seaborgium" msgstr "" #: ../data/elements.xml.in.h:108 msgid "Bohrium" msgstr "" #: ../data/elements.xml.in.h:109 msgid "Hassium" msgstr "" #: ../data/elements.xml.in.h:110 msgid "Meitnerium" msgstr "" #: ../data/elements.xml.in.h:111 msgid "Darmstadtium" msgstr "" #: ../data/elements.xml.in.h:112 msgid "Roentgenium" msgstr "" #: ../data/elements.xml.in.h:113 msgid "Copernicium" msgstr "" #: ../data/elements.xml.in.h:114 msgid "Ununtrium" msgstr "" #: ../data/elements.xml.in.h:115 msgid "Flerovium" msgstr "" #: ../data/elements.xml.in.h:116 msgid "Ununpentium" msgstr "" #: ../data/elements.xml.in.h:117 msgid "Livermorium" msgstr "" #: ../data/elements.xml.in.h:118 msgid "Ununseptium" msgstr "" #: ../data/elements.xml.in.h:119 msgid "Ununoctium" msgstr "" #: ../data/functions.xml.in.h:1 msgid "Matrices & Vectors" msgstr "Matrices & Vecteurs" #: ../data/functions.xml.in.h:2 msgid "Construct Vector" msgstr "Construire un Vecteur" #: ../data/functions.xml.in.h:3 msgid "r:vector" msgstr "" #: ../data/functions.xml.in.h:4 msgid "Returns a vector with listed elements." msgstr "Retourne un vecteur avec les éléments listés." #. Vector/matrix elements #: ../data/functions.xml.in.h:6 msgid "Elements" msgstr "Éléments" #: ../data/functions.xml.in.h:7 msgid "Generate Vector" msgstr "Générer un vecteur" #: ../data/functions.xml.in.h:8 msgid "r:genvector" msgstr "" #: ../data/functions.xml.in.h:9 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 "" "Retourne un vecteur généré par une fonction à une variable (par défaut : x) " "parcourant des valeurs entre min et max. Le quatrième argument est soit le " "nombre d'éléments voulus si le sixième argument est faux (par défaut) ou le " "pas entre chaque valeur de la variable." #: ../data/functions.xml.in.h:10 msgid "Function" msgstr "Fonction" #: ../data/functions.xml.in.h:11 msgid "Min" msgstr "" #: ../data/functions.xml.in.h:12 msgid "Max" msgstr "" #: ../data/functions.xml.in.h:13 msgid "Dimension / Step size" msgstr "Dimension / Taille du pas" #: ../data/functions.xml.in.h:14 msgid "Variable" msgstr "" #: ../data/functions.xml.in.h:15 msgid "Use step size" msgstr "Utiliser le pas" #: ../data/functions.xml.in.h:16 msgid "Sort" msgstr "Trier" #: ../data/functions.xml.in.h:17 msgid "r:sort" msgstr "" #: ../data/functions.xml.in.h:18 msgid "Returns a sorted vector. ex. sort([6, 1, 4])=[1, 4, 6]" msgstr "Retourne un vecteur trié ex. sort([6, 1, 4])=[1, 4, 6]" #: ../data/functions.xml.in.h:19 msgid "Vector" msgstr "Vecteur" #: ../data/functions.xml.in.h:20 msgid "Ascending" msgstr "Ascendant" #: ../data/functions.xml.in.h:21 msgid "Rank" msgstr "" #: ../data/functions.xml.in.h:22 msgid "r:rank" msgstr "" #: ../data/functions.xml.in.h:23 msgid "" "Returns a vector with values of elements replaced with their mutual ranks." " ex. rank([6, 1, 4]) = [3, 1, 2]" msgstr "" "Retourne un vecteur dont les valeurs de éléments ont été remplacées par leur " "rang respectif. ex. rank([6, 1, 4]) = [3, 1, 2]" #: ../data/functions.xml.in.h:24 msgid "Vector Limits" msgstr "Limites de Vecteur" #: ../data/functions.xml.in.h:25 msgid "r:limits" msgstr "limites" #: ../data/functions.xml.in.h:26 msgid "Returns a part of a vector between two positions." msgstr "Retourne une partie de vecteur entre deux positions." #: ../data/functions.xml.in.h:27 msgid "Lower limit" msgstr "Limite inférieure" #: ../data/functions.xml.in.h:28 msgid "Upper limit" msgstr "Limite Supérieure" #: ../data/functions.xml.in.h:29 msgid "Dimension" msgstr "" #: ../data/functions.xml.in.h:30 msgid "r:dimension" msgstr "" #: ../data/functions.xml.in.h:31 msgid "Returns the number of elements in a vector." msgstr "Retourne le nombre d'éléments dans un vecteur." #: ../data/functions.xml.in.h:32 msgid "Merge Vectors" msgstr "Regrouper les Vecteurs" #: ../data/functions.xml.in.h:33 msgid "r:mergevectors" msgstr "regrouper_vecteurs" #: ../data/functions.xml.in.h:34 msgid "Returns a vector with the elements from two vectors." msgstr "Retourne un vecteur avec les éléments de deux vecteurs." #: ../data/functions.xml.in.h:35 msgid "Vector 1" msgstr "Vecteur 1" #: ../data/functions.xml.in.h:36 msgid "Vector 2" msgstr "Vecteur 2" #: ../data/functions.xml.in.h:37 msgid "Construct Matrix" msgstr "Construire une Matrice" #: ../data/functions.xml.in.h:38 msgid "r:matrix" msgstr "matrice" #: ../data/functions.xml.in.h:39 msgid "" "Returns a matrix with specified dimensions and listed elements. Omitted " "elements are set to zero." msgstr "" "Retourne une matrice avec les dimensions spécifiées et les éléments listés. " "Les éléments omis sont fixés à zéro." #: ../data/functions.xml.in.h:40 msgid "Rows" msgstr "Lignes" #: ../data/functions.xml.in.h:41 msgid "Columns" msgstr "Colonnes" #: ../data/functions.xml.in.h:42 msgid "Convert Matrix to Vector" msgstr "Convertir une matrice en vecteur" #: ../data/functions.xml.in.h:43 msgid "r:matrix2vector" msgstr "matrice_vers_vecteur" #: ../data/functions.xml.in.h:44 msgid "Puts each element of a matrix in vertical order in a vector." msgstr "" "Met chaque élément d'une matrice dans un vecteur en la parcourant " "verticalement." #: ../data/functions.xml.in.h:45 msgid "Matrix" msgstr "Matrice" #: ../data/functions.xml.in.h:46 msgid "Matrix Area" msgstr "" #. Matrix area #: ../data/functions.xml.in.h:48 msgid "r:area" msgstr "" #: ../data/functions.xml.in.h:49 msgid "Returns a part of a matrix." msgstr "Retourne une partie de matrice." #: ../data/functions.xml.in.h:50 msgid "Start row" msgstr "Ligne de départ" #: ../data/functions.xml.in.h:51 msgid "Start column" msgstr "Colonne de départ" #: ../data/functions.xml.in.h:52 msgid "End row" msgstr "Terminer la ligne" #: ../data/functions.xml.in.h:53 msgid "End column" msgstr "Terminer la colonne" #: ../data/functions.xml.in.h:54 msgid "r:rows" msgstr "" #: ../data/functions.xml.in.h:55 msgid "Returns the number of rows in a matrix." msgstr "Retourne le nombre de lignes d'une matrice." #: ../data/functions.xml.in.h:56 msgid "r:columns" msgstr "colonnes" #: ../data/functions.xml.in.h:57 msgid "Returns the number of columns in a matrix." msgstr "Retourne le nombre de colonnes dans une matrice." #: ../data/functions.xml.in.h:58 msgid "Extract row as vector" msgstr "Extraire une ligne comme vecteur" #: ../data/functions.xml.in.h:59 msgid "r:row" msgstr "" #: ../data/functions.xml.in.h:60 msgid "Returns a row in a matrix as a vector." msgstr "Retourne une ligne dans une matrice sous forme de vecteur." #: ../data/functions.xml.in.h:61 msgid "Row" msgstr "Ligne" #: ../data/functions.xml.in.h:62 msgid "Extract Column as Vector" msgstr "Extraire une Colonne comme Vecteur" #: ../data/functions.xml.in.h:63 msgid "r:column" msgstr "colonne" #: ../data/functions.xml.in.h:64 msgid "Returns a column in a matrix as a vector." msgstr "Retourne une colonne de matrice comme vecteur." #: ../data/functions.xml.in.h:65 msgid "Column" msgstr "Colonne" #: ../data/functions.xml.in.h:66 msgid "r:elements" msgstr "éléments" #: ../data/functions.xml.in.h:67 msgid "Returns the number of elements in a matrix or vector." msgstr "Retourne le nombre d'éléments dans une matrice ou un vecteur." #: ../data/functions.xml.in.h:68 msgid "Matrix or vector" msgstr "Matrice ou vecteur" #. Vector/matrix element #: ../data/functions.xml.in.h:70 msgid "Element" msgstr "Élément" #: ../data/functions.xml.in.h:71 msgid "r:element" msgstr "élément" #: ../data/functions.xml.in.h:72 msgid "" "Returns the element at specified position in a matrix (row and column) or " "vector (index)." msgstr "" "Retourne l'élément de matrice à la position spécifiée (ligne et colonne) ou " "vecteur (index)." #: ../data/functions.xml.in.h:73 msgid "Matrix/vector" msgstr "Matrice/Vecteur" #: ../data/functions.xml.in.h:74 msgid "Row/index" msgstr "Ligne/indice" #: ../data/functions.xml.in.h:75 msgid "Transpose" msgstr "Transposée" #: ../data/functions.xml.in.h:76 msgid "r:transpose" msgstr "" #: ../data/functions.xml.in.h:77 msgid "Returns the transpose of a matrix." msgstr "Retourne la transposée d'une matrice." #: ../data/functions.xml.in.h:78 msgid "Identity" msgstr "Identité" #: ../data/functions.xml.in.h:79 msgid "r:identity" msgstr "identité" #: ../data/functions.xml.in.h:80 msgid "" "Returns the identity matrix of a matrix or with specified number of rows/" "columns." msgstr "" "Retourne la matrice identité ou une matrice avec le nombre indiqué de lignes/" "colonnes." #: ../data/functions.xml.in.h:81 msgid "Matrix or rows/columns" msgstr "Matrice ou lignes/colonnes" #: ../data/functions.xml.in.h:82 msgid "Determinant" msgstr "Déterminant" #: ../data/functions.xml.in.h:83 msgid "r:det" msgstr "" #: ../data/functions.xml.in.h:84 msgid "Calculates the determinant of a matrix." msgstr "Calcule le déterminant d'une matrice." #: ../data/functions.xml.in.h:85 msgid "Permanent" msgstr "" #: ../data/functions.xml.in.h:86 msgid "r:permanent" msgstr "" #: ../data/functions.xml.in.h:87 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 "" "Calcule le permanent d'une matrice. Le permanent diffère du déterminant dans " "le fait que tous les signes dans le développement en mineurs sont pris " "positifs." #: ../data/functions.xml.in.h:88 msgid "Adjugate (Adjoint)" msgstr "Comatrice" #: ../data/functions.xml.in.h:89 msgid "r:adj" msgstr "" #: ../data/functions.xml.in.h:90 msgid "Calculates the adjugate or adjoint of a matrix." msgstr "Calcule la comatrice de la matrice" #: ../data/functions.xml.in.h:91 msgid "Cofactor" msgstr "Cofacteur" #: ../data/functions.xml.in.h:92 msgid "r:cofactor" msgstr "cofacteur" #: ../data/functions.xml.in.h:93 msgid "Calculates the cofactor of the element at specified position." msgstr "Calcule le cofacteur à la position désignée." #: ../data/functions.xml.in.h:94 msgid "Matrix Inverse" msgstr "Inverse de Matrice" #: ../data/functions.xml.in.h:95 msgid "r:inverse" msgstr "" #: ../data/functions.xml.in.h:96 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 "" "Calcule l'inverse d'une matrice. L'inverse est la matrice qui multipliée à " "la matrice originale est égale à la matrice identité (AB = BA = I)." #: ../data/functions.xml.in.h:97 msgid "Load CSV File" msgstr "Charger un Fichier CSV" #: ../data/functions.xml.in.h:98 msgid "r:load" msgstr "" #: ../data/functions.xml.in.h:99 msgid "Returns a matrix imported from a CSV data file." msgstr "Retourne une matrice importée d'un fichier de données CSV." #: ../data/functions.xml.in.h:100 msgid "Filename" msgstr "Nom de fichier" #: ../data/functions.xml.in.h:101 msgid "First data row" msgstr "Première ligne de données" #: ../data/functions.xml.in.h:102 msgid "Separator" msgstr "Séparateur" #: ../data/functions.xml.in.h:103 msgid "Export To CSV File" msgstr "Exporter dans un ficher CSV" #: ../data/functions.xml.in.h:104 msgid "r:export" msgstr "" #: ../data/functions.xml.in.h:105 msgid "Exports a matrix to a CSV data file." msgstr "Exporte une matrice dans un fichier de données CSV." #: ../data/functions.xml.in.h:106 msgid "Norm (length)" msgstr "Norme (longueur)" #: ../data/functions.xml.in.h:107 msgid "r:norm" msgstr "" #: ../data/functions.xml.in.h:108 msgid "Calculates the norm/length of a vector." msgstr "Calcule la norme d'un vecteur." #: ../data/functions.xml.in.h:109 msgid "Cross Product" msgstr "" #: ../data/functions.xml.in.h:110 msgid "r:cross" msgstr "" #: ../data/functions.xml.in.h:111 msgid "Calculates the cross product of two 3-dimensional vectors." msgstr "" #: ../data/functions.xml.in.h:112 msgid "Combinatorics" msgstr "Combinatoire" #: ../data/functions.xml.in.h:113 msgid "Factorial" msgstr "Factorielle" #: ../data/functions.xml.in.h:114 msgid "" "Calculates the factorial of an integer. Multiplies 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 "" "Calcule la factorielle d'un entier. Multiplie l'argument avec tous les " "entiers positifs plus petits : n(n-1)(n-2)...2*1. Peut aussi être entré " "comme un nombre suivi d'un point d'exclamation. p. ex. factorial(5) " "= 5! = 5 * 4 * 3 * 2 * 1 = 120" #: ../data/functions.xml.in.h:115 msgid "r:factorial" msgstr "factorielle" #: ../data/functions.xml.in.h:116 msgid "Value" msgstr "Valeur" #: ../data/functions.xml.in.h:117 msgid "Double Factorial" msgstr "Factorielle double" #: ../data/functions.xml.in.h:118 msgid "r:factorial2" msgstr "factorielle2" #: ../data/functions.xml.in.h:119 msgid "" "Calculates the double factorial of an integer. Multiplies 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 "" "Calcule la double factorielle d'un entier. Multiplie l'argument avec tous " "les deuxièmes entiers positifs plus petits : n(n-2)(n-4)... Peut aussi être " "entré comme un nombre suivi de deux points d'exclamation. p. ex. " "factorial2(5) = 5!! = 5 * 3 * 1 = 15" #: ../data/functions.xml.in.h:120 msgid "Multifactorial" msgstr "Multifactorielle" #: ../data/functions.xml.in.h:121 msgid "r:multifactorial" msgstr "multifactorielle" #: ../data/functions.xml.in.h:122 msgid "" "Calculates the multifactorial of an integer. Multiplies 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 "" "Calcule la multifactorielle d'un entier. Multiplie l'argument avec tous les " "entiers positifs plus petits placés tous les x (n(n-x)(n-2x)...). Peut aussi " "être entré comme un nombre suivi de trois points d'exclamation ou plus. " " p. ex. multifactorial(18, 4) = 18!!!! = 18 * 14 * 10 * 6 * 2 = 30 240" #: ../data/functions.xml.in.h:123 msgid "Binomial Coefficient" msgstr "Coefficient binomial" #: ../data/functions.xml.in.h:124 msgid "r:binomial" msgstr "" #: ../data/functions.xml.in.h:125 msgid "Exponent" msgstr "Exposant" #: ../data/functions.xml.in.h:126 msgid "Index" msgstr "" #: ../data/functions.xml.in.h:127 msgid "Hyperfactorial" msgstr "Hyperfactorielle" #: ../data/functions.xml.in.h:128 msgid "r:hyperfactorial" msgstr "hyperfactorielle" #: ../data/functions.xml.in.h:129 msgid "" "Calculates the hyperfactorial of an integer. Multiplies 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 "" "Calcule l'hyperfactorielle d'un entier. Multiplie l'argument élevé à lui-" "même avec tous les entiers positifs plus petits élevés à eux-mêmes (1^1 * " "2^2 ... n^n). p. ex. hyperfactorial(3) = (3^3) * (2^2) * (1^1) = " "108" #: ../data/functions.xml.in.h:130 msgid "Superfactorial" msgstr "Superfactorielle" #: ../data/functions.xml.in.h:131 msgid "r:superfactorial" msgstr "" #: ../data/functions.xml.in.h:132 msgid "" "Calculates the superfactorial of an integer. Multiplies 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 "" "Calcule la superfactorielle d'un entier. Multiplie la factorielle de " "l'argument avec la factorielle de tous les entiers positifs plus petits (1! " "* 2! ... n!). ex. superfactorielle(5) = 5! * 4! * 3! * 2! * 1! = " "34 560" #: ../data/functions.xml.in.h:133 msgid "Permutations (Variations)" msgstr "" #: ../data/functions.xml.in.h:134 msgid "r:perm,variations" msgstr "" #: ../data/functions.xml.in.h:135 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 "" "Retourne le nombre d'arrangements possibles d'une liste ordonnée avec un " "nombre d'objets à choisir et une taille de liste. Si il y a trois objets (1, " "2 et 3) qui sont mis dans une liste à deux positions, les alternatives sont " "[1, 2], [2, 1], [1, 3], [3, 1], [2, 3] et [3, 2], et le nombre de " "permutations est donc 6." #: ../data/functions.xml.in.h:136 msgid "Objects" msgstr "Objets" #: ../data/functions.xml.in.h:137 msgid "Size" msgstr "Taille" #: ../data/functions.xml.in.h:138 msgid "Combinations" msgstr "Combinaisons" #: ../data/functions.xml.in.h:139 msgid "r:comb" msgstr "" #: ../data/functions.xml.in.h:140 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 "" "Retourne le nombre d'arrangements possibles d'une liste non ordonnée avec un " "nombre d'objets à choisir et une taille de liste. S'il y a trois objets (1,2 " "et 3) qui sont mis dans une liste à deux positions, les alternatives sont " "[1, 2], [1, 3], et [2, 3], et le nombre de combinaisons est donc 3." #: ../data/functions.xml.in.h:141 msgid "Derangements" msgstr "Arrangements" #: ../data/functions.xml.in.h:142 msgid "r:derangements" msgstr "" #: ../data/functions.xml.in.h:143 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 "" "Retourne le nombre de réarrangements possibles d'une liste non ordonnée, " "d'une certaine taille, où aucun des objets n'est à sa position initiale. Si " "la liste de départ est [1, 2, 3], les réarrangements possibles sont [2, 3, " "1] et [3, 1, 2]; le nombre de réarrangements est donc 2." #: ../data/functions.xml.in.h:144 msgid "Number of elements" msgstr "Nombre d'éléments" #: ../data/functions.xml.in.h:145 msgid "Number Theory" msgstr "Théorie des Nombres" #: ../data/functions.xml.in.h:146 msgid "Absolute Value" msgstr "Valeur absolue" #: ../data/functions.xml.in.h:147 msgid "r:abs" msgstr "" #: ../data/functions.xml.in.h:148 msgid "Arithmetics" msgstr "Arithmétique" #: ../data/functions.xml.in.h:149 msgid "Signum" msgstr "" #: ../data/functions.xml.in.h:150 msgid "r:sgn" msgstr "" #. A numerical value #: ../data/functions.xml.in.h:152 msgid "Number" msgstr "Nombre" #: ../data/functions.xml.in.h:153 msgid "Numerator" msgstr "Numérateur" #: ../data/functions.xml.in.h:154 msgid "r:numerator" msgstr "numérateur" #: ../data/functions.xml.in.h:155 msgid "Denominator" msgstr "Dénominateur" #: ../data/functions.xml.in.h:156 msgid "r:denominator" msgstr "dénominateur" #: ../data/functions.xml.in.h:157 msgid "Remainder" msgstr "Reste" #: ../data/functions.xml.in.h:158 msgid "r:rem" msgstr "" #: ../data/functions.xml.in.h:159 msgid "Modulus" msgstr "Coefficient" #: ../data/functions.xml.in.h:160 msgid "r:mod" msgstr "" #: ../data/functions.xml.in.h:161 msgid "Negate" msgstr "Opposé" #: ../data/functions.xml.in.h:162 msgid "r:neg" msgstr "" #: ../data/functions.xml.in.h:163 msgid "Reciprocal" msgstr "Réciproque" #: ../data/functions.xml.in.h:164 msgid "r:inv" msgstr "" #: ../data/functions.xml.in.h:165 msgid "Multiply" msgstr "Multiplier" #: ../data/functions.xml.in.h:166 msgid "r:multiply" msgstr "multiplier" #: ../data/functions.xml.in.h:167 msgid "Factors" msgstr "Facteurs" #: ../data/functions.xml.in.h:168 msgid "Add" msgstr "Ajouter" #: ../data/functions.xml.in.h:169 msgid "r:add" msgstr "" #: ../data/functions.xml.in.h:170 msgid "Terms" msgstr "Termes" #: ../data/functions.xml.in.h:171 msgid "Subtract" msgstr "" #: ../data/functions.xml.in.h:172 msgid "r:subtract" msgstr "" #: ../data/functions.xml.in.h:173 msgid "Divide" msgstr "Diviser" #: ../data/functions.xml.in.h:174 msgid "r:divide" msgstr "divise" #: ../data/functions.xml.in.h:175 msgid "Raise" msgstr "Élever" #: ../data/functions.xml.in.h:176 msgid "r:raise" msgstr "" #: ../data/functions.xml.in.h:177 msgid "Base" msgstr "" #: ../data/functions.xml.in.h:178 msgid "Polynomials" msgstr "Polynômes" #: ../data/functions.xml.in.h:179 msgid "Coefficient" msgstr "" #: ../data/functions.xml.in.h:180 msgid "r:coeff" msgstr "" #: ../data/functions.xml.in.h:181 msgid "Polynomial" msgstr "Polynôme" #: ../data/functions.xml.in.h:182 msgid "Leading Coefficient" msgstr "Coefficient dominant" #: ../data/functions.xml.in.h:183 msgid "r:lcoeff" msgstr "" #: ../data/functions.xml.in.h:184 msgid "Trailing Coefficient" msgstr "" #: ../data/functions.xml.in.h:185 msgid "r:tcoeff" msgstr "" #: ../data/functions.xml.in.h:186 msgid "Polynomial Degree" msgstr "Degré du Polynôme" #: ../data/functions.xml.in.h:187 msgid "r:degree" msgstr "degré" #: ../data/functions.xml.in.h:188 msgid "Lowest Degree (Valuation)" msgstr "Plus Petit Degré (Estimation)" #: ../data/functions.xml.in.h:189 msgid "r:ldegree" msgstr "" #: ../data/functions.xml.in.h:190 msgid "Content Part" msgstr "Part du Montant" #: ../data/functions.xml.in.h:191 msgid "r:pcontent" msgstr "" #: ../data/functions.xml.in.h:192 msgid "Primitive Part" msgstr "" #: ../data/functions.xml.in.h:193 msgid "r:primpart" msgstr "" #: ../data/functions.xml.in.h:194 msgid "Unit Part" msgstr "" #: ../data/functions.xml.in.h:195 msgid "r:punit" msgstr "" #: ../data/functions.xml.in.h:196 msgid "Greatest Common Divisor" msgstr "Plus Grand Diviseur Commun" #: ../data/functions.xml.in.h:197 msgid "r:gcd" msgstr "pgcd" #: ../data/functions.xml.in.h:198 msgid "1st value" msgstr "1ère valeur" #: ../data/functions.xml.in.h:199 msgid "2nd value" msgstr "2e valeur" #: ../data/functions.xml.in.h:200 msgid "Least Common Multiple" msgstr "Plus Petit Facteur Commun" #: ../data/functions.xml.in.h:201 msgid "r:lcm" msgstr "" #: ../data/functions.xml.in.h:202 msgid "Rounding" msgstr "Arrondi" #: ../data/functions.xml.in.h:203 msgid "Round" msgstr "Arrondi" #: ../data/functions.xml.in.h:204 msgid "r:round" msgstr "" #: ../data/functions.xml.in.h:205 msgid "Round Downwards" msgstr "Arrondi à la Valeur Inférieure" #: ../data/functions.xml.in.h:206 msgid "r:floor" msgstr "plancher" #: ../data/functions.xml.in.h:207 msgid "Round Upwards" msgstr "Arrondi à la Valeur Supérieure" #: ../data/functions.xml.in.h:208 msgid "r:ceil" msgstr "plafond" #: ../data/functions.xml.in.h:209 msgid "Round Towards Zero" msgstr "" #: ../data/functions.xml.in.h:210 msgid "r:trunc" msgstr "" #: ../data/functions.xml.in.h:211 msgid "Extract Integer Part" msgstr "Extraire la Partie Entière" #: ../data/functions.xml.in.h:212 msgid "r:int" msgstr "" #: ../data/functions.xml.in.h:213 msgid "Extract Fractional Part" msgstr "Extraire la Partie Fractionnaire" #: ../data/functions.xml.in.h:214 msgid "r:frac" msgstr "" #: ../data/functions.xml.in.h:215 msgid "Number Bases" msgstr "Bases Numériques" #: ../data/functions.xml.in.h:216 msgid "Number Base" msgstr "Base Numérique" #: ../data/functions.xml.in.h:217 msgid "r:base" msgstr "" #: ../data/functions.xml.in.h:218 msgid "Returns an integer from a number of specified base between 2 and 36" msgstr "" "Retourne un entier à partir d'un nombre dans une base spécifiée entre 2 et 36" #: ../data/functions.xml.in.h:219 msgid "Binary" msgstr "Binaire" #: ../data/functions.xml.in.h:220 msgid "r:bin" msgstr "" #: ../data/functions.xml.in.h:221 msgid "Returns an integer from a binary number" msgstr "Retourne un entier à partir d'un nombre binaire" #: ../data/functions.xml.in.h:222 msgid "Binary number" msgstr "Nombre binaire" #: ../data/functions.xml.in.h:223 msgid "Octal" msgstr "" #: ../data/functions.xml.in.h:224 msgid "r:oct" msgstr "" #: ../data/functions.xml.in.h:225 msgid "Returns an integer from an octal number" msgstr "Retourne un entier à partir d'un nombre octal" #: ../data/functions.xml.in.h:226 msgid "Octal number" msgstr "Nombre octal" #: ../data/functions.xml.in.h:227 msgid "Hexadecimal" msgstr "Hexadécimal" #: ../data/functions.xml.in.h:228 msgid "r:hex" msgstr "" #: ../data/functions.xml.in.h:229 msgid "Returns a value from a hexadecimal number" msgstr "Retourne une valeur à partir d'un nombre hexadécimal" #: ../data/functions.xml.in.h:230 msgid "Hexadecimal number" msgstr "Nombre hexadécimal" #: ../data/functions.xml.in.h:231 msgid "Integers" msgstr "Entiers" #: ../data/functions.xml.in.h:232 msgid "Even" msgstr "Pair" #: ../data/functions.xml.in.h:233 msgid "r:even" msgstr "pair" #: ../data/functions.xml.in.h:234 msgid "Odd" msgstr "Impair" #: ../data/functions.xml.in.h:235 msgid "r:odd" msgstr "impair" #: ../data/functions.xml.in.h:236 msgid "Step Functions" msgstr "" #: ../data/functions.xml.in.h:237 msgid "Heaviside Step Function" msgstr "" #: ../data/functions.xml.in.h:238 msgid "r:heaviside" msgstr "" #: ../data/functions.xml.in.h:239 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:240 msgid "Ramp Function" msgstr "" #: ../data/functions.xml.in.h:241 msgid "r:ramp" msgstr "" #: ../data/functions.xml.in.h:242 msgid "Rectangular Function" msgstr "" #: ../data/functions.xml.in.h:243 msgid "r:rectangular" msgstr "" #: ../data/functions.xml.in.h:244 msgid "Sigmoid Function" msgstr "" #: ../data/functions.xml.in.h:245 msgid "r:sigmoid" msgstr "" #: ../data/functions.xml.in.h:246 msgid "Logit Transformation" msgstr "" #: ../data/functions.xml.in.h:247 msgid "r:logit" msgstr "" #: ../data/functions.xml.in.h:248 msgid "Triangular Function" msgstr "" #: ../data/functions.xml.in.h:249 msgid "r:triangular" msgstr "" #: ../data/functions.xml.in.h:250 msgid "Analysis" msgstr "Analyse" #: ../data/functions.xml.in.h:251 msgid "Real Part" msgstr "Partie Réelle" #: ../data/functions.xml.in.h:252 msgid "r:re" msgstr "" #: ../data/functions.xml.in.h:253 msgid "Complex number" msgstr "Nombre complexe" #: ../data/functions.xml.in.h:254 msgid "Imaginary Part" msgstr "Partie Imaginaire" #: ../data/functions.xml.in.h:255 msgid "r:im" msgstr "" #: ../data/functions.xml.in.h:256 msgid "Gamma Function" msgstr "Fonction Gamma" #: ../data/functions.xml.in.h:257 msgid "r:gamma" msgstr "" #: ../data/functions.xml.in.h:258 msgid "Beta Function" msgstr "Fonction bêta" #: ../data/functions.xml.in.h:259 msgid "r:beta" msgstr "" #: ../data/functions.xml.in.h:260 msgid "Exponents & Logarithms" msgstr "Exponentielles et logarithmes" #: ../data/functions.xml.in.h:261 msgid "Square Root" msgstr "Racine Carrée" #: ../data/functions.xml.in.h:262 msgid "au:√,r:sqrt" msgstr "" #: ../data/functions.xml.in.h:263 msgid "Square" msgstr "Carré" #: ../data/functions.xml.in.h:264 msgid "r:sq" msgstr "" #: ../data/functions.xml.in.h:265 msgid "Exponential (e^x)" msgstr "Exponentielle (e^x)" #: ../data/functions.xml.in.h:266 msgid "r:exp" msgstr "" #: ../data/functions.xml.in.h:267 msgid "Natural Logarithm" msgstr "Logarithme Naturel (népérien)" #: ../data/functions.xml.in.h:268 msgid "r:ln" msgstr "" #: ../data/functions.xml.in.h:269 msgid "Base-N Logarithm" msgstr "Logarithme en base N" #: ../data/functions.xml.in.h:270 msgid "r:log" msgstr "" #: ../data/functions.xml.in.h:271 msgid "Lambert W Function (Omega Function, Product Log)" msgstr "" #: ../data/functions.xml.in.h:272 msgid "r:lambertw,productlog" msgstr "" #: ../data/functions.xml.in.h:273 msgid "Returns the inverse function for mx*e^x as ln() does for e^x." msgstr "" #: ../data/functions.xml.in.h:274 msgid "Base-2 Logarithm" msgstr "Logarithme en base 2" #: ../data/functions.xml.in.h:275 msgid "rs:log2" msgstr "" #: ../data/functions.xml.in.h:276 msgid "Returns the base n logarithm." msgstr "Retourne le logarithme en base n." #: ../data/functions.xml.in.h:277 msgid "Base-10 Logarithm" msgstr "Logarithme en base 10" #: ../data/functions.xml.in.h:278 msgid "rs:log10" msgstr "" #: ../data/functions.xml.in.h:279 msgid "Complex Exponential (Cis)" msgstr "Exponentielle Complexe" #: ../data/functions.xml.in.h:280 msgid "r:cis" msgstr "" #: ../data/functions.xml.in.h:281 msgid "2 raised the to power X" msgstr "2 élevé à la puissance X" #: ../data/functions.xml.in.h:282 msgid "rs:exp2" msgstr "" #: ../data/functions.xml.in.h:283 msgid "10 raised the to power X" msgstr "10 élevé à la puissance X" #: ../data/functions.xml.in.h:284 msgid "rs:exp10" msgstr "" #: ../data/functions.xml.in.h:285 msgid "Cube Root" msgstr "Racine Cubique" #: ../data/functions.xml.in.h:286 msgid "au:∛,r:cbrt" msgstr "" #: ../data/functions.xml.in.h:287 msgid "Nth root" msgstr "Racine n-ième" #: ../data/functions.xml.in.h:288 msgid "r:root" msgstr "" #: ../data/functions.xml.in.h:289 msgid "X raised to the power Y" msgstr "X élevé à la puissance Y" #: ../data/functions.xml.in.h:290 msgid "r:pow" msgstr "" #: ../data/functions.xml.in.h:291 msgid "Square root (x * pi)" msgstr "Racine carrée (x * pi)" #: ../data/functions.xml.in.h:292 msgid "r:sqrtpi" msgstr "" #: ../data/functions.xml.in.h:293 msgid "Returns the non-negative square root of x * pi" msgstr "Retourne la racine carrée de x * pi" #: ../data/functions.xml.in.h:294 msgid "Non-negative value" msgstr "Valeur strictement positive" #: ../data/functions.xml.in.h:295 msgid "Trigonometry" msgstr "Trigonométrie" #: ../data/functions.xml.in.h:296 msgid "Sine" msgstr "Sinus" #: ../data/functions.xml.in.h:297 msgid "r:sin" msgstr "" #: ../data/functions.xml.in.h:298 msgid "Angle" msgstr "" #: ../data/functions.xml.in.h:299 msgid "Cosine" msgstr "Cosinus" #: ../data/functions.xml.in.h:300 msgid "r:cos" msgstr "" #: ../data/functions.xml.in.h:301 msgid "Tangent" msgstr "Tangente" #: ../data/functions.xml.in.h:302 msgid "r:tan" msgstr "" #: ../data/functions.xml.in.h:303 msgid "Inverse Sine" msgstr "Arcsinus" #: ../data/functions.xml.in.h:304 msgid "r:asin" msgstr "arcsin" #: ../data/functions.xml.in.h:305 msgid "Inverse Cosine" msgstr "Arccosinus" #: ../data/functions.xml.in.h:306 msgid "r:acos" msgstr "arccos" #: ../data/functions.xml.in.h:307 msgid "Inverse Tangent" msgstr "Arctangente" #: ../data/functions.xml.in.h:308 msgid "r:atan" msgstr "arctan" #: ../data/functions.xml.in.h:309 msgid "Hyperbolic Sine" msgstr "Sinus Hyperbolique" #: ../data/functions.xml.in.h:310 msgid "r:sinh" msgstr "" #: ../data/functions.xml.in.h:311 msgid "Hyperbolic Cosine" msgstr "Cosinus Hyperbolique" #: ../data/functions.xml.in.h:312 msgid "r:cosh" msgstr "" #: ../data/functions.xml.in.h:313 msgid "Hyperbolic Tangent" msgstr "Tangente Hyperbolique" #: ../data/functions.xml.in.h:314 msgid "r:tanh" msgstr "" #: ../data/functions.xml.in.h:315 msgid "Inverse Hyperbolic Sine" msgstr "Argsinus Hyperbolique" #: ../data/functions.xml.in.h:316 msgid "r:asinh" msgstr "argsh" #: ../data/functions.xml.in.h:317 msgid "Inverse Hyperbolic Cosine" msgstr "Argcosinus Hyperbolique" #: ../data/functions.xml.in.h:318 msgid "r:acosh" msgstr "argcosh" #: ../data/functions.xml.in.h:319 msgid "Inverse Hyperbolic Tangent" msgstr "Argtangente Hyperbolique" #: ../data/functions.xml.in.h:320 msgid "r:atanh" msgstr "argth" #: ../data/functions.xml.in.h:321 msgid "Radians to Default Angle Unit" msgstr "Radians en Unité d'Angle par Défaut" #: ../data/functions.xml.in.h:322 msgid "r:radtodef" msgstr "" #: ../data/functions.xml.in.h:323 msgid "Radians" msgstr "" #: ../data/functions.xml.in.h:324 msgid "Secant" msgstr "" #: ../data/functions.xml.in.h:325 msgid "r:sec" msgstr "" #: ../data/functions.xml.in.h:326 msgid "Cosecant" msgstr "Cosécante" #: ../data/functions.xml.in.h:327 msgid "r:csc" msgstr "" #: ../data/functions.xml.in.h:328 msgid "Cotangent" msgstr "Cotangente" #: ../data/functions.xml.in.h:329 msgid "r:cot" msgstr "" #: ../data/functions.xml.in.h:330 msgid "Hyperbolic Secant" msgstr "Sécante hyperbolique" #: ../data/functions.xml.in.h:331 msgid "r:sech" msgstr "" #: ../data/functions.xml.in.h:332 msgid "Hyperbolic Cosecant" msgstr "Cosécante hyperbolique" #: ../data/functions.xml.in.h:333 msgid "r:csch" msgstr "" #: ../data/functions.xml.in.h:334 msgid "Hyperbolic Cotangent" msgstr "Cotangente Hyperbolique" #: ../data/functions.xml.in.h:335 msgid "r:coth" msgstr "" #: ../data/functions.xml.in.h:336 msgid "Inverse Secant" msgstr "Arcsécante" #: ../data/functions.xml.in.h:337 msgid "r:asec" msgstr "" #: ../data/functions.xml.in.h:338 msgid "Inverse Cosecant" msgstr "Arccosécante" #: ../data/functions.xml.in.h:339 msgid "r:acsc" msgstr "" #: ../data/functions.xml.in.h:340 msgid "Inverse Cotangent" msgstr "Arccotangente" #: ../data/functions.xml.in.h:341 msgid "r:acot" msgstr "" #: ../data/functions.xml.in.h:342 msgid "Inverse Hyperbolic Secant" msgstr "Argsécante Hyperbolique" #: ../data/functions.xml.in.h:343 msgid "r:asech" msgstr "" #: ../data/functions.xml.in.h:344 msgid "Inverse Hyperbolic Cosecant" msgstr "Argcosécante Hyperbolique" #: ../data/functions.xml.in.h:345 msgid "r:acsch" msgstr "" #: ../data/functions.xml.in.h:346 msgid "Inverse Hyperbolic Cotangent" msgstr "Argcotangente Hyperbolique" #: ../data/functions.xml.in.h:347 msgid "r:acoth" msgstr "" #: ../data/functions.xml.in.h:348 msgid "Miscellaneous" msgstr "Divers" #: ../data/functions.xml.in.h:349 msgid "Body Mass Index (BMI)" msgstr "Indice de masse corporelle (IMC)" #: ../data/functions.xml.in.h:350 msgid "-r:bmi" msgstr "imc" #: ../data/functions.xml.in.h:351 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 "" "Calcule l'Indice de Masse Corporelle. L'IMC est parfois interprété de la " "façon suivante (bien qu'il varie selon l'âge, le sexe, etc.) : " "Maigreur < 18.5 Corpulence normale 18.5-25 " "Surpoids 25-30 Obésité > 30 Notez que vous " "devez utiliser des unités pour la masse (p. ex. 59kg) et la taille (p. ex. " "174cm)." #: ../data/functions.xml.in.h:353 msgid "Length" msgstr "Longueur" #: ../data/functions.xml.in.h:354 msgid "Riemann Zeta" msgstr "" #: ../data/functions.xml.in.h:355 msgid "r:zeta" msgstr "" #: ../data/functions.xml.in.h:356 msgid "Integral point" msgstr "Point intégral" #: ../data/functions.xml.in.h:357 msgid "Roman Number" msgstr "Nombre Romain" #: ../data/functions.xml.in.h:358 msgid "r:roman" msgstr "" #: ../data/functions.xml.in.h:359 msgid "Returns the value of a roman number." msgstr "" #: ../data/functions.xml.in.h:360 msgid "Roman number" msgstr "Nombre romain" #: ../data/functions.xml.in.h:361 msgid "Kronecker Delta" msgstr "" #: ../data/functions.xml.in.h:362 msgid "r:kronecker" msgstr "" #: ../data/functions.xml.in.h:363 msgid "Returns 0 if i != j and 1 if i = j." msgstr "" #: ../data/functions.xml.in.h:364 msgid "Value 1 (i)" msgstr "Valeur 1 (i)" #: ../data/functions.xml.in.h:365 msgid "Value 2 (j)" msgstr "Valeur 2 (j)" #: ../data/functions.xml.in.h:366 msgid "Fibonacci Number" msgstr "" #: ../data/functions.xml.in.h:367 msgid "r:fibonacci" msgstr "" #: ../data/functions.xml.in.h:368 msgid "Returns the n-th term of the Fibonacci sequence." msgstr "" #: ../data/functions.xml.in.h:369 msgid "Index (n)" msgstr "" #: ../data/functions.xml.in.h:370 msgid "Statistics" msgstr "Statistique" #: ../data/functions.xml.in.h:371 msgid "Descriptive Statistics" msgstr "Statistiques Descriptives" #: ../data/functions.xml.in.h:372 msgid "Sum (total)" msgstr "Somme (total)" #: ../data/functions.xml.in.h:373 msgid "r:total" msgstr "" #: ../data/functions.xml.in.h:374 msgid "Data" msgstr "Donnée" #: ../data/functions.xml.in.h:375 msgid "Percentile" msgstr "" #: ../data/functions.xml.in.h:376 msgid "r:percentile" msgstr "" #: ../data/functions.xml.in.h:378 #, no-c-format msgid "Percentile (%)" msgstr "" #: ../data/functions.xml.in.h:379 msgid "r:min" msgstr "" #: ../data/functions.xml.in.h:380 msgid "Returns the lowest value." msgstr "Retourne la valeur la plus petite." #: ../data/functions.xml.in.h:381 msgid "r:max" msgstr "" #: ../data/functions.xml.in.h:382 msgid "Returns the highest value." msgstr "Retourne la plus grande valeur." #: ../data/functions.xml.in.h:383 msgid "Mode" msgstr "" #: ../data/functions.xml.in.h:384 msgid "r:mode" msgstr "" #: ../data/functions.xml.in.h:385 msgid "Returns the most frequently occurring value." msgstr "Retourne la valeur qui apparaît le plus souvent." #: ../data/functions.xml.in.h:386 msgid "Range" msgstr "" #: ../data/functions.xml.in.h:387 msgid "r:range" msgstr "" #: ../data/functions.xml.in.h:388 msgid "Calculates the difference between the min and max value." msgstr "Calcule la différence entre la valeur minimale et maximale." #: ../data/functions.xml.in.h:389 msgid "Median" msgstr "Médianne" #: ../data/functions.xml.in.h:390 msgid "r:median" msgstr "médiane" #: ../data/functions.xml.in.h:391 msgid "Quartile" msgstr "Quartile" #: ../data/functions.xml.in.h:392 msgid "r:quartile" msgstr "" #: ../data/functions.xml.in.h:393 msgid "Decile" msgstr "Décile" #: ../data/functions.xml.in.h:394 msgid "r:decile" msgstr "" #: ../data/functions.xml.in.h:395 msgid "Interquartile Range" msgstr "Écart interquartile" #: ../data/functions.xml.in.h:396 msgid "r:iqr" msgstr "" #: ../data/functions.xml.in.h:397 msgid "Calculates the difference between the first and third quartile." msgstr "Calcule la différence entre le premier et le troisième quartile." #: ../data/functions.xml.in.h:398 msgid "Number of Samples" msgstr "Nombre d'Échantillons" #. Number of samples #: ../data/functions.xml.in.h:400 msgid "r:number" msgstr "nombre" #: ../data/functions.xml.in.h:401 msgid "Returns the number of samples." msgstr "Retourne le nombre d'échantillons." #: ../data/functions.xml.in.h:402 msgid "Random Number" msgstr "Nombre Aléatoire" #: ../data/functions.xml.in.h:403 msgid "r:rand" msgstr "" #: ../data/functions.xml.in.h:404 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 "" "Génère un nombre pseudo-aléatoire. Retourne un nombre réel entre 0 et 1, si " "le plafond est zéro (valeur par défaut), ou un entier entre 1 et le plafond " "(inclusivement)." #: ../data/functions.xml.in.h:405 msgid "Ceil" msgstr "Plafond" #: ../data/functions.xml.in.h:406 msgid "Random Number Between Limits" msgstr "Nombre Aléatoire entre les limites" #: ../data/functions.xml.in.h:407 msgid "r:randbetween" msgstr "" #: ../data/functions.xml.in.h:408 msgid "Returns an integer between (including) bottom and top." msgstr "Retourne un entier entre le bas et le haut (inclusivement)." #: ../data/functions.xml.in.h:409 msgid "Bottom" msgstr "Bas" #: ../data/functions.xml.in.h:410 msgid "Top" msgstr "Haut" #: ../data/functions.xml.in.h:411 msgid "Means" msgstr "Moyenne" #: ../data/functions.xml.in.h:412 msgid "Mean" msgstr "Moyenne" #: ../data/functions.xml.in.h:413 msgid "r:mean,average" msgstr "moyenne" #: ../data/functions.xml.in.h:414 msgid "Harmonic Mean" msgstr "Moyenne Harmonique" #: ../data/functions.xml.in.h:415 msgid "r:harmmean" msgstr "" #: ../data/functions.xml.in.h:416 msgid "Geometric Mean" msgstr "Moyenne géométrique" #: ../data/functions.xml.in.h:417 msgid "r:geomean" msgstr "moyenne_géométrique" #: ../data/functions.xml.in.h:418 msgid "Trimmed Mean" msgstr "" #: ../data/functions.xml.in.h:419 msgid "r:trimmean" msgstr "" #: ../data/functions.xml.in.h:420 msgid "Trimmed percentage (at each end)" msgstr "" #: ../data/functions.xml.in.h:421 msgid "Winsorized Mean" msgstr "" #: ../data/functions.xml.in.h:422 msgid "r:winsormean" msgstr "" #: ../data/functions.xml.in.h:423 msgid "Winsorized percentage (at each end)" msgstr "" #: ../data/functions.xml.in.h:424 msgid "Weighted Mean" msgstr "Moyenne Pondérée" #: ../data/functions.xml.in.h:425 msgid "r:weighmean" msgstr "" #: ../data/functions.xml.in.h:426 msgid "Weights" msgstr "Poids" #: ../data/functions.xml.in.h:427 msgid "Quadratic Mean (RMS)" msgstr "Moyenne Quadratique (RMS)" #: ../data/functions.xml.in.h:428 msgid "r:rms" msgstr "" #: ../data/functions.xml.in.h:429 msgid "Moments" msgstr "" #: ../data/functions.xml.in.h:430 msgid "Standard Deviation (entire population)" msgstr "" #: ../data/functions.xml.in.h:431 msgid "r:stdevp" msgstr "" #: ../data/functions.xml.in.h:432 msgid "Standard Deviation (random sampling)" msgstr "" #: ../data/functions.xml.in.h:433 msgid "r:stdev" msgstr "" #: ../data/functions.xml.in.h:434 msgid "Variance (entire population)" msgstr "Variance (population entière)" #: ../data/functions.xml.in.h:435 msgid "r:varp" msgstr "" #: ../data/functions.xml.in.h:436 msgid "Variance (random sampling)" msgstr "Variance (échantillon aléatoire)" #: ../data/functions.xml.in.h:437 msgid "r:var" msgstr "" #: ../data/functions.xml.in.h:438 msgid "Standard Error" msgstr "" #: ../data/functions.xml.in.h:439 msgid "r:stderr" msgstr "" #: ../data/functions.xml.in.h:440 msgid "Mean Deviation" msgstr "Déviation Moyenne" #: ../data/functions.xml.in.h:441 msgid "r:meandev" msgstr "" #: ../data/functions.xml.in.h:442 msgid "Covariance" msgstr "" #: ../data/functions.xml.in.h:443 msgid "r:cov,r:covar" msgstr "" #: ../data/functions.xml.in.h:444 msgid "Data 1" msgstr "Donnée 1" #: ../data/functions.xml.in.h:445 msgid "Data 2" msgstr "Donnée 2" #: ../data/functions.xml.in.h:446 msgid "Pooled Variance" msgstr "" #: ../data/functions.xml.in.h:447 msgid "r:poolvar" msgstr "" #: ../data/functions.xml.in.h:448 msgid "Regression" msgstr "Régression" #: ../data/functions.xml.in.h:449 msgid "Statistical Correlation" msgstr "Corrélation Statistique" #: ../data/functions.xml.in.h:450 msgid "r:cor" msgstr "" #: ../data/functions.xml.in.h:451 msgid "Pearson's Correlation Coefficient" msgstr "Coefficient de Corrélation de Pearson" #: ../data/functions.xml.in.h:452 msgid "r:pearson,r:correl" msgstr "" #: ../data/functions.xml.in.h:453 msgid "Spearman's Rho" msgstr "" #: ../data/functions.xml.in.h:454 msgid "r:spearman" msgstr "" #: ../data/functions.xml.in.h:455 msgid "Durbin-Watson" msgstr "" #: ../data/functions.xml.in.h:456 msgid "r:durbinwatson" msgstr "" #: ../data/functions.xml.in.h:457 msgid "Statistical Tests" msgstr "" #: ../data/functions.xml.in.h:458 msgid "Unpaired T-Test" msgstr "" #: ../data/functions.xml.in.h:459 msgid "r:ttest" msgstr "" #: ../data/functions.xml.in.h:460 msgid "Paired T-Test" msgstr "Test du T" #: ../data/functions.xml.in.h:461 msgid "r:pttest" msgstr "" #: ../data/functions.xml.in.h:462 msgid "Distribution" msgstr "" #: ../data/functions.xml.in.h:463 msgid "Rayleigh Distribution" msgstr "Distribution de Rayleigh" #: ../data/functions.xml.in.h:464 msgid "r:rayleigh" msgstr "" #: ../data/functions.xml.in.h:465 msgid "" "Returns the probability density p(x) at x for a Rayleigh distribution with " "scale parameter sigma. (from Gnumeric)" msgstr "" "Retourne la densité de probabilité p(x) au x choisi pour une distribution de " "Rayleigh avec le paramètre d'échelle sigma. (utilise Gnumeric)" #: ../data/functions.xml.in.h:466 msgid "X" msgstr "" #: ../data/functions.xml.in.h:467 msgid "Sigma" msgstr "" #: ../data/functions.xml.in.h:468 msgid "Rayleigh Tail Distribution" msgstr "Distribution de Queue de Rayleigh" #: ../data/functions.xml.in.h:469 msgid "r:rayleightail" msgstr "" #: ../data/functions.xml.in.h:470 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:471 msgid "Pareto Distribution" msgstr "Distribution de Pareto" #: ../data/functions.xml.in.h:472 msgid "r:pareto" msgstr "" #: ../data/functions.xml.in.h:473 msgid "" "Returns the probability density p(x) at x for a Pareto distribution with " "exponent and scale. (from Gnumeric)" msgstr "" "Retourne la densité de probabilité p(x) au x choisi pour une distribution de " "Pareto avec l'exposant et l'échelle. (utilise Gnumeric)" #: ../data/functions.xml.in.h:474 msgid "Scale" msgstr "Échelle" #: ../data/functions.xml.in.h:475 msgid "Logistic Distribution" msgstr "Distribution logistique" #: ../data/functions.xml.in.h:476 msgid "r:logistic" msgstr "logistique" #: ../data/functions.xml.in.h:477 msgid "" "Returns the probability density p(x) at x for a logistic distribution with " "scale parameter. (from Gnumeric)" msgstr "" #: ../data/functions.xml.in.h:478 msgid "Date & Time" msgstr "Date & Heure" #: ../data/functions.xml.in.h:479 msgid "Days between two dates" msgstr "Jours entre deux dates" #: ../data/functions.xml.in.h:480 msgid "r:days" msgstr "jours" #: ../data/functions.xml.in.h:481 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 "" "Retourne le nombre de jours entre deux dates. La base est la " "manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360, " "1 : jours réels (par défaut), 2 : jours réels/360, 3 : jours réels/365 ou " "4 : Européenne 30/360." #: ../data/functions.xml.in.h:482 msgid "First date" msgstr "Première date" #: ../data/functions.xml.in.h:483 msgid "Second date" msgstr "" #: ../data/functions.xml.in.h:484 msgid "Day counting basis" msgstr "Base de comptage des jours" #: ../data/functions.xml.in.h:485 msgid "Financial function mode" msgstr "Mode de fonctions financières" #: ../data/functions.xml.in.h:486 msgid "Years between two dates" msgstr "Années entre deux dates" #: ../data/functions.xml.in.h:487 msgid "r:yearfrac" msgstr "" #: ../data/functions.xml.in.h:488 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 "" "Retourne le nombre d'années (sous forme de fraction) entre deux dates. " " La base est la manière de compter les jours que vous souhaitez " "utiliser : 0 : US 30/360, 1 : jours réels (par défaut), 2 : jours réels/360, " "3 : jours réels/365 ou 4 : Européenne 30/360." #: ../data/functions.xml.in.h:489 msgid "Week of Year" msgstr "Semaine de l'Année" #: ../data/functions.xml.in.h:490 msgid "r:week" msgstr "" #: ../data/functions.xml.in.h:491 msgid "Date" msgstr "" #: ../data/functions.xml.in.h:492 msgid "Week begins on Sunday" msgstr "La semaine commence le dimanche" #: ../data/functions.xml.in.h:493 msgid "Day of Week" msgstr "Jour de la semaine" #: ../data/functions.xml.in.h:494 msgid "r:weekday" msgstr "" #: ../data/functions.xml.in.h:495 msgid "Month" msgstr "Mois" #: ../data/functions.xml.in.h:496 msgid "r:month" msgstr "mois" #: ../data/functions.xml.in.h:497 msgid "Day of Month" msgstr "Jour du mois" #: ../data/functions.xml.in.h:498 msgid "r:day" msgstr "jour" #: ../data/functions.xml.in.h:499 msgid "Year" msgstr "Année" #: ../data/functions.xml.in.h:500 msgid "r:year" msgstr "" #: ../data/functions.xml.in.h:501 msgid "Day of Year" msgstr "Jour de l'année" #: ../data/functions.xml.in.h:502 msgid "r:yearday" msgstr "" #: ../data/functions.xml.in.h:503 msgid "Current Time" msgstr "Heure actuelle" #: ../data/functions.xml.in.h:504 msgid "r:time" msgstr "" #: ../data/functions.xml.in.h:505 msgid "Standard Date Format" msgstr "Format de Date Standard" #: ../data/functions.xml.in.h:506 msgid "r:isodate" msgstr "" #: ../data/functions.xml.in.h:507 msgid "Local Date Format" msgstr "Format de Date Local" #: ../data/functions.xml.in.h:508 msgid "r:localdate" msgstr "" #: ../data/functions.xml.in.h:509 msgid "Date to Unix Timestamp" msgstr "Date selon l'Horodatage Unix" #: ../data/functions.xml.in.h:510 msgid "r:timestamp" msgstr "" #: ../data/functions.xml.in.h:511 msgid "Unix Timestamp to Date" msgstr "" #: ../data/functions.xml.in.h:512 msgid "r:stamptodate" msgstr "" #: ../data/functions.xml.in.h:513 msgid "Timestamp" msgstr "" #: ../data/functions.xml.in.h:514 msgid "Add Days" msgstr "" #: ../data/functions.xml.in.h:515 msgid "r:addDays" msgstr "" #: ../data/functions.xml.in.h:516 msgid "Days" msgstr "" #: ../data/functions.xml.in.h:517 msgid "Add Months" msgstr "" #: ../data/functions.xml.in.h:518 msgid "r:addMonths" msgstr "" #: ../data/functions.xml.in.h:519 #, fuzzy msgid "Months" msgstr "Mois" #: ../data/functions.xml.in.h:520 msgid "Add Years" msgstr "" #: ../data/functions.xml.in.h:521 msgid "r:addYears" msgstr "" #: ../data/functions.xml.in.h:522 msgid "Years" msgstr "Années" #: ../data/functions.xml.in.h:523 msgid "Add Time" msgstr "" #: ../data/functions.xml.in.h:524 msgid "r:addTime" msgstr "" #: ../data/functions.xml.in.h:525 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:526 ../data/units.xml.in.h:132 msgid "Time" msgstr "Temps" #: ../data/functions.xml.in.h:527 msgid "Utilities" msgstr "Utilitaires" #: ../data/functions.xml.in.h:528 msgid "ASCII Value" msgstr "Valeur ASCII" #: ../data/functions.xml.in.h:529 msgid "r:code" msgstr "" #: ../data/functions.xml.in.h:530 msgid "Character" msgstr "Caractère" #: ../data/functions.xml.in.h:531 msgid "ASCII Char" msgstr "Caractère ASCII" #: ../data/functions.xml.in.h:532 msgid "r:char" msgstr "" #: ../data/functions.xml.in.h:533 msgid "Length of string" msgstr "Longueur de la chaîne" #: ../data/functions.xml.in.h:534 msgid "r:len" msgstr "" #: ../data/functions.xml.in.h:535 msgid "Text" msgstr "Texte" #: ../data/functions.xml.in.h:536 msgid "Concatenate Strings" msgstr "Concaténer les chaînes" #: ../data/functions.xml.in.h:537 msgid "r:concatenate" msgstr "" #: ../data/functions.xml.in.h:538 msgid "Text string 1" msgstr "Chaîne de texte 1" #: ../data/functions.xml.in.h:539 msgid "Text string 2" msgstr "Chaîne de texte 2" #: ../data/functions.xml.in.h:540 msgid "Replace" msgstr "Remplacer" #: ../data/functions.xml.in.h:541 msgid "r:replace" msgstr "" #: ../data/functions.xml.in.h:542 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 "" "Remplace une certaine valeur dans une expression par une nouvelle valeur. " "L'expression est calculée avant le remplacement si le quatrième argument est " "vrai." #: ../data/functions.xml.in.h:543 msgid "Expression" msgstr "" #: ../data/functions.xml.in.h:544 msgid "Original value" msgstr "Valeur originale" #: ../data/functions.xml.in.h:545 msgid "New value" msgstr "Nouvelle valeur" #: ../data/functions.xml.in.h:546 msgid "Precalculate expression" msgstr "Expression précalculée" #: ../data/functions.xml.in.h:547 msgid "Strip Units" msgstr "" #: ../data/functions.xml.in.h:548 msgid "r:nounit,strip_units" msgstr "" #: ../data/functions.xml.in.h:549 msgid "" "Removes all units from an expression. The expression is calculated before " "the removal." msgstr "" "Enlève toutes les unités de l'expression. L'expression est calculée avant la " "suppression." #: ../data/functions.xml.in.h:550 msgid "Process Vector Elements" msgstr "Calculer les Éléments de Vecteur" #: ../data/functions.xml.in.h:551 msgid "r:process" msgstr "" #: ../data/functions.xml.in.h:552 msgid "Element variable" msgstr "Variable Élément" #: ../data/functions.xml.in.h:553 msgid "Index variable" msgstr "Variable d'index" #: ../data/functions.xml.in.h:554 msgid "Vector variable" msgstr "Variable vecteur" #: ../data/functions.xml.in.h:555 msgid "Process Matrix Elements" msgstr "Calculer les Éléments de Matrice" #: ../data/functions.xml.in.h:556 msgid "r:processm" msgstr "" #: ../data/functions.xml.in.h:557 msgid "Row variable" msgstr "Variable de Ligne" #: ../data/functions.xml.in.h:558 msgid "Column variable" msgstr "Variable de colonne" #: ../data/functions.xml.in.h:559 msgid "Matrix variable" msgstr "Variable matricielle" #: ../data/functions.xml.in.h:560 msgid "Custom Sum of Elements" msgstr "Somme d'éléments personnalisée" #: ../data/functions.xml.in.h:561 msgid "r:csum" msgstr "" #: ../data/functions.xml.in.h:562 msgid "First element" msgstr "Premier élément" #: ../data/functions.xml.in.h:563 msgid "Last element" msgstr "Dernier élément" #: ../data/functions.xml.in.h:564 msgid "Initial value" msgstr "Valeur initiale" #: ../data/functions.xml.in.h:565 msgid "Value variable" msgstr "Variable valeur" #: ../data/functions.xml.in.h:566 msgid "Select Vector Elements" msgstr "Sélectionner les Éléments de Vecteur" #: ../data/functions.xml.in.h:567 msgid "r:select" msgstr "" #: ../data/functions.xml.in.h:568 msgid "Condition" msgstr "" #: ../data/functions.xml.in.h:569 msgid "Select first match" msgstr "Sélectionner la première occurrence" #: ../data/functions.xml.in.h:570 msgid "r:function" msgstr "fonction" #: ../data/functions.xml.in.h:571 msgid "Arguments" msgstr "Arguments" #: ../data/functions.xml.in.h:572 msgid "Title" msgstr "Titre" #: ../data/functions.xml.in.h:573 msgid "r:title" msgstr "" #: ../data/functions.xml.in.h:575 msgid "Display Error" msgstr "Afficher l'erreur" #: ../data/functions.xml.in.h:576 msgid "r:error" msgstr "erreur" #: ../data/functions.xml.in.h:577 msgid "Message" msgstr "" #: ../data/functions.xml.in.h:578 msgid "Display Warning" msgstr "Afficher l'avertissement" #: ../data/functions.xml.in.h:579 msgid "r:warning" msgstr "" #: ../data/functions.xml.in.h:580 msgid "Display Message" msgstr "Afficher le message" #: ../data/functions.xml.in.h:581 msgid "r:message" msgstr "" #: ../data/functions.xml.in.h:582 msgid "Save as Variable" msgstr "Enregistrer comme variable" #: ../data/functions.xml.in.h:583 msgid "r:save" msgstr "" #: ../data/functions.xml.in.h:584 msgid "Category" msgstr "Catégorie" #: ../data/functions.xml.in.h:585 msgid "RPN Stack Register" msgstr "Registre de Pile NPI" #: ../data/functions.xml.in.h:586 msgid "r:register" msgstr "" #: ../data/functions.xml.in.h:587 msgid "Returns the value of a RPN stack register." msgstr "Retourne la valeur d'un registre de pile NPI." #: ../data/functions.xml.in.h:588 msgid "RPN Stack Vector" msgstr "Vecteur de Pile NPI" #: ../data/functions.xml.in.h:589 msgid "r:stack" msgstr "" #: ../data/functions.xml.in.h:590 msgid "Returns the RPN stack as a vector." msgstr "Retourne la pile NPI sous forme de vecteur." #: ../data/functions.xml.in.h:591 msgid "Is Number" msgstr "" #: ../data/functions.xml.in.h:592 msgid "r:isNumber" msgstr "" #: ../data/functions.xml.in.h:593 msgid "Is Real" msgstr "" #: ../data/functions.xml.in.h:594 msgid "r:isReal" msgstr "" #: ../data/functions.xml.in.h:595 msgid "Is Rational" msgstr "" #: ../data/functions.xml.in.h:596 msgid "r:isRational" msgstr "" #: ../data/functions.xml.in.h:597 msgid "Is Integer" msgstr "" #: ../data/functions.xml.in.h:598 msgid "r:isInteger" msgstr "" #: ../data/functions.xml.in.h:599 msgid "Represents Number" msgstr "" #: ../data/functions.xml.in.h:600 msgid "r:representsNumber" msgstr "" #: ../data/functions.xml.in.h:601 msgid "Represents Real" msgstr "" #: ../data/functions.xml.in.h:602 msgid "r:representsReal" msgstr "" #: ../data/functions.xml.in.h:603 msgid "Represents Rational" msgstr "" #: ../data/functions.xml.in.h:604 msgid "r:representsRational" msgstr "" #: ../data/functions.xml.in.h:605 msgid "Represents Integer" msgstr "" #: ../data/functions.xml.in.h:606 msgid "r:representsInteger" msgstr "" #: ../data/functions.xml.in.h:607 msgid "Logical" msgstr "Logique" #: ../data/functions.xml.in.h:608 msgid "For...Do" msgstr "For...Do (Pour...Faire)" #: ../data/functions.xml.in.h:609 msgid "r:for" msgstr "pour" #: ../data/functions.xml.in.h:610 msgid "Initial value of counter" msgstr "Valeur initiale du compteur" #: ../data/functions.xml.in.h:611 msgid "Counter variable" msgstr "Variable de compteur" #: ../data/functions.xml.in.h:612 msgid "For condition" msgstr "Condition de boucle for" #: ../data/functions.xml.in.h:613 msgid "Counter update function" msgstr "Fonction d'incrémentation du compteur" #: ../data/functions.xml.in.h:614 msgid "Do function" msgstr "Fonction 'faire'" #: ../data/functions.xml.in.h:615 msgid "If...Then...Else" msgstr "Si...Sinon..Alors" #: ../data/functions.xml.in.h:616 msgid "r:if" msgstr "si" #: ../data/functions.xml.in.h:617 msgid "Tests a condition and returns a value depending on the result." msgstr "Teste une condition et retourne une valeur en fonction du résultat." #: ../data/functions.xml.in.h:618 msgid "Expression if condition is met" msgstr "Expression si la condition est remplie" #: ../data/functions.xml.in.h:619 msgid "Expression if condition is NOT met" msgstr "Expression si la condition N'EST PAS remplie" #: ../data/functions.xml.in.h:620 msgid "Logical Exclusive OR" msgstr "OU Exclusif Logique" #: ../data/functions.xml.in.h:621 msgid "r:xor" msgstr "" #: ../data/functions.xml.in.h:622 msgid "Value 1" msgstr "Valeur 1" #: ../data/functions.xml.in.h:623 msgid "Value 2" msgstr "Valeur 2" #: ../data/functions.xml.in.h:624 msgid "Bitwise Exclusive OR" msgstr "OU exclusif bit à bit" #: ../data/functions.xml.in.h:625 msgid "r:bitxor" msgstr "" #: ../data/functions.xml.in.h:626 msgid "Bitwise Shift" msgstr "Décalage de bits" #: ../data/functions.xml.in.h:627 msgid "r:shift" msgstr "" #: ../data/functions.xml.in.h:628 msgid "Bits" msgstr "" #: ../data/functions.xml.in.h:629 msgid "Algebra" msgstr "Algèbre" #: ../data/functions.xml.in.h:630 msgid "Sum" msgstr "Somme" #: ../data/functions.xml.in.h:631 msgid "au:Σ,r:sum" msgstr "" #: ../data/functions.xml.in.h:632 msgid "" "Corresponds to the sum symbol. Adds terms for each x ranging from the lower " "to the upper limit." msgstr "" "Correspond au symbole de la somme. Ajoute les termes pour chaque x allant de " "la borne inférieure à la borne supérieure." #: ../data/functions.xml.in.h:633 msgid "Term expression" msgstr "" #: ../data/functions.xml.in.h:634 msgid "Lower limit (i)" msgstr "Limite inférieure (i)" #: ../data/functions.xml.in.h:635 msgid "Upper limit (n)" msgstr "Limite Supérieure (n)" #: ../data/functions.xml.in.h:636 msgid "Product" msgstr "Produit" #: ../data/functions.xml.in.h:637 msgid "au:Π,r:product" msgstr "" #: ../data/functions.xml.in.h:638 msgid "" "Corresponds to the product symbol. Multiplies factors for each x ranging " "from the lower to the upper limit." msgstr "" "Correspond au symbole du produit. Multiplie les facteurs pour chaque x " "allant de la la limite inférieure à la limite supérieure." #: ../data/functions.xml.in.h:639 msgid "Factor expression" msgstr "Factoriser l'expression" #: ../data/functions.xml.in.h:640 msgid "Solve for multiple variables" msgstr "Résoudre pour des variables multiples" #: ../data/functions.xml.in.h:641 msgid "r:multisolve" msgstr "" #: ../data/functions.xml.in.h:642 msgid "Equation vector" msgstr "Vecteur d'équation" #: ../data/functions.xml.in.h:643 msgid "Variable vector" msgstr "Variable vecteur" #: ../data/functions.xml.in.h:644 msgid "Solve equation" msgstr "Résoudre l'équation" #: ../data/functions.xml.in.h:645 msgid "r:solve" msgstr "" #: ../data/functions.xml.in.h:646 msgid "Equation" msgstr "Équation" #: ../data/functions.xml.in.h:647 msgid "With respect to" msgstr "" #: ../data/functions.xml.in.h:648 msgid "Solve for two variables" msgstr "Résoudre pour deux variables" #: ../data/functions.xml.in.h:649 msgid "r:solve2" msgstr "" #: ../data/functions.xml.in.h:650 msgid "" "Solves two equations with two unknown variables. Returns the value of the " "first variable." msgstr "" "Résout deux équations à deux inconnues. Retourne la valeur de la première " "variable." #: ../data/functions.xml.in.h:651 msgid "Equation 1" msgstr "Équation 2" #: ../data/functions.xml.in.h:652 msgid "Equation 2" msgstr "Équation 2" #: ../data/functions.xml.in.h:653 msgid "Variable 1" msgstr "" #: ../data/functions.xml.in.h:654 msgid "Variable 2" msgstr "" #: ../data/functions.xml.in.h:655 msgid "Find Linear Function" msgstr "Trouver une fonction affine" #: ../data/functions.xml.in.h:656 msgid "r:linearfunction" msgstr "" #: ../data/functions.xml.in.h:657 msgid "" "Finds the linear function for the straight line between two distinct points." msgstr "" "Trouve la fonction affine pour la ligne droite passant entre deux points " "distincts." #: ../data/functions.xml.in.h:658 msgid "x1" msgstr "" #: ../data/functions.xml.in.h:659 msgid "y1" msgstr "" #: ../data/functions.xml.in.h:660 msgid "x2" msgstr "" #: ../data/functions.xml.in.h:661 msgid "y2" msgstr "" #: ../data/functions.xml.in.h:662 msgid "Calculus" msgstr "Calcul" #: ../data/functions.xml.in.h:663 msgid "Differentiate" msgstr "" #: ../data/functions.xml.in.h:664 msgid "r:diff" msgstr "" #: ../data/functions.xml.in.h:665 msgid "Order" msgstr "Ordre" #: ../data/functions.xml.in.h:666 msgid "Integrate" msgstr "Intégrale" #: ../data/functions.xml.in.h:667 msgid "r:integrate" msgstr "intégrer" #: ../data/functions.xml.in.h:668 msgid "Variable of integration" msgstr "Variable d'intégration" #: ../data/functions.xml.in.h:669 msgid "Extreme Values" msgstr "Valeurs extrêmes" #: ../data/functions.xml.in.h:670 msgid "r:extremum" msgstr "" #: ../data/functions.xml.in.h:671 msgid "Geometry" msgstr "Géométrie" #: ../data/functions.xml.in.h:672 msgid "Triangle" msgstr "" #: ../data/functions.xml.in.h:673 msgid "Hypotenuse" msgstr "Hypoténuse" #: ../data/functions.xml.in.h:674 msgid "r:hypot" msgstr "" #: ../data/functions.xml.in.h:675 msgid "Side A" msgstr "Côté A" #: ../data/functions.xml.in.h:676 msgid "Side B" msgstr "Côté B" #: ../data/functions.xml.in.h:677 msgid "Triangle Area" msgstr "Aire de Triangle" #: ../data/functions.xml.in.h:678 msgid "r:triangle" msgstr "" #: ../data/functions.xml.in.h:679 msgid "Height" msgstr "Hauteur" #: ../data/functions.xml.in.h:680 msgid "Triangle Perimeter" msgstr "Périmètre de Triangle" #: ../data/functions.xml.in.h:681 msgid "r:triangle_perimeter" msgstr "" #: ../data/functions.xml.in.h:682 msgid "Circle" msgstr "Cercle" #: ../data/functions.xml.in.h:683 msgid "Circle Area" msgstr "Aire d'un cercle" #: ../data/functions.xml.in.h:684 msgid "r:circle" msgstr "cercle" #: ../data/functions.xml.in.h:685 msgid "Calculates the area of a circle using the radius" msgstr "Calcule l'aire d'un cercle d'après son rayon" #: ../data/functions.xml.in.h:686 msgid "Radius" msgstr "Rayon" #: ../data/functions.xml.in.h:687 msgid "Circle Circumference" msgstr "Circonférence d'un cercle" #: ../data/functions.xml.in.h:688 msgid "r:circumference" msgstr "circonférence" #: ../data/functions.xml.in.h:689 msgid "Cylinder" msgstr "Cylindre" #: ../data/functions.xml.in.h:690 msgid "Cylinder Volume" msgstr "Volume d'un cylindre" #: ../data/functions.xml.in.h:691 msgid "r:cylinder" msgstr "cylindre" #: ../data/functions.xml.in.h:692 msgid "Surface Area of Cylinder" msgstr "Aire de la Surface d'un Cylindre" #: ../data/functions.xml.in.h:693 msgid "r:cylinder_sa" msgstr "" #: ../data/functions.xml.in.h:694 msgid "Cone" msgstr "Cône" #: ../data/functions.xml.in.h:695 msgid "Cone Volume" msgstr "Volume d'un cône" #: ../data/functions.xml.in.h:696 msgid "r:cone" msgstr "cône" #: ../data/functions.xml.in.h:697 msgid "Surface Area of Cone" msgstr "Aire de la Surface d'un Cône" #: ../data/functions.xml.in.h:698 msgid "r:cone_sa" msgstr "" #: ../data/functions.xml.in.h:699 msgid "Sphere" msgstr "Sphère" #: ../data/functions.xml.in.h:700 msgid "Sphere Volume" msgstr "Volume de Sphère" #: ../data/functions.xml.in.h:701 msgid "r:sphere" msgstr "" #: ../data/functions.xml.in.h:702 msgid "Surface Area of Sphere" msgstr "Aire de la Surface d'une Sphère" #: ../data/functions.xml.in.h:703 msgid "r:sphere_sa" msgstr "" #: ../data/functions.xml.in.h:704 msgid "Square Area" msgstr "Aire d'un Carré" #: ../data/functions.xml.in.h:705 msgid "r:square" msgstr "" #: ../data/functions.xml.in.h:706 msgid "Length of side" msgstr "Longueur du côté" #: ../data/functions.xml.in.h:707 msgid "Square Perimeter" msgstr "Périmètre d'un Carré" #: ../data/functions.xml.in.h:708 msgid "r:square_perimeter" msgstr "" #: ../data/functions.xml.in.h:709 msgid "Cube" msgstr "" #: ../data/functions.xml.in.h:710 msgid "Cube Volume" msgstr "Volume d'un cube" #: ../data/functions.xml.in.h:711 msgid "r:cube" msgstr "" #: ../data/functions.xml.in.h:712 msgid "Surface Area of Cube" msgstr "Aire de la Surface d'un Cube" #: ../data/functions.xml.in.h:713 msgid "r:cube_sa" msgstr "" #: ../data/functions.xml.in.h:714 msgid "Rectangle" msgstr "" #: ../data/functions.xml.in.h:715 msgid "Rectangle Area" msgstr "Aire de Rectangle" #: ../data/functions.xml.in.h:716 msgid "r:rect" msgstr "" #: ../data/functions.xml.in.h:717 msgid "Width" msgstr "Largeur" #: ../data/functions.xml.in.h:718 msgid "Rectangle Perimeter" msgstr "Périmètre de Rectangle" #: ../data/functions.xml.in.h:719 msgid "r:rect_perimeter" msgstr "" #: ../data/functions.xml.in.h:720 msgid "Prism" msgstr "Prisme" #: ../data/functions.xml.in.h:721 msgid "Volume of Rectangular Prism" msgstr "Volume de Prisme Rectangulaire" #: ../data/functions.xml.in.h:722 msgid "r:rectprism" msgstr "" #: ../data/functions.xml.in.h:723 msgid "Calculates the volume of a prism with rectangular base." msgstr "Calcule le volume d'un prisme à base rectangulaire." #: ../data/functions.xml.in.h:724 msgid "Surface Area of Rectangular Prism" msgstr "Aire de la Surface d'un Prisme Rectangulaire" #: ../data/functions.xml.in.h:725 msgid "r:rectprism_sa" msgstr "" #: ../data/functions.xml.in.h:726 msgid "Calculates the surface area of a prism with rectangular base." msgstr "Calcule l'aire de la surface d'un prisme à base rectangulaire." #: ../data/functions.xml.in.h:727 msgid "Volume of Triangular Prism" msgstr "Volume de Prisme Rectangulaire" #: ../data/functions.xml.in.h:728 msgid "r:triangleprism" msgstr "" #: ../data/functions.xml.in.h:729 msgid "Calculates the volume of a prism with triangular base." msgstr "Calcule le volume d'un prisme à base triangulaire." #: ../data/functions.xml.in.h:730 msgid "Pyramid" msgstr "Pyramide" #: ../data/functions.xml.in.h:731 msgid "Pyramid Volume" msgstr "Volume de Pyramide" #: ../data/functions.xml.in.h:732 msgid "r:pyramid" msgstr "" #: ../data/functions.xml.in.h:733 msgid "" "Calculates the volume of a 3-dimensional shape standing on a rectangular " "base and terminating in a point at the top." msgstr "" "Calcule le volume d'une forme à trois dimensions basée sur un rectangle et " "se finissant en un point au sommet." #: ../data/functions.xml.in.h:734 msgid "Length of base" msgstr "Longueur de la taille" #: ../data/functions.xml.in.h:735 msgid "Width of base" msgstr "Largeur de la base" #: ../data/functions.xml.in.h:736 msgid "Volume of Regular Tetrahedron" msgstr "Volume de Tétraèdre Régulier" #: ../data/functions.xml.in.h:737 msgid "r:tetrahedron" msgstr "" #: ../data/functions.xml.in.h:738 msgid "Surface Area of Regular Tetrahedron" msgstr "Aire de la Surface d'un Tétraèdre Régulier" #: ../data/functions.xml.in.h:739 msgid "r:tetrahedron_sa" msgstr "" #: ../data/functions.xml.in.h:740 msgid "Height of Regular Tetrahedron" msgstr "Hauteur d'un Tétraèdre Régulier" #: ../data/functions.xml.in.h:741 msgid "r:tetrahedron_height" msgstr "" #: ../data/functions.xml.in.h:742 msgid "Volume of Square Pyramid" msgstr "Volume de Pyramide à Base Carrée" #: ../data/functions.xml.in.h:743 msgid "r:sqpyramid" msgstr "" #: ../data/functions.xml.in.h:744 msgid "Surface Area of Square Pyramid" msgstr "Aire de la Surface d'une Pyramide" #: ../data/functions.xml.in.h:745 msgid "r:sqpyramid_sa" msgstr "" #: ../data/functions.xml.in.h:746 msgid "Height of Square Pyramid" msgstr "Hauteur d'une Pyramide à Base Carrée" #: ../data/functions.xml.in.h:747 msgid "r:sqpyramid_height" msgstr "" #: ../data/functions.xml.in.h:748 msgid "Parallelogram" msgstr "Parallélogramme" #: ../data/functions.xml.in.h:749 msgid "Parallelogram Area" msgstr "Aire d'un Parallélogramme" #: ../data/functions.xml.in.h:750 msgid "r:parallelogram" msgstr "parallélogramme" #: ../data/functions.xml.in.h:751 #, fuzzy msgid "" "Calculates the area of a four-sided figure whose opposite sides are both " "parallel and equal in length." msgstr "" "Calcule l'aire d'un parallélogramme (quadrilatère dont les côtés opposés " "sont parallèles et de même longueur)." #: ../data/functions.xml.in.h:752 msgid "Parallelogram Perimeter" msgstr "Périmètre d'un Parallélogramme" #: ../data/functions.xml.in.h:753 msgid "r:parallelogram_perimeter" msgstr "périmètre_de_parallélogramme" #: ../data/functions.xml.in.h:754 #, fuzzy msgid "" "Calculates the perimeter of a four-sided figure whose opposite sides are " "both parallel and equal in length." msgstr "" "Calcule le périmètre d'un parallélogramme (quadrilatère dont les côtés " "opposés sont parallèles et de même longueur)." #: ../data/functions.xml.in.h:755 msgid "Trapezoid" msgstr "" #: ../data/functions.xml.in.h:756 msgid "Trapezoid Area" msgstr "" #: ../data/functions.xml.in.h:757 msgid "r:trapezoid" msgstr "" #: ../data/functions.xml.in.h:758 #, fuzzy msgid "Calculates the area of a four-sided figure with two parallel sides." msgstr "" "Calcule l'aire d'un trapèze (quadrilatère dont deux côtés sont parallèles)." #: ../data/functions.xml.in.h:759 msgid "Economics" msgstr "Économie" #: ../data/functions.xml.in.h:760 msgid "Microeconomics" msgstr "Micro-économie" #: ../data/functions.xml.in.h:761 msgid "Elasticity" msgstr "Élasticité" #: ../data/functions.xml.in.h:762 msgid "r:elasticity" msgstr "élasticité" #: ../data/functions.xml.in.h:763 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 "" "Calcule l'élasticité de la demande. Fonctionne également pour l'élasticité " "de l'offre, de revenu, de prix croisés, etc. Remplacez simplement demande " "par offre, ou prix par revenu... Ex. elasticity(100-x^2, 3) calcule " "l'élasticité de la demande quand le prix est 3 pour la fonction \"Q = 100 - " "x^2\" où x est la variable de prix par défaut." #: ../data/functions.xml.in.h:764 msgid "Demand function" msgstr "Fonction de la demande" #: ../data/functions.xml.in.h:765 msgid "Price" msgstr "Prix" #: ../data/functions.xml.in.h:766 msgid "Price variable" msgstr "Variable de prix" #: ../data/functions.xml.in.h:767 msgid "Consumer Surplus" msgstr "Plus-value du Consommateur" #: ../data/functions.xml.in.h:768 msgid "r:csurplus" msgstr "" #: ../data/functions.xml.in.h:769 msgid "Supply function or price" msgstr "" #: ../data/functions.xml.in.h:770 msgid "Quantity variabel" msgstr "Variable de quantité" #: ../data/functions.xml.in.h:771 msgid "Producer Surplus" msgstr "Surplus du Producteur" #: ../data/functions.xml.in.h:772 msgid "r:psurplus" msgstr "" #: ../data/functions.xml.in.h:773 msgid "Supply function" msgstr "" #: ../data/functions.xml.in.h:774 msgid "Demand function or price" msgstr "Fonction de la demande ou prix" #: ../data/functions.xml.in.h:775 msgid "Finance" msgstr "" #: ../data/functions.xml.in.h:776 msgid "Sum-of-Years Digits Depreciation" msgstr "" #: ../data/functions.xml.in.h:777 msgid "r:syd" msgstr "" #: ../data/functions.xml.in.h:778 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 "" "Calcule la dépréciation d'un actif d'après son coût, sa valeur résiduelle, " "sa durée prévue et une période particulière. Cette méthode accélère le taux " "de dépréciation, ainsi les frais de dépréciation sont plus importants dans " "les premières périodes que dans les dernières. Le coût amortissable est la " "valeur réelle moins la valeur résiduelle. La vie utile est le nombre de " "périodes (typiquement années) pendant lesquelles les actifs sont dépréciés." #: ../data/functions.xml.in.h:779 msgid "Cost" msgstr "Coût" #: ../data/functions.xml.in.h:780 msgid "Salvage value" msgstr "" #: ../data/functions.xml.in.h:781 msgid "Life" msgstr "Vie" #: ../data/functions.xml.in.h:782 msgid "Period" msgstr "Période" #: ../data/functions.xml.in.h:783 msgid "Straight Line Depreciation" msgstr "" #: ../data/functions.xml.in.h:784 msgid "r:sln" msgstr "" #: ../data/functions.xml.in.h:785 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 "" "Calcule la dépréciation linéaire d'un actif pour une période. Le " "coût est le montant pour lequel vous avez payé pour l'actif. La valeur " "résiduelle est la valeur de l'actif à la fin de la période. La vie est le " "nombre de périodes pendant lesquelles l'actif est déprécié." #: ../data/functions.xml.in.h:786 msgid "Present Value" msgstr "Valeur Actuelle" #: ../data/functions.xml.in.h:787 msgid "r:pv" msgstr "" #: ../data/functions.xml.in.h:788 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 "" "Retourne la valeur actuelle d'un investissement. Si type = 1 alors " "le paiement est fait au début de la période, si type = 0 (ou omis) il est " "fait à la fin de chaque période." #: ../data/functions.xml.in.h:789 msgid "Interest rate" msgstr "Taux d'intérêt" #: ../data/functions.xml.in.h:790 msgid "Number of periods" msgstr "Nombre de périodes" #: ../data/functions.xml.in.h:791 msgid "Payment made each period" msgstr "Versement effectué à chaque période" #: ../data/functions.xml.in.h:792 msgid "Future value" msgstr "Valeur future" #: ../data/functions.xml.in.h:793 msgid "Type" msgstr "" #: ../data/functions.xml.in.h:794 msgid "Nominal Interest Rate" msgstr "Taux d'Intérêt Nominal" #: ../data/functions.xml.in.h:795 msgid "r:nominal" msgstr "" #: ../data/functions.xml.in.h:796 msgid "" "Calculates the nominal interest rate from a given effective interest rate " "compounded at given intervals." msgstr "" "Calcule le taux d'intérêt nominal pour un taux d'intérêt effectif donné " "composé à des intervalles donnés." #: ../data/functions.xml.in.h:797 msgid "Effective interest rate" msgstr "Taux d'intérêt effectif" #: ../data/functions.xml.in.h:798 msgid "Periods" msgstr "Périodes" #: ../data/functions.xml.in.h:799 msgid "Zero Coupon" msgstr "" #: ../data/functions.xml.in.h:800 msgid "r:zero_coupon" msgstr "" #: ../data/functions.xml.in.h:801 msgid "Calculates the value of a zero-coupon (pure discount) bond." msgstr "" #: ../data/functions.xml.in.h:802 msgid "Face value" msgstr "Valeur nominale" #: ../data/functions.xml.in.h:803 msgid "Treasury Bill Yield" msgstr "" #: ../data/functions.xml.in.h:804 msgid "r:tbillyield" msgstr "" #: ../data/functions.xml.in.h:805 msgid "Returns the yield for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:806 msgid "Settlement date" msgstr "" #: ../data/functions.xml.in.h:807 msgid "Maturity date" msgstr "Échéance" #: ../data/functions.xml.in.h:808 msgid "Price per $100 face value" msgstr "Prix pour 100 $ de valeur faciale" #: ../data/functions.xml.in.h:809 msgid "Treasury Bill Price" msgstr "" #: ../data/functions.xml.in.h:810 msgid "r:tbillprice" msgstr "" #: ../data/functions.xml.in.h:811 msgid "Returns the price per $100 value for a treasury bill." msgstr "Retourne le prix pour 100 $ de valeur de bons du trésor." #: ../data/functions.xml.in.h:812 msgid "Discount rate" msgstr "Taux d'actualisation" #: ../data/functions.xml.in.h:813 msgid "Treasury Bill Equivalent" msgstr "" #: ../data/functions.xml.in.h:814 msgid "r:tbilleq" msgstr "" #: ../data/functions.xml.in.h:815 msgid "Returns the bond equivalent for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:816 msgid "Interest paid on a given period of an investment (ISPMT)" msgstr "Intérêt payé pour une période donnée d'un investissement" #: ../data/functions.xml.in.h:817 msgid "r:ispmt" msgstr "" #: ../data/functions.xml.in.h:818 msgid "Calculates the interest paid on a given period of an investment." msgstr "Calcule l'intérêt d'un investissement payé sur une période donnée." #: ../data/functions.xml.in.h:819 msgid "Periodic interest rate" msgstr "" #: ../data/functions.xml.in.h:820 msgid "Amortizement period" msgstr "Période d'amortissement" #: ../data/functions.xml.in.h:821 msgid "Present value" msgstr "Valeur actuelle" #: ../data/functions.xml.in.h:822 msgid "Payment for a loan" msgstr "Versement pour un emprunt" #: ../data/functions.xml.in.h:823 msgid "r:pmt" msgstr "" #: ../data/functions.xml.in.h:824 #, fuzzy 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. Note that the " "interest rate here refers to the rate for each period and if you calculate " "with an annual rate, each period will be interpreted as a whole year (to get " "monthly payments, divide the result by 12)." msgstr "" "Retourne le montant des versements d'un emprunt basé sur un taux d'intérêt " "constant (tous les versements sont égaux). Si type = 1 alors le " "paiement est réalisé en début de période, si type = 0 (ou omis) il est fait " "en fin de chaque période." #: ../data/functions.xml.in.h:825 msgid "Rate" msgstr "" #: ../data/functions.xml.in.h:826 msgid "Periods of an investment" msgstr "" #: ../data/functions.xml.in.h:827 msgid "r:nper" msgstr "" #: ../data/functions.xml.in.h:828 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 "" "Calcule le nombre de périodes d'un investissement reposant sur des paiements " "périodiques constants et un taux d'intérêt constant.. Le type " "définit l'échéance. 1 pour paiement en début de période et 0 (par défaut) " "pour paiement en fin de période." #: ../data/functions.xml.in.h:829 msgid "Duration" msgstr "Durée" #: ../data/functions.xml.in.h:830 msgid "r:duration" msgstr "durée" #: ../data/functions.xml.in.h:831 msgid "Calculates the duration of a security." msgstr "Calcule la durée d'une obligation." #: ../data/functions.xml.in.h:833 #, no-c-format msgid "Annual coupon rate (%)" msgstr "Taux de coupon annuel (%)" #: ../data/functions.xml.in.h:835 #, no-c-format msgid "Annualized yield (%)" msgstr "Revenu annualisé" #. Reccurance #: ../data/functions.xml.in.h:837 msgid "Frequency" msgstr "Fréquence" #: ../data/functions.xml.in.h:838 msgid "Periods for investment to attain desired value" msgstr "" #: ../data/functions.xml.in.h:839 msgid "r:g_duration" msgstr "" #: ../data/functions.xml.in.h:840 msgid "" "Returns the number of periods needed for an investment to attain a desired " "value." msgstr "" "Retourne le nombre de périodes nécessaires à un investissement pour " "atteindre un valeur désirée." #: ../data/functions.xml.in.h:841 msgid "Payment of an annuity going towards principal (PPMT)" msgstr "Versements d'une rente orientée vers le capital" #: ../data/functions.xml.in.h:842 msgid "r:ppmt" msgstr "" #: ../data/functions.xml.in.h:843 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 "" "Calcule le montant des versements d'une rente orientée vers le capital. " " Le type définit la date de paiement. 1 pour des paiements en début de " "période et 0 (par défaut) pour des paiements en fin de période." #: ../data/functions.xml.in.h:844 msgid "Desired future value" msgstr "Valeur future souhaitée" #: ../data/functions.xml.in.h:845 msgid "Effective Interest Rate" msgstr "Taux d'intérêt effectif" #: ../data/functions.xml.in.h:846 msgid "r:effect" msgstr "effet" #: ../data/functions.xml.in.h:847 msgid "Calculates the effective interest for a given nominal rate." msgstr "Calcule l'intérêt effectif pour un taux nominal donné." #: ../data/functions.xml.in.h:848 msgid "Nominal interest rate" msgstr "Taux d'intérêt nominal" #: ../data/functions.xml.in.h:849 msgid "Future Value" msgstr "Valeur Future" #: ../data/functions.xml.in.h:850 msgid "r:fv" msgstr "" #: ../data/functions.xml.in.h:851 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 "" "Calcule la valeur future d'un investissement. Cela est basé sur des " "paiements constants périodiques et un taux d'intérêt constant. Si " "le type = 1 alors le paiement est effectué au début de chaque période; si le " "type = 0 (ou omis), il a lieu à la fin de chaque période." #: ../data/functions.xml.in.h:852 msgid "Return on continuously compounded interest" msgstr "Retour sur intérêt continûment composé" #: ../data/functions.xml.in.h:853 msgid "r:continuous" msgstr "" #: ../data/functions.xml.in.h:854 msgid "" "Calculates the return on continuously compounded interest, given the " "principal, nominal rate and time in years." msgstr "" "Calcule le retour sur intérêt composé continument, étant donnés le taux " "nominal principal et la durée en années." #: ../data/functions.xml.in.h:855 msgid "Principal" msgstr "Capital" #: ../data/functions.xml.in.h:856 msgid "Compound" msgstr "Composé" #: ../data/functions.xml.in.h:857 msgid "r:compound" msgstr "" #: ../data/functions.xml.in.h:858 msgid "" "Returns the value of an investment, given the principal, nominal interest " "rate, compounding frequency and time." msgstr "" #: ../data/functions.xml.in.h:859 msgid "Periods per year" msgstr "" #: ../data/functions.xml.in.h:860 msgid "Payment of an annuity going towards interest (IPMT)" msgstr "Versements d'une rente orientée vers les intérêts" #: ../data/functions.xml.in.h:861 msgid "r:ipmt" msgstr "" #: ../data/functions.xml.in.h:862 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 "" "Calcule le montant des versements d'une rente orientée vers les intérêts." " Le type définit la date de paiement. 1 pour des paiements en début " "de période et 0 (par défaut) pour des paiements en fin de période." #: ../data/functions.xml.in.h:863 msgid "Interest rate for a fully invested security" msgstr "Taux d'intérêt d'une obligation entièrement investie" #: ../data/functions.xml.in.h:864 msgid "r:intrate" msgstr "" #: ../data/functions.xml.in.h:865 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 "" "Retourne le taux d'intérêt pour une obligation entièrement investie. La base " "est les manière de compter les jours que vous souhaitez utiliser : 0 : US " "30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours réels/365 " "or 4: Européenne 30/360.La date de contrat doit être antérieure à l'échéance." #: ../data/functions.xml.in.h:866 msgid "Investment" msgstr "Investissement" #: ../data/functions.xml.in.h:867 msgid "Redemption" msgstr "Amortissement" #: ../data/functions.xml.in.h:868 msgid "Dollar Fraction" msgstr "Fraction en dollars" #: ../data/functions.xml.in.h:869 msgid "r:dollarfr" msgstr "" #: ../data/functions.xml.in.h:870 msgid "" "Converts a decimal dollar price into a dollar price expressed as a fraction." msgstr "" "Convertit un prix en dollars décimaux en un prix en dollars sous forme de " "fraction." #: ../data/functions.xml.in.h:871 msgid "Decimal dollar" msgstr "Dollar décimal" #: ../data/functions.xml.in.h:872 msgid "Denominator of fraction" msgstr "Dénominateur d'une fraction" #: ../data/functions.xml.in.h:873 msgid "Dollar Decimal" msgstr "Dollar décimal" #: ../data/functions.xml.in.h:874 msgid "r:dollarde" msgstr "" #: ../data/functions.xml.in.h:875 msgid "" "Converts a dollar price expressed as a fraction into a dollar price " "expressed as a decimal number." msgstr "" "Convertit en prix en dollars sous forme de fraction en un prix en dollars " "décimaux." #: ../data/functions.xml.in.h:876 msgid "Fractional dollar" msgstr "Dollar fractionnaire" #: ../data/functions.xml.in.h:877 msgid "Amount received at maturity for a security bond" msgstr "Montant reçu à maturité par un bon de sécurité" #: ../data/functions.xml.in.h:878 msgid "r:received" msgstr "" #: ../data/functions.xml.in.h:879 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 "" "Retourne le montant reçu à échéance pour un investissement en obligation. La " "base est les manière de compter les jours que vous souhaitez utiliser : 0 : " "US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours " "réels/365 or 4: Européenne 30/360.La date de contrat doit être antérieure à " "l'échéance." #: ../data/functions.xml.in.h:880 msgid "Discount rate for a security" msgstr "Taux d'actualisation d'une obligation" #: ../data/functions.xml.in.h:881 msgid "r:disc" msgstr "" #: ../data/functions.xml.in.h:882 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:883 #, fuzzy msgid "Accrued interest of security paying at maturity" msgstr "Intérêt de sécurité cumulé payé à maturité" #: ../data/functions.xml.in.h:884 msgid "r:accrintm" msgstr "" #: ../data/functions.xml.in.h:885 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 "" "Retourne les intérêts cumulés d'une obligation dont le versement à lieu à " "échéance. La base est les manière de compter les jours que vous souhaitez " "utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, " "3: jours réels/365 or 4: Européenne 30/360." #: ../data/functions.xml.in.h:886 msgid "Issue date" msgstr "Date de fin" #: ../data/functions.xml.in.h:887 msgid "Annual rate of security" msgstr "Taux de sécurité annuel" #: ../data/functions.xml.in.h:888 msgid "Par value" msgstr "Montant nominal" #: ../data/functions.xml.in.h:889 #, fuzzy msgid "Accrued interest of security with periodic interest payments" msgstr "Intérêt de sécurité cumulé avec paiements périodiques" #: ../data/functions.xml.in.h:890 msgid "r:accrint" msgstr "" #: ../data/functions.xml.in.h:891 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 "" "Retourne les intérêts cumulés pour une obligation dont les versements sont " "périodiques. Les fréquences autorisées sont 1 - annuelle, 2 - " "semestrielle ou 4 - trimestrielle. La base est les manière de compter les " "jours que vous souhaitez utiliser : 0 : US 30/360 (par défaut), 1 : jours " "réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 30/360." #: ../data/functions.xml.in.h:892 msgid "First interest" msgstr "Premier intérêt" #: ../data/functions.xml.in.h:893 msgid "Number of coupons to be paid" msgstr "Nombre de coupons à payer" #: ../data/functions.xml.in.h:894 msgid "r:coupnum" msgstr "" #: ../data/functions.xml.in.h:895 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 "" "Retourne le nombre de coupons à payer entre la date de transaction et " "l'échéance. La base est les manière de compter les jours que vous souhaitez " "utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, " "3: jours réels/365 or 4: Européenne 30/360.La date de contrat doit être " "antérieure à l'échéance." #: ../data/functions.xml.in.h:896 #, fuzzy msgid "Price per $100 face value of a discounted security" msgstr "Prix pour 100 $ de valeur faciale d'une obligation" #: ../data/functions.xml.in.h:897 msgid "r:pricedisc" msgstr "" #: ../data/functions.xml.in.h:898 #, fuzzy msgid "" "Calculates and returns the price per $100 face value of a discounted " "security. 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 "" "Calcule et retourne le prix par bon d'obligation de 100$ de valeur faciale. " "L'obligation ne paie pas d'intérêt à maturité. La base est la " "manière de compter les jours que vous souhaitez utiliser : 0: US 30/360 " "(par défaut), 1: jours réels, 2: jours réels/360, 3: jours réels/365 or 4: " "Européenne 30/360." #: ../data/functions.xml.in.h:899 msgid "Discount" msgstr "Escompte" #: ../data/functions.xml.in.h:900 msgid "Price per $100 face value of a security" msgstr "Prix pour 100 $ de valeur faciale d'une obligation" #: ../data/functions.xml.in.h:901 msgid "r:pricemat" msgstr "" #: ../data/functions.xml.in.h:902 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 "" "Calcule et retourne le prix par obligation de 100$ de valeur faciale. " "L'obligation paie des intérêts à maturité. La base est la manière " "de compter les jours que vous souhaitez utiliser : 0: US 30/360 (par " "défaut), 1: jours réels, 2: jours réels/360, 3: jours réels/365 or 4: " "Européenne 30/360." #: ../data/functions.xml.in.h:903 msgid "Annual yield" msgstr "Revenu annuel" #: ../data/functions.xml.in.h:904 msgid "Level-Coupon Bond" msgstr "" #: ../data/functions.xml.in.h:905 msgid "r:level_coupon" msgstr "" #: ../data/functions.xml.in.h:906 msgid "Calculates the value of a level-coupon bond." msgstr "" #: ../data/functions.xml.in.h:907 msgid "Coupon rate" msgstr "Taux du coupon" #: ../data/functions.xml.in.h:908 msgid "Coupons per year" msgstr "Coupons par an" #: ../data/functions.xml.in.h:909 msgid "Market interest rate" msgstr "Taux d'intérêt du marché" #: ../data/planets.xml.in.h:1 msgid "Earth" msgstr "Terre" #: ../data/planets.xml.in.h:2 msgid "Mars" msgstr "" #. Planet #: ../data/planets.xml.in.h:4 msgid "!planets!Mercury" msgstr "Mercure" #: ../data/planets.xml.in.h:5 msgid "Venus" msgstr "Vénus" #: ../data/planets.xml.in.h:6 msgid "Jupiter" msgstr "" #: ../data/planets.xml.in.h:7 msgid "Saturn" msgstr "Saturne" #: ../data/planets.xml.in.h:8 msgid "Neptune" msgstr "" #: ../data/planets.xml.in.h:9 msgid "Pluto" msgstr "Pluton" #: ../data/planets.xml.in.h:10 msgid "Uranus" msgstr "" #. Unit category #: ../data/units.xml.in.h:2 msgid "!units!Length" msgstr "Longueur" #: ../data/units.xml.in.h:3 msgid "Meter" msgstr "Mètre" #: ../data/units.xml.in.h:4 msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "" #: ../data/units.xml.in.h:5 msgid "Kilometer" msgstr "Kilomètre" #: ../data/units.xml.in.h:6 msgid "Decimeter" msgstr "Décimètre" #: ../data/units.xml.in.h:7 msgid "Centimeter" msgstr "Centimètre" #: ../data/units.xml.in.h:8 msgid "Millimeter" msgstr "Millimètre" #: ../data/units.xml.in.h:9 msgid "Nautical Mile" msgstr "" #: ../data/units.xml.in.h:10 msgid "r:nautical_mile,p:nautical_miles" msgstr "" #: ../data/units.xml.in.h:11 msgid "Ångström" msgstr "" #: ../data/units.xml.in.h:12 msgid "aru:Å,u:ångström,angstrom" msgstr "" #: ../data/units.xml.in.h:13 msgid "U.S. Survey Inch" msgstr "" #: ../data/units.xml.in.h:14 msgid "ar:US_in,US_inch,p:US_inches" msgstr "" #: ../data/units.xml.in.h:15 msgid "Inch" msgstr "Pouce" #: ../data/units.xml.in.h:16 msgid "ar:in,inch,p:inches" msgstr "" #: ../data/units.xml.in.h:17 msgid "Hand" msgstr "" #: ../data/units.xml.in.h:18 msgid "r:hand,p:hands" msgstr "" #: ../data/units.xml.in.h:19 msgid "Foot" msgstr "Pied" #: ../data/units.xml.in.h:20 msgid "ar:ft,foot,p:feet" msgstr "" #: ../data/units.xml.in.h:21 msgid "U.S. Survey Foot" msgstr "" #: ../data/units.xml.in.h:22 msgid "ar:US_ft,US_foot,p:US_feet" msgstr "" #: ../data/units.xml.in.h:23 msgid "Link" msgstr "" #: ../data/units.xml.in.h:24 msgid "ar:li,link,p:links" msgstr "" #: ../data/units.xml.in.h:25 msgid "Yard" msgstr "" #: ../data/units.xml.in.h:26 msgid "ar:yd,yard,p:yards" msgstr "" #: ../data/units.xml.in.h:27 msgid "Rod (pole/perch)" msgstr "" #: ../data/units.xml.in.h:28 msgid "ar:rd,rod,p:rods" msgstr "" #: ../data/units.xml.in.h:29 msgid "Fathom" msgstr "" #: ../data/units.xml.in.h:30 msgid "r:fathom,p:fathoms" msgstr "" #: ../data/units.xml.in.h:31 msgid "Chain" msgstr "" #: ../data/units.xml.in.h:32 msgid "ar:ch,chain,p:chains" msgstr "" #: ../data/units.xml.in.h:33 msgid "Furlong" msgstr "" #: ../data/units.xml.in.h:34 msgid "ar:fur,furlong,p:furlongs" msgstr "" #: ../data/units.xml.in.h:35 msgid "Mile" msgstr "Mile" #: ../data/units.xml.in.h:36 msgid "ar:mi,mile,p:miles" msgstr "" #: ../data/units.xml.in.h:37 msgid "U.S. Survey Mile" msgstr "" #: ../data/units.xml.in.h:38 msgid "ar:US_mi,US_mile,p:US_miles" msgstr "" #: ../data/units.xml.in.h:39 msgid "Mil (1/1000 in)" msgstr "" #: ../data/units.xml.in.h:40 msgid "r:mil,p:mils" msgstr "" #: ../data/units.xml.in.h:41 msgid "Astronomical Unit" msgstr "Unité Astronomique" #: ../data/units.xml.in.h:42 msgid "ar:AU,astronomical_unit,p:astronomical_units" msgstr "unité_astronomique,p:unités_astronomiques" #: ../data/units.xml.in.h:43 msgid "Light Year" msgstr "Année Lumière" #: ../data/units.xml.in.h:44 msgid "ar:ly,lightyear,p:lightyears" msgstr "" #: ../data/units.xml.in.h:45 msgid "Parsec" msgstr "" #: ../data/units.xml.in.h:46 msgid "ar:pc,parsec,p:parsecs" msgstr "" #: ../data/units.xml.in.h:47 msgid "Pied du roi (French Royal Foot)" msgstr "" #: ../data/units.xml.in.h:48 msgid "r:pied_du_roi" msgstr "" #: ../data/units.xml.in.h:49 msgid "Pouce (French Royal Inch)" msgstr "" #: ../data/units.xml.in.h:50 msgid "r:pouce" msgstr "" #: ../data/units.xml.in.h:51 msgid "Ligne" msgstr "" #: ../data/units.xml.in.h:52 msgid "r:ligne" msgstr "" #: ../data/units.xml.in.h:53 msgid "Toise" msgstr "" #: ../data/units.xml.in.h:54 msgid "r:toise" msgstr "" #. Unit category #: ../data/units.xml.in.h:56 msgid "!units!Angle" msgstr "Angle" #: ../data/units.xml.in.h:57 msgid "Plane Angle" msgstr "Angle Plan" #: ../data/units.xml.in.h:58 msgid "Meter per Meter" msgstr "Mètre par Mètre" #: ../data/units.xml.in.h:59 msgid "Radian" msgstr "" #: ../data/units.xml.in.h:60 msgid "ar:rad,radian,p:radians" msgstr "" #: ../data/units.xml.in.h:61 msgid "Degree" msgstr "Degré" #: ../data/units.xml.in.h:62 msgid "ar:deg,au:°,degree,p:degrees" msgstr "" #: ../data/units.xml.in.h:63 msgid "Gradian (Gon)" msgstr "" #: ../data/units.xml.in.h:64 msgid "ar:gra,gradian,p:gradians,gon,p:gons" msgstr "" #: ../data/units.xml.in.h:65 msgid "Arcminute" msgstr "" #: ../data/units.xml.in.h:66 msgid "r:arcminute,p:arcminutes" msgstr "" #: ../data/units.xml.in.h:67 msgid "Arcsecond" msgstr "" #: ../data/units.xml.in.h:68 msgid "r:arcsecond,p:arcseconds" msgstr "" #: ../data/units.xml.in.h:69 msgid "Turn" msgstr "" #: ../data/units.xml.in.h:70 msgid "r:turn,p:turns" msgstr "" #: ../data/units.xml.in.h:71 msgid "Solid Angle" msgstr "Angle Solide" #: ../data/units.xml.in.h:72 msgid "Square Meter per Square Meter" msgstr "Mètre Carré par Mètre Carré" #: ../data/units.xml.in.h:73 msgid "Steradian" msgstr "" #: ../data/units.xml.in.h:74 msgid "ar:sr,steradian,p:steradians" msgstr "" #: ../data/units.xml.in.h:75 msgid "Angular Acceleration" msgstr "Accélération Angulaire" #: ../data/units.xml.in.h:76 msgid "Radians per Second Squared" msgstr "Radians par Seconde Carrée" #: ../data/units.xml.in.h:77 msgid "Angular Velocity" msgstr "" #: ../data/units.xml.in.h:78 msgid "Radians per Second" msgstr "Radians par Seconde" #. Unit category #: ../data/units.xml.in.h:80 msgid "!units!Mass" msgstr "Masse" #: ../data/units.xml.in.h:81 msgid "Gram" msgstr "Gramme" #: ../data/units.xml.in.h:82 msgid "ar:g,gram,p:grams" msgstr "" #: ../data/units.xml.in.h:83 msgid "Kilogram" msgstr "Kilogramme" #: ../data/units.xml.in.h:84 msgid "Hectogram" msgstr "Hectogramme" #: ../data/units.xml.in.h:85 msgid "Metric Ton (Tonne)" msgstr "Tonne Métrique (Tonne)" #: ../data/units.xml.in.h:86 msgid "ar:t,tonne,p:tonnes,ton,p:tons" msgstr "" #: ../data/units.xml.in.h:87 msgid "Grain" msgstr "" #: ../data/units.xml.in.h:88 msgid "ar:gr,grain,p:grains" msgstr "" #: ../data/units.xml.in.h:89 msgid "Pennyweight" msgstr "" #: ../data/units.xml.in.h:90 msgid "ar:pwt,pennyweight,p:pennyweights" msgstr "" #: ../data/units.xml.in.h:91 msgid "Ounce (troy)" msgstr "" #: ../data/units.xml.in.h:92 msgid "ar:oz_t,troy_ounce,p:troy_ounces" msgstr "" #: ../data/units.xml.in.h:93 msgid "Pound (troy)" msgstr "" #: ../data/units.xml.in.h:94 msgid "ar:lb_t,troy_pound,p:troy_pounds" msgstr "" #: ../data/units.xml.in.h:95 msgid "Dram" msgstr "" #: ../data/units.xml.in.h:96 msgid "ar:dr,dram,p:drams" msgstr "" #: ../data/units.xml.in.h:97 msgid "Ounce" msgstr "" #: ../data/units.xml.in.h:98 msgid "ar:oz,ounce,p:ounces" msgstr "" #: ../data/units.xml.in.h:99 msgid "Pound" msgstr "" #: ../data/units.xml.in.h:100 msgid "ar:lb,pound,p:pounds" msgstr "" #: ../data/units.xml.in.h:101 msgid "Short Hundredweight" msgstr "" #: ../data/units.xml.in.h:102 msgid "ar:cwt,hundredweight,p:hundredweights" msgstr "" #: ../data/units.xml.in.h:103 msgid "Long Hundredweight" msgstr "" #: ../data/units.xml.in.h:104 msgid "ar:l_cwt,long_hundredweight,p:long_hundredweights" msgstr "" #: ../data/units.xml.in.h:105 msgid "Short Ton" msgstr "" #: ../data/units.xml.in.h:106 msgid "ar:s_ton,short_ton,p:short_tons" msgstr "" #: ../data/units.xml.in.h:107 msgid "Long Ton" msgstr "" #: ../data/units.xml.in.h:108 msgid "ar:l_ton,long_ton,p:long_tons" msgstr "" #: ../data/units.xml.in.h:109 msgid "Stone" msgstr "" #: ../data/units.xml.in.h:110 msgid "r:stone,p:stones" msgstr "" #: ../data/units.xml.in.h:111 msgid "Cental" msgstr "" #: ../data/units.xml.in.h:112 msgid "r:cental,p:centals" msgstr "" #: ../data/units.xml.in.h:113 msgid "Carat" msgstr "" #: ../data/units.xml.in.h:114 msgid "r:carat,p:carats" msgstr "" #: ../data/units.xml.in.h:115 msgid "Pfund" msgstr "" #: ../data/units.xml.in.h:116 msgid "r:pfund" msgstr "" #: ../data/units.xml.in.h:117 msgid "Zentner" msgstr "" #: ../data/units.xml.in.h:118 msgid "r:zentner" msgstr "" #: ../data/units.xml.in.h:120 msgid "Kilogram per Cubic Meter" msgstr "Kilogramme par Mètre Cube" #: ../data/units.xml.in.h:121 msgid "Gram per Cubic Decimeter" msgstr "Gramme par Décimètre Cube" #: ../data/units.xml.in.h:122 msgid "Gram per Cubic Centimeter" msgstr "Gramme par Centimètre Cube" #: ../data/units.xml.in.h:123 msgid "Atomic Mass" msgstr "Masse Atomique" #: ../data/units.xml.in.h:124 msgid "Gram per Mole" msgstr "Gramme par Mole" #: ../data/units.xml.in.h:125 msgid "Atomic Mass Unit" msgstr "Unité de Masse Atomique" #: ../data/units.xml.in.h:126 msgid "ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units" msgstr "" #: ../data/units.xml.in.h:127 msgid "Dalton" msgstr "" #: ../data/units.xml.in.h:128 msgid "ar:Da,dalton,p:daltons" msgstr "" #: ../data/units.xml.in.h:129 msgid "Kilodalton" msgstr "" #: ../data/units.xml.in.h:130 msgid "Mass Fraction" msgstr "" #: ../data/units.xml.in.h:131 msgid "Kilogram per Kilogram" msgstr "Kilogramme par Kilogramme" #: ../data/units.xml.in.h:133 msgid "Second" msgstr "Seconde" #: ../data/units.xml.in.h:134 msgid "ar:s,second,p:seconds" msgstr "" #: ../data/units.xml.in.h:135 msgid "Minute" msgstr "" #: ../data/units.xml.in.h:136 msgid "ar:min,minute,p:minutes" msgstr "" #: ../data/units.xml.in.h:137 msgid "Hour" msgstr "Heure" #: ../data/units.xml.in.h:138 msgid "ar:h,hour,p:hours" msgstr "" #: ../data/units.xml.in.h:139 msgid "Day" msgstr "Jour" #: ../data/units.xml.in.h:140 msgid "ar:d,day,p:days" msgstr "jour,p:jours" #: ../data/units.xml.in.h:141 msgid "Week" msgstr "Semaine" #: ../data/units.xml.in.h:142 msgid "r:week,p:weeks" msgstr "" #: ../data/units.xml.in.h:143 msgid "Fortnight" msgstr "" #: ../data/units.xml.in.h:144 msgid "r:fortnight,p:fortnights" msgstr "" #: ../data/units.xml.in.h:145 msgid "Julian Year" msgstr "" #: ../data/units.xml.in.h:146 msgid "r:year,p:years" msgstr "" #. Unit category #: ../data/units.xml.in.h:148 msgid "!units!Frequency" msgstr "Fréquence" #: ../data/units.xml.in.h:149 msgid "Hertz" msgstr "" #: ../data/units.xml.in.h:150 msgid "ar:Hz,hertz" msgstr "" #: ../data/units.xml.in.h:151 msgid "Electricity" msgstr "Électricité" #: ../data/units.xml.in.h:152 msgid "Electric Current" msgstr "Courant Électrique" #: ../data/units.xml.in.h:153 msgid "Ampere" msgstr "Ampère" #: ../data/units.xml.in.h:154 msgid "ar:A,ampere,p:amperes" msgstr "ampère,p:ampères" #: ../data/units.xml.in.h:155 msgid "Abampere" msgstr "" #: ../data/units.xml.in.h:156 msgid "r:abampere,a:abA,a:aA,p:abamperes" msgstr "" #: ../data/units.xml.in.h:157 msgid "Current Density" msgstr "Densité de Courant" #: ../data/units.xml.in.h:158 msgid "Ampere per Meter Squared" msgstr "Ampère par mètre Carré" #: ../data/units.xml.in.h:159 msgid "Electric Charge" msgstr "Charge Électrique" #: ../data/units.xml.in.h:160 msgid "Second Ampere" msgstr "Ampère Seconde" #: ../data/units.xml.in.h:161 msgid "Coulomb" msgstr "" #: ../data/units.xml.in.h:162 msgid "ar:C,coulomb,p:coulombs" msgstr "" #: ../data/units.xml.in.h:163 msgid "Abcoulomb" msgstr "" #: ../data/units.xml.in.h:164 msgid "r:abcoulomb,p:abcoulombs,a:abC,a:aC" msgstr "" #: ../data/units.xml.in.h:165 msgid "Statcoloumb (Franklin)" msgstr "" #: ../data/units.xml.in.h:166 msgid "r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins" msgstr "" #: ../data/units.xml.in.h:167 msgid "Electric Charge Density" msgstr "Densité de Charge Électrique" #: ../data/units.xml.in.h:168 msgid "Coulomb per Cubic Meter" msgstr "Coulomb par Mètre Cube" #: ../data/units.xml.in.h:169 msgid "Electric Flux Density" msgstr "" #: ../data/units.xml.in.h:170 msgid "Coulomb per Meter Squared" msgstr "Coulomb par Mètre Carré" #: ../data/units.xml.in.h:171 msgid "Electric Potential" msgstr "Potentiel Électrique" #: ../data/units.xml.in.h:172 msgid "Watt per Ampere" msgstr "Watt par Ampère" #: ../data/units.xml.in.h:173 msgid "Volt" msgstr "" #: ../data/units.xml.in.h:174 msgid "ar:V,volt,p:volts" msgstr "" #: ../data/units.xml.in.h:175 msgid "Statvolt" msgstr "" #: ../data/units.xml.in.h:176 msgid "r:statvolt,p:statvolts,a:statV" msgstr "" #: ../data/units.xml.in.h:177 msgid "Abvolt" msgstr "" #: ../data/units.xml.in.h:178 msgid "r:abvolt,p:abvolts,a:abV" msgstr "" #: ../data/units.xml.in.h:179 msgid "Capacitance" msgstr "" #: ../data/units.xml.in.h:180 msgid "Coulomb per Volt" msgstr "Coulomb par Volt" #: ../data/units.xml.in.h:181 msgid "Farad" msgstr "" #: ../data/units.xml.in.h:182 msgid "ar:F,farad,p:farads" msgstr "" #: ../data/units.xml.in.h:183 msgid "Electric Resistance" msgstr "Résistance Électrique" #: ../data/units.xml.in.h:184 msgid "Volt per Ampere" msgstr "Volt par Ampère" #: ../data/units.xml.in.h:185 msgid "Ohm" msgstr "" #: ../data/units.xml.in.h:186 msgid "au:Ω,r:ohm,p:ohms" msgstr "" #: ../data/units.xml.in.h:187 msgid "Abohm" msgstr "" #: ../data/units.xml.in.h:188 msgid "r:abohm,p:abohms,au:abΩ" msgstr "" #: ../data/units.xml.in.h:189 msgid "Statohm" msgstr "" #: ../data/units.xml.in.h:190 msgid "r:statohm,p:statohms,au:statΩ" msgstr "" #: ../data/units.xml.in.h:191 msgid "Electric Conductance" msgstr "Conductance Électrique" #: ../data/units.xml.in.h:192 msgid "Ampere per Volt" msgstr "Ampère par Volt" #: ../data/units.xml.in.h:193 msgid "Siemens" msgstr "" #: ../data/units.xml.in.h:194 msgid "ar:S,siemens" msgstr "" #: ../data/units.xml.in.h:195 msgid "Electric Field Strength" msgstr "" #: ../data/units.xml.in.h:196 msgid "Volt per Meter" msgstr "Volt par Mètre" #: ../data/units.xml.in.h:197 msgid "Permittivity" msgstr "Permittivité" #: ../data/units.xml.in.h:198 msgid "Farad per Meter" msgstr "Farad par mètre" #: ../data/units.xml.in.h:199 msgid "Inductance" msgstr "" #: ../data/units.xml.in.h:200 msgid "Weber per Ampere" msgstr "" #: ../data/units.xml.in.h:201 msgid "Henry" msgstr "" #: ../data/units.xml.in.h:202 msgid "ar:H,henry,p:henrys" msgstr "" #: ../data/units.xml.in.h:203 msgid "Permeability" msgstr "" #: ../data/units.xml.in.h:204 msgid "Henry per Meter" msgstr "Henry par Mètre" #: ../data/units.xml.in.h:205 msgid "Temperature" msgstr "Température" #: ../data/units.xml.in.h:206 msgid "Kelvin" msgstr "" #: ../data/units.xml.in.h:207 msgid "ar:K,kelvin,p:kelvins" msgstr "" #: ../data/units.xml.in.h:208 msgid "Degree Celsius" msgstr "Degré Celsius" #: ../data/units.xml.in.h:209 msgid "" "ar:oC,au:°C,au:℃,r:celsius,p:celsius,centigrade,p:centigrades" msgstr "" #: ../data/units.xml.in.h:210 msgid "Degree Rankine" msgstr "Degrés Rankine" #: ../data/units.xml.in.h:211 msgid "ar:oR,au:°R,r:rankine" msgstr "" #: ../data/units.xml.in.h:212 msgid "Degree Fahrenheit" msgstr "Degrés Fahrenheit" #: ../data/units.xml.in.h:213 msgid "ar:oF,au:°F,au:℉,r:fahrenheit" msgstr "" #: ../data/units.xml.in.h:214 msgid "Substance" msgstr "" #: ../data/units.xml.in.h:215 msgid "Mole" msgstr "Mole" #: ../data/units.xml.in.h:216 msgid "ar:mol,mole,p:moles" msgstr "" #: ../data/units.xml.in.h:217 msgid "Einstein" msgstr "" #: ../data/units.xml.in.h:218 msgid "r:einstein,p:einsteins" msgstr "" #: ../data/units.xml.in.h:219 msgid "Substance Concentration" msgstr "" #: ../data/units.xml.in.h:220 msgid "Mole per Cubic Meter" msgstr "Mole par Mètre Cube" #: ../data/units.xml.in.h:221 msgid "Catalytic Activity" msgstr "Activité Catalytique" #: ../data/units.xml.in.h:222 msgid "Reciprocal Seconds Mole" msgstr "" #: ../data/units.xml.in.h:223 msgid "Katal" msgstr "" #: ../data/units.xml.in.h:224 msgid "ar:kat,katal,p:katals" msgstr "" #: ../data/units.xml.in.h:225 msgid "Catalytic Concentration" msgstr "Concentration Catalytique" #: ../data/units.xml.in.h:226 msgid "Katal per Cubic Meter" msgstr "" #: ../data/units.xml.in.h:227 msgid "Light" msgstr "Lumière" #: ../data/units.xml.in.h:228 msgid "Luminous Intensity" msgstr "Intensité Lumineuse" #: ../data/units.xml.in.h:229 msgid "Candela" msgstr "" #: ../data/units.xml.in.h:230 msgid "ar:cd,candela,p:candelas" msgstr "" #: ../data/units.xml.in.h:231 msgid "Luminance" msgstr "" #: ../data/units.xml.in.h:232 msgid "Candela per Meter Squared" msgstr "Candela par mètre carré" #: ../data/units.xml.in.h:233 msgid "Stilb" msgstr "" #: ../data/units.xml.in.h:234 msgid "ar:sb,stilb,p:stilbs" msgstr "" #: ../data/units.xml.in.h:235 msgid "Luminous Flux" msgstr "Flux Lumineux" #: ../data/units.xml.in.h:236 msgid "Candela Steradian" msgstr "" #: ../data/units.xml.in.h:237 msgid "Lumen" msgstr "" #: ../data/units.xml.in.h:238 msgid "ar:lm,lumen,p:lumens" msgstr "" #: ../data/units.xml.in.h:239 msgid "Illuminance" msgstr "" #: ../data/units.xml.in.h:240 msgid "Lumen per Meter Squared" msgstr "" #: ../data/units.xml.in.h:241 msgid "Lumen per Foot Squared" msgstr "" #: ../data/units.xml.in.h:242 msgid "Lux" msgstr "" #: ../data/units.xml.in.h:243 msgid "ar:lx,lux" msgstr "" #: ../data/units.xml.in.h:244 msgid "Foot-Candle" msgstr "" #: ../data/units.xml.in.h:245 msgid "ar:fc,footcandle,p:footcandles" msgstr "" #: ../data/units.xml.in.h:246 msgid "Phot" msgstr "" #: ../data/units.xml.in.h:247 msgid "ar:ph,phot,p:phots" msgstr "" #: ../data/units.xml.in.h:248 msgid "Radiant Intensity" msgstr "" #: ../data/units.xml.in.h:249 msgid "Watt per Steradian" msgstr "Watt par Stéradian" #: ../data/units.xml.in.h:250 msgid "Irradiance" msgstr "" #: ../data/units.xml.in.h:251 msgid "Watt per Meter Squared" msgstr "Watt par Mètre Carré" #: ../data/units.xml.in.h:252 msgid "Einstein per Meter Squared per Second" msgstr "Einstein par Mètre Carré par Seconde" #: ../data/units.xml.in.h:253 msgid "Microeinstein per Meter Squared per Second" msgstr "Microeinstein par Mètre Carré par Seconde" #: ../data/units.xml.in.h:254 msgid "Radiance" msgstr "" #: ../data/units.xml.in.h:255 msgid "Watt per Square Meter Steradian" msgstr "Watt par Mètre Carré Stéradian" #: ../data/units.xml.in.h:256 msgid "Area" msgstr "Aire" #: ../data/units.xml.in.h:257 msgid "Square Meter" msgstr "Mètre Carré" #: ../data/units.xml.in.h:258 msgid "Square Kilometer" msgstr "Kilomètre Carré" #: ../data/units.xml.in.h:259 msgid "Are" msgstr "" #: ../data/units.xml.in.h:260 msgid "ar:a,are,p:ares" msgstr "" #: ../data/units.xml.in.h:261 msgid "Hectare" msgstr "" #: ../data/units.xml.in.h:262 msgid "Barn" msgstr "" #: ../data/units.xml.in.h:263 msgid "ar:b,barn,p:barns" msgstr "" #: ../data/units.xml.in.h:264 msgid "Rood" msgstr "" #: ../data/units.xml.in.h:265 msgid "r:rood,p:roods" msgstr "" #: ../data/units.xml.in.h:266 msgid "Acre" msgstr "" #: ../data/units.xml.in.h:267 msgid "r:acre,p:acres" msgstr "" #: ../data/units.xml.in.h:268 msgid "Section" msgstr "" #: ../data/units.xml.in.h:269 msgid "r:section,p:sections" msgstr "" #: ../data/units.xml.in.h:270 msgid "Township" msgstr "" #: ../data/units.xml.in.h:271 msgid "r:township,p:townships" msgstr "" #: ../data/units.xml.in.h:272 msgid "Square Foot" msgstr "Pied Carré" #: ../data/units.xml.in.h:273 msgid "Square Inch" msgstr "Pouce Carré" #: ../data/units.xml.in.h:274 msgid "Square Mile" msgstr "Mile Carrée" #: ../data/units.xml.in.h:275 msgid "Volume" msgstr "" #: ../data/units.xml.in.h:276 msgid "Cubic Meter" msgstr "Mètre Cube" #: ../data/units.xml.in.h:277 msgid "Liter" msgstr "Litre" #: ../data/units.xml.in.h:278 msgid "ar:L,a:l,liter,p:liters,litre,p:litres" msgstr "litre,p:litres" #: ../data/units.xml.in.h:279 msgid "Milliliter" msgstr "Millilitre" #: ../data/units.xml.in.h:280 msgid "Centiliter" msgstr "Centilitre" #: ../data/units.xml.in.h:281 msgid "Deciliter" msgstr "Décilitre" #: ../data/units.xml.in.h:282 msgid "Cubic Inch" msgstr "Pouce Cube" #: ../data/units.xml.in.h:283 msgid "Fuel Economy" msgstr "" #: ../data/units.xml.in.h:284 msgid "Liter per Kilometer" msgstr "Litre par Kilomètre" #: ../data/units.xml.in.h:285 msgid "Kilometer per Liter" msgstr "Kilomètre par Litre" #: ../data/units.xml.in.h:286 msgid "Miles per Gallon" msgstr "Miles par Gallon" #: ../data/units.xml.in.h:287 msgid "a-cr:mpg" msgstr "" #: ../data/units.xml.in.h:288 msgid "Cooking" msgstr "Cuisine" #: ../data/units.xml.in.h:289 msgid "Teaspoon" msgstr "" #: ../data/units.xml.in.h:290 msgid "r:teaspoon,p:teaspoons" msgstr "" #: ../data/units.xml.in.h:291 msgid "Dessertspoon" msgstr "Cuillère à Dessert" #: ../data/units.xml.in.h:292 msgid "r:dessertspoon,p:dessertspoons" msgstr "" #: ../data/units.xml.in.h:293 msgid "Tablespoon" msgstr "" #: ../data/units.xml.in.h:294 msgid "r:tablespoon,p:tablespoons" msgstr "" #: ../data/units.xml.in.h:295 msgid "Cup" msgstr "Tasse" #: ../data/units.xml.in.h:296 msgid "r:cup,p:cups" msgstr "" #: ../data/units.xml.in.h:297 msgid "Imperial Capacity" msgstr "" #: ../data/units.xml.in.h:298 msgid "Imperial Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:299 msgid "ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces" msgstr "" #: ../data/units.xml.in.h:300 msgid "Imperial Gill" msgstr "" #: ../data/units.xml.in.h:301 msgid "ar:UK_gi,imperial_gill,p:imperial_gills" msgstr "" #: ../data/units.xml.in.h:302 msgid "Imperial Pint" msgstr "" #: ../data/units.xml.in.h:303 msgid "ar:UK_pt,imperial_pint,p:imperial_pints" msgstr "" #: ../data/units.xml.in.h:304 msgid "Imperial Quart" msgstr "" #: ../data/units.xml.in.h:305 msgid "ar:UK_qt,imperial_quart,p:imperial_quarts" msgstr "" #: ../data/units.xml.in.h:306 msgid "Imperial Gallon" msgstr "" #: ../data/units.xml.in.h:307 msgid "ar:UK_gal,imperial_gallon,p:imperial_gallons" msgstr "" #: ../data/units.xml.in.h:308 msgid "Imperial Minim" msgstr "" #: ../data/units.xml.in.h:309 msgid "r:imperial_minim,p:imperial_minims" msgstr "" #: ../data/units.xml.in.h:310 msgid "Imperial Fluid Scuple" msgstr "" #: ../data/units.xml.in.h:311 msgid "r:imperial_fluid_scuple,p:imperial_fluid_scuples" msgstr "" #: ../data/units.xml.in.h:312 msgid "Imperial Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:313 msgid "ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms" msgstr "" #: ../data/units.xml.in.h:314 msgid "Imperial Bushel" msgstr "" #: ../data/units.xml.in.h:315 msgid "ar:UK_bu,imperial_bushel,p:imperial_bushels" msgstr "" #: ../data/units.xml.in.h:316 msgid "U.S. Capacity" msgstr "" #: ../data/units.xml.in.h:317 msgid "U.S. Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:318 msgid "ar:fl_oz,fluid_ounce,p:fluid_ounces" msgstr "" #: ../data/units.xml.in.h:319 msgid "U.S. Gill" msgstr "" #: ../data/units.xml.in.h:320 msgid "ar:gi,gill,p:gills" msgstr "" #: ../data/units.xml.in.h:321 msgid "U.S. Liquid Pints" msgstr "" #: ../data/units.xml.in.h:322 msgid "ar:liq_pt,liquid_pint,p:liquid_pints" msgstr "" #: ../data/units.xml.in.h:323 msgid "U.S. Liquid Quarts" msgstr "" #: ../data/units.xml.in.h:324 msgid "ar:liq_qt,liquid_quart,p:liquid_quarts" msgstr "" #: ../data/units.xml.in.h:325 msgid "U.S. Minim" msgstr "" #: ../data/units.xml.in.h:326 msgid "r:minim,p:minims" msgstr "" #: ../data/units.xml.in.h:327 msgid "U.S. Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:328 msgid "ar:fl_dr,fluid_drachm,p:fluid_drachms" msgstr "" #: ../data/units.xml.in.h:329 msgid "U.S. Dry Pint" msgstr "" #: ../data/units.xml.in.h:330 msgid "ar:dry_pt,dry_pint,p:dry_pints" msgstr "" #: ../data/units.xml.in.h:331 msgid "U.S. Dry Quart" msgstr "" #: ../data/units.xml.in.h:332 msgid "ar:dry_qt,dry_quart,p:dry_quarts" msgstr "" #: ../data/units.xml.in.h:333 msgid "U.S. Peck" msgstr "" #: ../data/units.xml.in.h:334 msgid "ar:pk,peck,p:pecks" msgstr "" #: ../data/units.xml.in.h:335 msgid "U.S. Bushel" msgstr "" #: ../data/units.xml.in.h:336 msgid "ar:bu,bushel,p:bushels" msgstr "" #: ../data/units.xml.in.h:337 msgid "U.S. Gallon" msgstr "" #: ../data/units.xml.in.h:338 msgid "ar:gal,gallon,p:gallons" msgstr "" #: ../data/units.xml.in.h:339 msgid "U.S. Barrel (oil)" msgstr "" #: ../data/units.xml.in.h:340 msgid "ar:bbl,barrel,p:barrels" msgstr "" #: ../data/units.xml.in.h:341 msgid "Specific Volume" msgstr "" #: ../data/units.xml.in.h:342 msgid "Cubic Meter per Kilogram" msgstr "Mètre Cube par Kilogramme" #: ../data/units.xml.in.h:343 msgid "Speed" msgstr "Vitesse" #: ../data/units.xml.in.h:344 msgid "Meter per Second" msgstr "Mètre par Seconde" #: ../data/units.xml.in.h:345 msgid "Kilometer per Hour" msgstr "Kilomètre par Heure" #: ../data/units.xml.in.h:346 msgid "Nautical Mile per Hour" msgstr "" #: ../data/units.xml.in.h:347 msgid "Knot" msgstr "Noeud" #: ../data/units.xml.in.h:348 msgid "r:knot,p:knots" msgstr "" #: ../data/units.xml.in.h:349 msgid "Miles per Hour" msgstr "Miles par Heure" #: ../data/units.xml.in.h:350 msgid "a-cr:mph" msgstr "" #: ../data/units.xml.in.h:351 msgid "Acceleration" msgstr "Accélération" #: ../data/units.xml.in.h:352 msgid "Meter per Second Squared" msgstr "Mètre par Seconde Carrée" #: ../data/units.xml.in.h:353 msgid "Galileo" msgstr "" #: ../data/units.xml.in.h:354 msgid "ar:Gal,galileo,p:galileos" msgstr "" #: ../data/units.xml.in.h:355 msgid "Gee" msgstr "" #: ../data/units.xml.in.h:356 msgid "r:gee,p:gees" msgstr "" #: ../data/units.xml.in.h:357 msgid "Magnetism" msgstr "Magnétisme" #: ../data/units.xml.in.h:358 msgid "Wave Number" msgstr "" #: ../data/units.xml.in.h:359 msgid "Reciprocal Meter" msgstr "" #: ../data/units.xml.in.h:360 msgid "Magnetic Field Strength" msgstr "" #: ../data/units.xml.in.h:361 msgid "Ampere per Meter" msgstr "Ampère par mètre" #: ../data/units.xml.in.h:362 msgid "Oersted" msgstr "" #: ../data/units.xml.in.h:363 msgid "ar:Oe,oersted,p:oersteds" msgstr "" #: ../data/units.xml.in.h:364 msgid "Magnetic Flux" msgstr "Flux Magnétique" #: ../data/units.xml.in.h:365 msgid "Volt Seconds" msgstr "Volt Seconde" #: ../data/units.xml.in.h:366 msgid "Weber" msgstr "" #: ../data/units.xml.in.h:367 msgid "ar:Wb,weber,p:webers" msgstr "" #: ../data/units.xml.in.h:368 msgid "Maxwell" msgstr "" #: ../data/units.xml.in.h:369 msgid "ar:Mx,maxwell,p:maxwells" msgstr "" #: ../data/units.xml.in.h:370 msgid "Magnetic Flux Density" msgstr "Densité de Flux Magnétique" #: ../data/units.xml.in.h:371 msgid "Weber per Meter Squared" msgstr "" #: ../data/units.xml.in.h:372 msgid "Tesla" msgstr "" #: ../data/units.xml.in.h:373 msgid "ar:T,tesla,p:teslas" msgstr "" #: ../data/units.xml.in.h:374 msgid "Gauss" msgstr "" #: ../data/units.xml.in.h:375 msgid "r:gauss" msgstr "" #: ../data/units.xml.in.h:376 msgid "Force" msgstr "" #: ../data/units.xml.in.h:377 msgid "Meter Kilogram per Second Squared" msgstr "Mètre Kilogramme par Seconde Carrée" #: ../data/units.xml.in.h:378 msgid "Newton" msgstr "" #: ../data/units.xml.in.h:379 msgid "ar:N,newton,p:newtons" msgstr "" #: ../data/units.xml.in.h:380 msgid "Dyne" msgstr "" #: ../data/units.xml.in.h:381 msgid "ar:dyn,dyne,p:dynes" msgstr "" #: ../data/units.xml.in.h:382 msgid "Pound-force" msgstr "" #: ../data/units.xml.in.h:383 msgid "ar:lbf,pound_force" msgstr "" #: ../data/units.xml.in.h:384 msgid "Pound Foot per Second Squared" msgstr "" #: ../data/units.xml.in.h:385 msgid "Poundal" msgstr "" #: ../data/units.xml.in.h:386 msgid "r:poundal,p:poundals,a:pdl" msgstr "" #: ../data/units.xml.in.h:387 msgid "Pond (Gram-Force)" msgstr "" #: ../data/units.xml.in.h:388 msgid "r:pond,p:ponds,a:gf" msgstr "" #: ../data/units.xml.in.h:389 msgid "Kilopond (Kilogram-Force)" msgstr "" #: ../data/units.xml.in.h:390 msgid "Moment of Force" msgstr "Moment de Force" #: ../data/units.xml.in.h:391 msgid "Newton Meter" msgstr "Newton Mètre" #: ../data/units.xml.in.h:392 msgid "Pressure" msgstr "Pression" #: ../data/units.xml.in.h:393 msgid "Newton per Meter Squared" msgstr "Newton par Mètre Carré" #: ../data/units.xml.in.h:394 msgid "Pound-force per Square Inch" msgstr "" #: ../data/units.xml.in.h:395 msgid "Pascal" msgstr "" #: ../data/units.xml.in.h:396 msgid "ar:Pa,pascal,p:pascals" msgstr "" #: ../data/units.xml.in.h:397 msgid "Pound-force per Square Inch (psi)" msgstr "" #: ../data/units.xml.in.h:398 msgid "a-cr:psi" msgstr "" #: ../data/units.xml.in.h:399 msgid "Bar" msgstr "" #: ../data/units.xml.in.h:400 msgid "r:bar,p:bars" msgstr "" #: ../data/units.xml.in.h:401 msgid "Atmosphere" msgstr "Atmosphère" #: ../data/units.xml.in.h:402 msgid "ar:atm,atmosphere,p:atmospheres" msgstr "atmosphère,p:atmosphères" #: ../data/units.xml.in.h:403 msgid "Torr" msgstr "" #: ../data/units.xml.in.h:404 msgid "r:torr,p:torrs" msgstr "" #: ../data/units.xml.in.h:405 msgid "Millimeter of Mercury" msgstr "Millimètre de Mercure" #: ../data/units.xml.in.h:406 msgid "ar:mmHg" msgstr "" #: ../data/units.xml.in.h:407 #, fuzzy msgid "Inch of Mercury" msgstr "Millimètre de Mercure" #: ../data/units.xml.in.h:408 msgid "ar:inHg" msgstr "" #: ../data/units.xml.in.h:409 msgid "Dynamic Viscosity" msgstr "Viscosité Dynamique" #: ../data/units.xml.in.h:410 msgid "Pascal Second" msgstr "Pascal Seconde" #: ../data/units.xml.in.h:411 msgid "Poise" msgstr "" #: ../data/units.xml.in.h:412 msgid "ar:P,poise,p:poises" msgstr "" #: ../data/units.xml.in.h:413 msgid "Kinematic Viscosity" msgstr "" #: ../data/units.xml.in.h:414 msgid "Square Meter per Second" msgstr "Mètre Carré par Seconde" #: ../data/units.xml.in.h:415 msgid "Stokes" msgstr "" #: ../data/units.xml.in.h:416 msgid "ar:St,stokes" msgstr "" #: ../data/units.xml.in.h:417 msgid "Surface Tension" msgstr "" #: ../data/units.xml.in.h:418 msgid "Newton per Meter" msgstr "Newton par Mètre" #: ../data/units.xml.in.h:419 msgid "Energy" msgstr "Énergie" #: ../data/units.xml.in.h:420 msgid "Joule" msgstr "" #: ../data/units.xml.in.h:421 msgid "ar:J,joule,p:joules" msgstr "" #: ../data/units.xml.in.h:422 msgid "Watt Hour" msgstr "Watt Heure" #: ../data/units.xml.in.h:423 msgid "Kilowatt Hour" msgstr "Kilowatt Heure" #: ../data/units.xml.in.h:424 msgid "Calorie (international table)" msgstr "" #: ../data/units.xml.in.h:425 msgid "ais:cal_IT,ar:cal,c:calorie,cp:calories" msgstr "" #: ../data/units.xml.in.h:426 msgid "Calorie (capital C)" msgstr "" #: ../data/units.xml.in.h:427 msgid "cr:Calorie,cp:Calories" msgstr "" #: ../data/units.xml.in.h:428 msgid "Calorie (thermochemical)" msgstr "" #: ../data/units.xml.in.h:429 msgid "ars:cal_th" msgstr "" #: ../data/units.xml.in.h:430 msgid "Gram of TNT" msgstr "" #: ../data/units.xml.in.h:431 msgid "a-cr:gTNT,gramTNT" msgstr "" #: ../data/units.xml.in.h:432 msgid "Ton of TNT" msgstr "" #: ../data/units.xml.in.h:433 msgid "a-cr:tTNT,tonTNT" msgstr "" #: ../data/units.xml.in.h:434 msgid "Calorie (15 degrees Celsius)" msgstr "Calorie (15°C)" #: ../data/units.xml.in.h:435 msgid "ars:cal_fifteen" msgstr "" #: ../data/units.xml.in.h:436 msgid "Calorie (mean)" msgstr "Calorie (moyenne)" #: ../data/units.xml.in.h:437 msgid "ars:cal_mean" msgstr "" #: ../data/units.xml.in.h:438 msgid "British Thermal Unit (IT)" msgstr "" #: ../data/units.xml.in.h:439 msgid "ar:Btu" msgstr "" #: ../data/units.xml.in.h:440 msgid "Electron Volt" msgstr "Électron Volt" #: ../data/units.xml.in.h:441 msgid "ar:eV,electron_volt,p:electron_volts" msgstr "" #: ../data/units.xml.in.h:442 msgid "Erg" msgstr "" #: ../data/units.xml.in.h:443 msgid "r:erg,p:ergs" msgstr "" #: ../data/units.xml.in.h:444 msgid "Foe" msgstr "" #: ../data/units.xml.in.h:445 msgid "r:foe,p:foes" msgstr "" #: ../data/units.xml.in.h:446 msgid "Foot-Pound Force" msgstr "" #: ../data/units.xml.in.h:447 msgid "Hartree" msgstr "" #: ../data/units.xml.in.h:448 msgid "ar:Ha,as:E_h,hartree" msgstr "" #: ../data/units.xml.in.h:449 msgid "Rydberg" msgstr "" #: ../data/units.xml.in.h:450 msgid "ar:Ry,s:rydberg_unit" msgstr "" #: ../data/units.xml.in.h:451 msgid "Specific Energy" msgstr "" #: ../data/units.xml.in.h:452 msgid "Joule per Kilogram" msgstr "Joule par Kilogramme" #: ../data/units.xml.in.h:453 msgid "Power" msgstr "Puissance" #: ../data/units.xml.in.h:454 msgid "Joule per Second" msgstr "Joule par Seconde" #: ../data/units.xml.in.h:455 msgid "Watt" msgstr "" #: ../data/units.xml.in.h:456 msgid "ar:W,watt,p:watts" msgstr "" #: ../data/units.xml.in.h:457 msgid "Horse Power" msgstr "" #: ../data/units.xml.in.h:458 msgid "ar:hp,horsepower,p:horsepowers" msgstr "" #: ../data/units.xml.in.h:459 msgid "Pferdestärke" msgstr "" #: ../data/units.xml.in.h:460 msgid "ar:PS,u:pferdestärke" msgstr "" #: ../data/units.xml.in.h:461 msgid "Entropy" msgstr "Entropie" #: ../data/units.xml.in.h:462 msgid "Joule per Kelvin" msgstr "Joule par Kelvin" #: ../data/units.xml.in.h:463 msgid "Specific Entropy" msgstr "" #: ../data/units.xml.in.h:464 msgid "Joule per Kilogram Kelvin" msgstr "Joule par Kilogramme Kelvin" #: ../data/units.xml.in.h:465 msgid "Thermal Conductivity" msgstr "Conductivité Thermique" #: ../data/units.xml.in.h:466 msgid "Watt per Meter Kelvin" msgstr "Watt par Mètre Kelvin" #: ../data/units.xml.in.h:467 msgid "Energy Density" msgstr "Densité d'Énergie" #: ../data/units.xml.in.h:468 msgid "Joule per Cubic Meter" msgstr "Joule par Mètre Cube" #: ../data/units.xml.in.h:469 msgid "Molar Energy" msgstr "Énergie Molaire" #: ../data/units.xml.in.h:470 msgid "Joule per Mole" msgstr "Joule par Mole" #: ../data/units.xml.in.h:471 msgid "Molar Entropy" msgstr "Entropie Molaire" #: ../data/units.xml.in.h:472 msgid "Joule per Mole Kelvin" msgstr "Joule par Mole Kelvin" #: ../data/units.xml.in.h:473 msgid "Radioactivity" msgstr "Radioactivité" #: ../data/units.xml.in.h:474 msgid "Becquerel" msgstr "" #: ../data/units.xml.in.h:475 msgid "ar:Bq,becquerel,p:becquerels" msgstr "" #: ../data/units.xml.in.h:476 msgid "Curie" msgstr "" #: ../data/units.xml.in.h:477 msgid "ar:Ci,curie,p:curies" msgstr "" #: ../data/units.xml.in.h:478 msgid "Absorbed Dose" msgstr "Dose Absorbée" #: ../data/units.xml.in.h:479 msgid "Gray" msgstr "" #: ../data/units.xml.in.h:480 msgid "ar:Gy,gray,p:grays" msgstr "" #: ../data/units.xml.in.h:481 msgid "Rad" msgstr "" #: ../data/units.xml.in.h:482 msgid "r:rad_radioactivity" msgstr "" #: ../data/units.xml.in.h:483 msgid "Dose Equivalent" msgstr "" #: ../data/units.xml.in.h:484 msgid "Sievert" msgstr "" #: ../data/units.xml.in.h:485 msgid "ar:Sv,sievert,p:sieverts" msgstr "" #: ../data/units.xml.in.h:486 msgid "Rem" msgstr "" #: ../data/units.xml.in.h:487 msgid "r:rem_radioactivity" msgstr "" #: ../data/units.xml.in.h:488 msgid "Exposure" msgstr "" #: ../data/units.xml.in.h:489 msgid "Coulomb per Kilogram" msgstr "Coulomb par Kilogramme" #: ../data/units.xml.in.h:490 msgid "Roentgen" msgstr "" #: ../data/units.xml.in.h:491 msgid "ar:R,roentgen,p:roentgens" msgstr "" #: ../data/units.xml.in.h:492 msgid "Absorbed Dose Rate" msgstr "" #: ../data/units.xml.in.h:493 msgid "Gray per Second" msgstr "Gray par Seconde" #: ../data/units.xml.in.h:494 msgid "Ratio" msgstr "" #: ../data/units.xml.in.h:495 msgid "Neper" msgstr "" #: ../data/units.xml.in.h:496 msgid "ar:Np,neper,p:nepers" msgstr "" #: ../data/units.xml.in.h:497 msgid "Bel" msgstr "" #: ../data/units.xml.in.h:498 msgid "ar:B,bel,p:bels" msgstr "" #: ../data/units.xml.in.h:499 msgid "Decibel" msgstr "Décibel" #: ../data/units.xml.in.h:500 msgid "Information" msgstr "" #: ../data/units.xml.in.h:501 msgid "Bit" msgstr "" #: ../data/units.xml.in.h:502 msgid "r:bit,p:bits" msgstr "" #: ../data/units.xml.in.h:503 msgid "Byte (8-bit)" msgstr "Octet (8 bits)" #: ../data/units.xml.in.h:504 msgid "r:byte,p:bytes,octet,p:octets" msgstr "" #: ../data/units.xml.in.h:505 msgid "Nibble" 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 "Tribble" msgstr "" #: ../data/units.xml.in.h:508 msgid "r:tribble,p:tribbles" msgstr "" #: ../data/units.xml.in.h:509 msgid "Word (16-bit)" msgstr "Mot (16 bits)" #: ../data/units.xml.in.h:510 msgid "r:word,p:words" msgstr "" #: ../data/units.xml.in.h:511 msgid "Kilobyte" msgstr "Kiloctet" #: ../data/units.xml.in.h:512 msgid "Kibibyte" msgstr "Kibioctet" #: ../data/units.xml.in.h:513 msgid "Mebibyte" msgstr "Mébioctet" #: ../data/units.xml.in.h:514 msgid "Gibibyte" msgstr "Gibioctet" #: ../data/units.xml.in.h:515 msgid "Megabyte" msgstr "Mégaoctet" #: ../data/units.xml.in.h:516 msgid "Gigabyte" msgstr "Gigaoctet" #: ../data/units.xml.in.h:517 msgid "Terabyte" msgstr "Téraoctet" #: ../data/units.xml.in.h:518 msgid "Kilobit" msgstr "" #: ../data/units.xml.in.h:519 msgid "Kibibit" msgstr "" #: ../data/units.xml.in.h:520 msgid "Mebibit" msgstr "Mébibit" #: ../data/units.xml.in.h:521 msgid "Gibibit" msgstr "" #: ../data/units.xml.in.h:522 msgid "Megabit" msgstr "Mégabit" #: ../data/units.xml.in.h:523 msgid "Gigabit" msgstr "" #: ../data/units.xml.in.h:524 msgid "Terabit" msgstr "Térabit" #: ../data/units.xml.in.h:525 msgid "Typography" msgstr "" #: ../data/units.xml.in.h:526 msgid "PostScript Point" msgstr "" #: ../data/units.xml.in.h:527 msgid "ar:pt,a:pts,point,p:points" msgstr "" #: ../data/units.xml.in.h:528 msgid "PostScript Pica" msgstr "" #: ../data/units.xml.in.h:529 msgid "r:pica,p:picas" msgstr "" #: ../data/units.xml.in.h:530 msgid "ATA Pica" msgstr "" #: ../data/units.xml.in.h:531 msgid "r:ata_pica,p:ata_picas" msgstr "" #: ../data/units.xml.in.h:532 msgid "ATA Point" msgstr "" #: ../data/units.xml.in.h:533 msgid "r:ata_point,a:ata_pt,p:ata_points" msgstr "" #: ../data/units.xml.in.h:534 msgid "New Didot Point" msgstr "" #: ../data/units.xml.in.h:535 msgid "r:new_didot" msgstr "" #: ../data/units.xml.in.h:536 msgid "Didot Point" msgstr "" #: ../data/units.xml.in.h:537 msgid "r:didot,a:dd" msgstr "" #: ../data/units.xml.in.h:538 msgid "Cicero" msgstr "" #: ../data/units.xml.in.h:539 #, fuzzy msgid "r:cicero" msgstr "cercle" #: ../data/variables.xml.in.h:1 msgid "Small Numbers" msgstr "" #: ../data/variables.xml.in.h:2 msgid "Per Mille" msgstr "" #: ../data/variables.xml.in.h:3 msgid "r:permille,au:‰" msgstr "pourmille,au:‰" #: ../data/variables.xml.in.h:4 msgid "Per Myriad" msgstr "" #: ../data/variables.xml.in.h:5 msgid "r:permyriad,au:‱" msgstr "" #: ../data/variables.xml.in.h:6 msgid "Percent" msgstr "" #: ../data/variables.xml.in.h:8 #, no-c-format msgid "a:%,r:percent" msgstr "a:%,pourcent" #: ../data/variables.xml.in.h:9 msgid "Large Numbers" msgstr "Grands Nombres" #: ../data/variables.xml.in.h:10 msgid "Googolplex" msgstr "" #: ../data/variables.xml.in.h:11 msgid "r:googolplex" msgstr "" #: ../data/variables.xml.in.h:12 msgid "Googol" msgstr "" #: ../data/variables.xml.in.h:13 msgid "r:googol" msgstr "" #: ../data/variables.xml.in.h:14 msgid "Centillion" msgstr "" #: ../data/variables.xml.in.h:15 msgid "-r:centillion" msgstr "" #: ../data/variables.xml.in.h:16 msgid "Vigintillion" msgstr "" #: ../data/variables.xml.in.h:17 msgid "-r:vigintillion" msgstr "" #: ../data/variables.xml.in.h:18 msgid "Novemdecillion" msgstr "" #: ../data/variables.xml.in.h:19 msgid "-r:novemdecillion" msgstr "" #: ../data/variables.xml.in.h:20 msgid "Octodecillion" msgstr "" #: ../data/variables.xml.in.h:21 msgid "-r:octodecillion" msgstr "" #: ../data/variables.xml.in.h:22 msgid "Septendecillion" msgstr "" #: ../data/variables.xml.in.h:23 msgid "-r:septendecillion" msgstr "" #: ../data/variables.xml.in.h:24 msgid "Sexdecillion" msgstr "" #: ../data/variables.xml.in.h:25 msgid "-r:sexdecillion" msgstr "" #: ../data/variables.xml.in.h:26 msgid "Quindecillion" msgstr "" #: ../data/variables.xml.in.h:27 msgid "-r:quindecillion" msgstr "" #: ../data/variables.xml.in.h:28 msgid "Quattuordecillion" msgstr "" #: ../data/variables.xml.in.h:29 msgid "-r:quattuordecillion" msgstr "" #: ../data/variables.xml.in.h:30 msgid "Tredecillion" msgstr "" #: ../data/variables.xml.in.h:31 msgid "-r:tredecillion" msgstr "" #: ../data/variables.xml.in.h:32 msgid "Duodecillion" msgstr "" #: ../data/variables.xml.in.h:33 msgid "-r:duodecillion" msgstr "" #: ../data/variables.xml.in.h:34 msgid "Undecillion" msgstr "" #: ../data/variables.xml.in.h:35 msgid "-r:undecillion" msgstr "" #: ../data/variables.xml.in.h:36 msgid "Decillion" msgstr "" #: ../data/variables.xml.in.h:37 msgid "-r:decillion" msgstr "" #: ../data/variables.xml.in.h:38 msgid "Nonillion" msgstr "" #: ../data/variables.xml.in.h:39 msgid "-r:nonillion" msgstr "" #: ../data/variables.xml.in.h:40 msgid "Octillion" msgstr "" #: ../data/variables.xml.in.h:41 msgid "-r:octillion" msgstr "" #: ../data/variables.xml.in.h:42 msgid "Septillion" msgstr "" #: ../data/variables.xml.in.h:43 msgid "-r:septillion" msgstr "" #: ../data/variables.xml.in.h:44 msgid "Sextillion" msgstr "" #: ../data/variables.xml.in.h:45 msgid "-r:sextillion" msgstr "" #: ../data/variables.xml.in.h:46 msgid "Quintillion" msgstr "" #: ../data/variables.xml.in.h:47 msgid "-r:quintillion" msgstr "" #: ../data/variables.xml.in.h:48 msgid "Quadrillion" msgstr "" #: ../data/variables.xml.in.h:49 msgid "-r:quadrillion" msgstr "" #: ../data/variables.xml.in.h:50 msgid "Trillion" msgstr "" #: ../data/variables.xml.in.h:51 msgid "-r:trillion" msgstr "" #: ../data/variables.xml.in.h:52 msgid "Billion" msgstr "Milliard" #: ../data/variables.xml.in.h:53 msgid "-r:billion" msgstr "" #: ../data/variables.xml.in.h:54 msgid "Million" msgstr "Million" #: ../data/variables.xml.in.h:55 msgid "-r:million" msgstr "" #: ../data/variables.xml.in.h:56 msgid "Thousand" msgstr "" #: ../data/variables.xml.in.h:57 msgid "-r:thousand" msgstr "" #: ../data/variables.xml.in.h:58 msgid "Hundred" msgstr "" #: ../data/variables.xml.in.h:59 msgid "-r:hundred" msgstr "" #: ../data/variables.xml.in.h:60 msgid "Physical Constants" msgstr "Constantes Physiques" #: ../data/variables.xml.in.h:61 msgid "Universal Constants" msgstr "Constantes Universelles" #: ../data/variables.xml.in.h:62 msgid "Speed of Light in Vacuum" msgstr "Vitesse de la Lumière dans le Vide" #: ../data/variables.xml.in.h:63 msgid "ar:c,speed_of_light" msgstr "a:c,vitesse_de_la_lumière" #: ../data/variables.xml.in.h:64 msgid "Planck Time" msgstr "Temps de Planck" #: ../data/variables.xml.in.h:65 msgid "r:planck_time,ais:t_P" msgstr "" #: ../data/variables.xml.in.h:66 msgid "Planck Temperature" msgstr "Température de Planck" #: ../data/variables.xml.in.h:67 msgid "r:planck_temperature,ais:T_P" msgstr "température_de_planck,ais:T_P" #: ../data/variables.xml.in.h:68 msgid "Planck Mass" msgstr "Masse de Planck" #: ../data/variables.xml.in.h:69 msgid "r:planck_mass,ais:m_P" msgstr "masse_de_planck,ais:m_P" #: ../data/variables.xml.in.h:70 msgid "Planck Length" msgstr "Longueur de Planck" #: ../data/variables.xml.in.h:71 msgid "r:planck_length,ais:l_P" msgstr "longueur_de_planck,ais:l_P" #: ../data/variables.xml.in.h:72 msgid "Planck Constant" msgstr "Constantes de Planck" #: ../data/variables.xml.in.h:73 #, fuzzy msgid "r:planck,au:ℎ" msgstr "pourmille,au:‰" #: ../data/variables.xml.in.h:74 msgid "Planck Constant over 2 pi" msgstr "Constante de Planck sur 2 pi" #: ../data/variables.xml.in.h:75 #, fuzzy msgid "r:planck2pi,au:ℏ" msgstr "pourmille,au:‰" #: ../data/variables.xml.in.h:76 msgid "Newtonian Constant of Gravitation" msgstr "Constante de la Gravitation de Newton" #: ../data/variables.xml.in.h:77 msgid "r:newtonian_constant,a:G" msgstr "constante_de_newton,a:G" #: ../data/variables.xml.in.h:78 msgid "Electric Constant (Permittivity of Free Space)" msgstr "Constante Électrique (Permittivité du Vide)" #: ../data/variables.xml.in.h:79 msgid "r:electric_constant,aisu:ε_0" msgstr "" #: ../data/variables.xml.in.h:80 msgid "Magnetic Constant (Permeability of Free Space)" msgstr "Constante Magnétique (Perméabilité du Vide)" #: ../data/variables.xml.in.h:81 msgid "r:magnetic_constant,aisu:μ_0" msgstr "" #: ../data/variables.xml.in.h:82 msgid "Characteristic Impedance of Vacuum" msgstr "" #: ../data/variables.xml.in.h:83 msgid "r:characteristic_impedance,ais:Z_0" msgstr "impédance_caractéristique,ais:Z_0" #: ../data/variables.xml.in.h:84 msgid "Electromagnetic Constants" msgstr "Constantes Électromagnétiques" #: ../data/variables.xml.in.h:85 msgid "Bohr Magneton" msgstr "" #: ../data/variables.xml.in.h:86 msgid "r:bohr_magneton,aisu:μ_B" msgstr "magnéton_de_bohr,aisu:μ_B" #: ../data/variables.xml.in.h:87 msgid "Conductance Quantum" msgstr "" #: ../data/variables.xml.in.h:88 msgid "r:conductance_quantum,ais:G_0" msgstr "" #: ../data/variables.xml.in.h:89 msgid "Elementary Charge" msgstr "Charge Élémentaire" #: ../data/variables.xml.in.h:90 msgid "r:elementary_charge,ais:e_charge" msgstr "charge_élémentaire,ais:e_charge" #: ../data/variables.xml.in.h:91 msgid "Josephson Constant" msgstr "" #: ../data/variables.xml.in.h:92 msgid "r:josephson,ais:K_J" msgstr "" #: ../data/variables.xml.in.h:93 msgid "Magnetic Flux Quantum" msgstr "" #: ../data/variables.xml.in.h:94 msgid "r:magnetic_flux_quantum,aisu:Φ_0" msgstr "" #: ../data/variables.xml.in.h:95 msgid "Nuclear Magneton" msgstr "" #: ../data/variables.xml.in.h:96 msgid "r:nuclear_magneton,aisu:μ_N" msgstr "" #: ../data/variables.xml.in.h:97 msgid "von Klitzing Constant" msgstr "Constante de von Klitzing" #: ../data/variables.xml.in.h:98 msgid "r:klitzing,ais:R_K" msgstr "" #: ../data/variables.xml.in.h:99 msgid "Atomic and Nuclear Constants" msgstr "Constantes Atomiques et Nucléaires" #: ../data/variables.xml.in.h:100 msgid "Alpha Particle Mass" msgstr "" #: ../data/variables.xml.in.h:101 msgid "r:alpha_particle_mass,aisu:m_α" msgstr "masse_de_particule_alpha,aisu:m_α" #: ../data/variables.xml.in.h:102 msgid "Bohr Radius" msgstr "Rayon de Bohr" #: ../data/variables.xml.in.h:103 #, fuzzy msgid "r:bohr_radius,ais:a_0" msgstr "rayon_de_bohr,ais:a_o" #: ../data/variables.xml.in.h:104 msgid "Classical Electron Radius" msgstr "" #: ../data/variables.xml.in.h:105 msgid "r:classical_electron_radius,ais:r_e" msgstr "" #: ../data/variables.xml.in.h:106 msgid "Compton Wavelength" msgstr "" #: ../data/variables.xml.in.h:107 msgid "r:compton_wavelength,aisu:λ_C" msgstr "" #: ../data/variables.xml.in.h:108 msgid "Electron Mass" msgstr "Masse de l'Électron" #: ../data/variables.xml.in.h:109 msgid "r:electron_mass,ais:m_e" msgstr "masse_de_l'électron,ais:m_e" #: ../data/variables.xml.in.h:110 msgid "Helion Mass" msgstr "" #: ../data/variables.xml.in.h:111 msgid "r:helion_mass,ais:m_h" msgstr "" #: ../data/variables.xml.in.h:112 msgid "Neutron Mass" msgstr "Masse du Neutron" #: ../data/variables.xml.in.h:113 msgid "r:neutron_mass,ais:m_n" msgstr "masse_du_neutron,ais:m_n" #: ../data/variables.xml.in.h:114 msgid "Proton Mass" msgstr "Masse du Proton" #: ../data/variables.xml.in.h:115 msgid "r:proton_mass,ais:m_p" msgstr "masse_du_proton,ais:m_p" #: ../data/variables.xml.in.h:116 msgid "Rydberg Constant" msgstr "" #: ../data/variables.xml.in.h:117 msgid "r:rydberg,aisu:R_∞" msgstr "" #: ../data/variables.xml.in.h:118 msgid "Tau Mass" msgstr "" #: ../data/variables.xml.in.h:119 msgid "r:tau_mass,aisu:m_τ" msgstr "" #: ../data/variables.xml.in.h:120 msgid "Physico-Chemical Constants" msgstr "Constantes Physico-Chimiques" #: ../data/variables.xml.in.h:121 msgid "Atomic Mass Constant" msgstr "Constante de Masse Atomique" #: ../data/variables.xml.in.h:122 msgid "r:atomic_mass,ais:m_u" msgstr "masse_atomique,ais:m_u" #: ../data/variables.xml.in.h:123 msgid "Avogadro Constant" msgstr "Constante d'Avogadro" #: ../data/variables.xml.in.h:124 msgid "r:avogadro,ais:N_A" msgstr "" #: ../data/variables.xml.in.h:125 msgid "Boltzmann Constant" msgstr "Constante de Boltzmann" #: ../data/variables.xml.in.h:126 #, fuzzy msgid "r:boltzmann,ais:k_B" msgstr "magnéton_de_bohr,aisu:μ_B" #: ../data/variables.xml.in.h:127 msgid "Faraday Constant" msgstr "Constante de Faraday" #: ../data/variables.xml.in.h:128 msgid "r:faraday" msgstr "" #: ../data/variables.xml.in.h:129 msgid "First Radiation Constant" msgstr "" #: ../data/variables.xml.in.h:130 msgid "r:first_radiation,ais:c_1" msgstr "" #: ../data/variables.xml.in.h:131 msgid "Ideal Gas Constant" msgstr "Constante des Gaz Parfaits" #: ../data/variables.xml.in.h:132 msgid "r:ideal_gas" msgstr "" #: ../data/variables.xml.in.h:133 msgid "Second Radiation Constant" msgstr "" #: ../data/variables.xml.in.h:134 msgid "r:second_radiation,ais:c_2" msgstr "" #: ../data/variables.xml.in.h:135 msgid "Basic Constants" msgstr "Constantes Basiques" #: ../data/variables.xml.in.h:136 msgid "Golden Ratio" msgstr "Le Nombre d'Or" #: ../data/variables.xml.in.h:137 msgid "r:golden,au:φ" msgstr "" #: ../data/variables.xml.in.h:138 msgid "Omega Constant" msgstr "" #: ../data/variables.xml.in.h:139 msgid "r:omega" msgstr "" #: ../data/variables.xml.in.h:140 msgid "Pythagoras' Constant (sqrt 2)" msgstr "Constante de Pythagore (sqrt 2)" #: ../data/variables.xml.in.h:141 msgid "r:pythagoras" msgstr "pythagore" #: ../data/variables.xml.in.h:142 msgid "Apery's Constant" msgstr "" #: ../data/variables.xml.in.h:143 msgid "r:apery" msgstr "" #: ../data/variables.xml.in.h:144 msgid "Base of Natural Logarithms (e)" msgstr "La Base des Logarithmes Naturels (e)" #: ../data/variables.xml.in.h:145 msgid "r:e" msgstr "" #: ../data/variables.xml.in.h:146 msgid "Archimedes' Constant (pi)" msgstr "" #: ../data/variables.xml.in.h:147 msgid "au:π,r:pi" msgstr "" #: ../data/variables.xml.in.h:148 msgid "Euler's Constant" msgstr "Constante d'Euler" #: ../data/variables.xml.in.h:149 msgid "au:γ,r:euler" msgstr "" #: ../data/variables.xml.in.h:150 msgid "Catalan's Constant" msgstr "" #: ../data/variables.xml.in.h:151 msgid "r:catalan" msgstr "" #: ../data/variables.xml.in.h:152 msgid "Special Numbers" msgstr "" #: ../data/variables.xml.in.h:153 msgid "Imaginary i (sqrt -1)" msgstr "Nombre Imaginaire i (tel que i^2 = -1)" #: ../data/variables.xml.in.h:154 msgid "r:i" msgstr "" #: ../data/variables.xml.in.h:155 msgid "Infinity" msgstr "Infini" #: ../data/variables.xml.in.h:156 msgid "a:∞,r:infinity" msgstr "a:∞,infini" #: ../data/variables.xml.in.h:157 msgid "Positive Infinity" msgstr "Infini Positif" #: ../data/variables.xml.in.h:158 msgid "r:plus_infinity" msgstr "infini_positif" #: ../data/variables.xml.in.h:159 msgid "Negative Infinity" msgstr "Infini Négatif" #: ../data/variables.xml.in.h:160 msgid "r:minus_infinity" msgstr "infini_négatif" #: ../data/variables.xml.in.h:161 msgid "Undefined" msgstr "Indéfini" #: ../data/variables.xml.in.h:162 msgid "r:undefined" msgstr "indéfini" #: ../data/variables.xml.in.h:163 msgid "False" msgstr "Faux" #: ../data/variables.xml.in.h:164 msgid "r:false,r:no" msgstr "faux,non" #: ../data/variables.xml.in.h:165 msgid "True" msgstr "Vrai" #: ../data/variables.xml.in.h:166 msgid "r:true,r:yes" msgstr "vrai,oui" #: ../data/variables.xml.in.h:167 msgid "Unknowns" msgstr "Inconnues" #: ../data/variables.xml.in.h:168 msgid "r:x" msgstr "" #: ../data/variables.xml.in.h:169 msgid "r:y" msgstr "" #: ../data/variables.xml.in.h:170 msgid "r:z" msgstr "" #, fuzzy #~ msgid "Ionization Potential" #~ msgstr "Potentiel Électrique" #, fuzzy #~ msgid "r:ionization" #~ msgstr "r:inclinaison" #, fuzzy #~ msgid "Covalent Radius" #~ msgstr "Rayon de Bohr" #, fuzzy #~ msgid "r:covalent" #~ msgstr "colonne" #, fuzzy #~ msgid "Value 1 (n)" #~ msgstr "Valeur 1" #~ msgid "Derive" #~ msgstr "Dérivée" #~ msgid "Calculates the area of a circle using the diameter" #~ msgstr "Calcule l'aire d'un cercle d'après son diamètre" #~ msgid "Diameter" #~ msgstr "Diamètre" libqalculate-0.9.10/po-defs/sv.po0000644000175000017500000050332012727774615013536 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. # Hanna Knutsson , 2003. # msgid "" msgstr "" "Project-Id-Version: sv\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-06-14 14:33+0200\n" "PO-Revision-Date: 2007-06-15 11:13+0100\n" "Last-Translator: Hanna Knutsson \n" "Language-Team: Swedish\n" "Language: \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 "Currency" msgstr "Valuta" #: ../data/currencies.xml.in.h:2 msgid "European Euros" msgstr "Euro" #: ../data/currencies.xml.in.h:3 msgid "ar:EUR,au:€,euro,p:euros" msgstr "a:EUR,au:€,euro" #: ../data/currencies.xml.in.h:4 msgid "U.S. Dollars" msgstr "Amerikanska dollar" #: ../data/currencies.xml.in.h:5 msgid "a:$,ar:USD,dollar,p:dollars" msgstr "a:$,a:USD,dollar" #: ../data/currencies.xml.in.h:6 msgid "Japanese Yen" msgstr "Japanska yen" #: ../data/currencies.xml.in.h:7 msgid "ar:JPY,au:¥,yen" msgstr "" #: ../data/currencies.xml.in.h:8 msgid "Danish Kroner" msgstr "Danska kronor" #: ../data/currencies.xml.in.h:9 msgid "ar:DKK" msgstr "" #: ../data/currencies.xml.in.h:10 msgid "British Pounds" msgstr "Brittiska pund" #: ../data/currencies.xml.in.h:11 msgid "ar:GBP,au:£" msgstr "" #: ../data/currencies.xml.in.h:12 msgid "Thai Baht" msgstr "Thailändska baht" #: ../data/currencies.xml.in.h:13 msgid "ar:THB" msgstr "" #: ../data/currencies.xml.in.h:14 msgid "Swedish Krona" msgstr "Svenska kronor" #: ../data/currencies.xml.in.h:15 msgid "ar:SEK" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:16 msgid "Swiss Francs" msgstr "Schweizerfranc" #: ../data/currencies.xml.in.h:17 msgid "ar:CHF" msgstr "" #: ../data/currencies.xml.in.h:18 msgid "Icelandic Krona" msgstr "Isländska kronor" #: ../data/currencies.xml.in.h:19 msgid "ar:ISK" msgstr "" #: ../data/currencies.xml.in.h:20 msgid "Norwegian Kroner" msgstr "Norska kronor" #: ../data/currencies.xml.in.h:21 msgid "ar:NOK" msgstr "" #: ../data/currencies.xml.in.h:22 msgid "Bulgarian Lev" msgstr "Bulgariska lev" #: ../data/currencies.xml.in.h:23 msgid "lev,ar:BGN" msgstr "" #: ../data/currencies.xml.in.h:24 msgid "Russian Ruble" msgstr "Ryska rubel" #: ../data/currencies.xml.in.h:25 msgid "ar:RUB,au:₽,ruble" msgstr "a:RUB,au:₽,rubel" #: ../data/currencies.xml.in.h:26 msgid "Philippine Peso" msgstr "Filippinska peso" #: ../data/currencies.xml.in.h:27 msgid "ar:PHP,au:₱" msgstr "" #: ../data/currencies.xml.in.h:28 msgid "Malaysian Ringgit" msgstr "Malaysiska ringgit" #: ../data/currencies.xml.in.h:29 msgid "ar:MYR" msgstr "" #: ../data/currencies.xml.in.h:30 msgid "Croatian Kuna" msgstr "Kroatiska kuna" #: ../data/currencies.xml.in.h:31 msgid "ar:HRK" msgstr "" #: ../data/currencies.xml.in.h:32 msgid "Yuan Renminbi (PR China)" msgstr "" #: ../data/currencies.xml.in.h:33 msgid "ar:CNY" msgstr "" #: ../data/currencies.xml.in.h:34 msgid "Indonesian Rupiah" msgstr "Indonesiska rupiah" #: ../data/currencies.xml.in.h:35 msgid "ar:IDR,rupiah" msgstr "" #: ../data/currencies.xml.in.h:36 msgid "Czech Koruna" msgstr "Tjeckiska koruna" #: ../data/currencies.xml.in.h:37 msgid "ar:CZK" msgstr "" #: ../data/currencies.xml.in.h:38 msgid "Hungarian Forint" msgstr "Ungerska forint" #: ../data/currencies.xml.in.h:39 msgid "forint,ar:HUF" msgstr "" #: ../data/currencies.xml.in.h:40 msgid "Polish Zloty" msgstr "Polska zloty" #: ../data/currencies.xml.in.h:41 msgid "zloty,ar:PLN" msgstr "" #: ../data/currencies.xml.in.h:42 msgid "Romanian New Leu" msgstr "Rumänska nya leu" #: ../data/currencies.xml.in.h:43 msgid "leu,ar:RON" msgstr "" #: ../data/currencies.xml.in.h:44 msgid "Turkish New Lira" msgstr "Turkiska nya lira" #: ../data/currencies.xml.in.h:45 msgid "ar:TRY,au:₺" msgstr "" #: ../data/currencies.xml.in.h:46 msgid "Australian Dollars" msgstr "Australiensiska dollar" #: ../data/currencies.xml.in.h:47 msgid "ar:AUD" msgstr "" #: ../data/currencies.xml.in.h:48 msgid "Canadian Dollars" msgstr "Kanadensiska dollar" #: ../data/currencies.xml.in.h:49 msgid "ar:CAD" msgstr "" #: ../data/currencies.xml.in.h:50 msgid "Hong Kong Dollars" msgstr "Hong Kong dollar" #: ../data/currencies.xml.in.h:51 msgid "ar:HKD" msgstr "" #: ../data/currencies.xml.in.h:52 msgid "New Zealand Dollars" msgstr "Nya Zeeländska dollar" #: ../data/currencies.xml.in.h:53 msgid "ar:NZD" msgstr "" #: ../data/currencies.xml.in.h:54 msgid "Singapore Dollars" msgstr "Singaporedollar" #: ../data/currencies.xml.in.h:55 msgid "ar:SGD" msgstr "" #: ../data/currencies.xml.in.h:56 msgid "South Korean Won" msgstr "Sydkoreanska won" #: ../data/currencies.xml.in.h:57 msgid "ar:KRW,au:₩,won" msgstr "" #: ../data/currencies.xml.in.h:58 msgid "South African Rand" msgstr "Sydafrikanska rand" #: ../data/currencies.xml.in.h:59 msgid "ar:ZAR" msgstr "" #: ../data/currencies.xml.in.h:60 msgid "Indian Rupee" msgstr "Indiska rupier" #: ../data/currencies.xml.in.h:61 msgid "ar:INR,au:₹,rupee" msgstr "a:INR,au:₹,rupie,p:rupier" #: ../data/currencies.xml.in.h:62 msgid "Israeli New Sheqel" msgstr "Israeliska Sheqels" #: ../data/currencies.xml.in.h:63 msgid "ar:ILS,au:₪,sheqel" msgstr "a:ILS,au:₪,sheqel" #: ../data/currencies.xml.in.h:64 msgid "Mexican Peso" msgstr "Mexikanska pesos" #: ../data/currencies.xml.in.h:65 msgid "ar:MXN" msgstr "" #: ../data/currencies.xml.in.h:66 msgid "Brazilian Real" msgstr "Brasilianska real" #: ../data/currencies.xml.in.h:67 msgid "ar:BRL" msgstr "" #: ../data/currencies.xml.in.h:68 msgid "Euro Cent" msgstr "Eurocent" #: ../data/currencies.xml.in.h:69 msgid "r:eurocent,p:eurocents" msgstr "eurocent" #: ../data/currencies.xml.in.h:70 msgid "Cent (USD)" msgstr "Cent (USD)" #: ../data/currencies.xml.in.h:71 msgid "au:¢,r:cent,p:cents" msgstr "au:¢,cent" #: ../data/currencies.xml.in.h:72 msgid "Belgian Franc" msgstr "Belgiska franc" #: ../data/currencies.xml.in.h:73 msgid "ar:BEF" msgstr "" #: ../data/currencies.xml.in.h:74 msgid "Greek Drachma" msgstr "Grekiska drachmer" #: ../data/currencies.xml.in.h:75 msgid "ar:GRD,au:₯,drachma" msgstr "" #: ../data/currencies.xml.in.h:76 msgid "French Franc" msgstr "Franska franc" #: ../data/currencies.xml.in.h:77 msgid "ar:FRF,au:₣,franc" msgstr "" #: ../data/currencies.xml.in.h:78 msgid "Italian Lira" msgstr "Italienska lire" #: ../data/currencies.xml.in.h:79 msgid "ar:ITL,au:₤,lira" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:80 msgid "Dutch Guilder" msgstr "Nederländska gulden" #: ../data/currencies.xml.in.h:81 msgid "ar:NLG,guilder" msgstr "a:NLG,gulden" #: ../data/currencies.xml.in.h:82 msgid "Portuguese Escudo" msgstr "Portugisiska escudos" #: ../data/currencies.xml.in.h:83 msgid "ar:PTE,escudo" msgstr "" #: ../data/currencies.xml.in.h:84 msgid "Deutsche Mark" msgstr "Tyska mark" #: ../data/currencies.xml.in.h:85 msgid "ar:DEM,mark" msgstr "" #: ../data/currencies.xml.in.h:86 msgid "Spanish Peseta" msgstr "Spanska pesetas" #: ../data/currencies.xml.in.h:87 msgid "ar:ESP,au:₧,peseta,p:pesetas" msgstr "" #: ../data/currencies.xml.in.h:88 msgid "Irish Pound" msgstr "Irländska pund" #: ../data/currencies.xml.in.h:89 msgid "ar:IEP" msgstr "" #: ../data/currencies.xml.in.h:90 msgid "Luxembourg Franc" msgstr "Luxemburgfranc" #: ../data/currencies.xml.in.h:91 msgid "ar:LUF" msgstr "" #: ../data/currencies.xml.in.h:92 msgid "Austrian Schilling" msgstr "Österrikiska schilling" #: ../data/currencies.xml.in.h:93 msgid "ar:ATS,schilling" msgstr "" #: ../data/currencies.xml.in.h:94 msgid "Finnish Markka" msgstr "Finska mark" #: ../data/currencies.xml.in.h:95 msgid "ar:FIM,markka" msgstr "" #: ../data/currencies.xml.in.h:96 msgid "Slovenian Tolar" msgstr "Slovenska tolar" #: ../data/currencies.xml.in.h:97 msgid "ar:SIT,tolar" msgstr "" #: ../data/currencies.xml.in.h:98 msgid "Cypriot Pound" msgstr "Cypriotiska pund" #: ../data/currencies.xml.in.h:99 msgid "ar:CYP" msgstr "" #: ../data/currencies.xml.in.h:100 msgid "Estonian Kroon" msgstr "Estoniska kroon" #: ../data/currencies.xml.in.h:101 msgid "ar:EEK,kroon,p:krooni" msgstr "" #: ../data/currencies.xml.in.h:102 msgid "Slovak Koruna" msgstr "Slovakiska koruna" #: ../data/currencies.xml.in.h:103 msgid "ar:SKK" msgstr "" #: ../data/currencies.xml.in.h:104 msgid "Maltese Lira" msgstr "Maltesiska lire" #: ../data/currencies.xml.in.h:105 msgid "ar:MTL" msgstr "" #: ../data/currencies.xml.in.h:106 msgid "Latvian Lats" msgstr "Lettiska lats" #: ../data/currencies.xml.in.h:107 msgid "lats,ar:LVL" msgstr "" #: ../data/currencies.xml.in.h:108 msgid "Lithuanian Litas" msgstr "Litauiska litas" #: ../data/currencies.xml.in.h:109 msgid "litas,ar:LTL" msgstr "" #: ../data/datasets.xml.in.h:1 msgid "Data Sets" msgstr "Dataset" #. Data set for chemical elements #: ../data/datasets.xml.in.h:3 msgid "!datasets!Elements" msgstr "Element" #: ../data/datasets.xml.in.h:4 msgid "r:atom" msgstr "" #. Object argument for chemical elements data set #: ../data/datasets.xml.in.h:6 msgid "!datasets!Element" msgstr "Element" #: ../data/datasets.xml.in.h:7 msgid "Symbol" msgstr "Symbol" #: ../data/datasets.xml.in.h:8 msgid "r:symbol" msgstr "" #. Chemical elements number #: ../data/datasets.xml.in.h:10 msgid "!datasets!Number" msgstr "Nummer" #. Chemical elements number #: ../data/datasets.xml.in.h:12 msgid "!datasets!r:number" msgstr "nummer" #: ../data/datasets.xml.in.h:13 ../data/functions.xml.in.h:574 msgid "Name" msgstr "Namn" #: ../data/datasets.xml.in.h:14 msgid "r:name" msgstr "namn" #: ../data/datasets.xml.in.h:15 msgid "Classification" msgstr "Klassificering" #: ../data/datasets.xml.in.h:16 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 Polyatomic Non-Metal 9 Diatomic Non-" "Metal 10 Noble Gas 11 Unknown chemical properties" msgstr "" "Ett nummer som representerar en elementgrupp: 1 Alkalimetall 2 " "Jordalkalimetall 3 Lantanid 4 Aktinid 5 Övergångsmetall 6 " "Metall 7 Halvmetall 8 Polyatomisk icke-metall 9 Diatomisk icke-" "metall 10 Ädelgas 11 Okända kemiska egenskaper" #: ../data/datasets.xml.in.h:17 msgid "r:class" msgstr "klass" #: ../data/datasets.xml.in.h:18 ../data/functions.xml.in.h:352 msgid "Weight" msgstr "Vikt" #: ../data/datasets.xml.in.h:19 msgid "r:weight,mass" msgstr "vikt,massa" #: ../data/datasets.xml.in.h:20 msgid "Boiling Point" msgstr "Kokpunkt" #: ../data/datasets.xml.in.h:21 msgid "r:boiling" msgstr "kokpunkt" #: ../data/datasets.xml.in.h:22 msgid "Melting Point" msgstr "Smältpunkt" #: ../data/datasets.xml.in.h:23 msgid "r:melting" msgstr "smältpunkt" #: ../data/datasets.xml.in.h:24 ../data/units.xml.in.h:119 msgid "Density" msgstr "Densitet" #: ../data/datasets.xml.in.h:25 msgid "Density at 295K" msgstr "Densitet vid 295K" #: ../data/datasets.xml.in.h:26 msgid "r:density" msgstr "densitet" #: ../data/datasets.xml.in.h:27 msgid "X Position" msgstr "" #: ../data/datasets.xml.in.h:28 msgid "r:x_pos" msgstr "" #: ../data/datasets.xml.in.h:29 msgid "Y Position" msgstr "" #: ../data/datasets.xml.in.h:30 msgid "r:y_pos" msgstr "" #: ../data/datasets.xml.in.h:31 msgid "Planets" msgstr "Planeter" #: ../data/datasets.xml.in.h:32 msgid "r:planet" msgstr "" #: ../data/datasets.xml.in.h:33 msgid "Planet" msgstr "" #: ../data/datasets.xml.in.h:34 msgid "Orbital Period (Year)" msgstr "Omkretstid (år)" #. Orbital period for planet #: ../data/datasets.xml.in.h:36 msgid "!datasets!r:year" msgstr "år" #: ../data/datasets.xml.in.h:37 msgid "Average Orbital Speed" msgstr "Genomsnittlig kretsloppshastighet" #: ../data/datasets.xml.in.h:38 msgid "r:speed" msgstr "hastighet" #: ../data/datasets.xml.in.h:39 msgid "Eccentricity" msgstr "Excentricitet" #: ../data/datasets.xml.in.h:40 msgid "r:eccentricity" msgstr "excentricitet" #: ../data/datasets.xml.in.h:41 msgid "Inclination" msgstr "Inklination" #: ../data/datasets.xml.in.h:42 msgid "r:inclination" msgstr "inklination" #: ../data/datasets.xml.in.h:43 msgid "Number of Satellites" msgstr "Antal satelliter" #: ../data/datasets.xml.in.h:44 msgid "r:satellites" msgstr "satelliter" #. Planet mass #: ../data/datasets.xml.in.h:46 msgid "!datasets!Mass" msgstr "Massa" #: ../data/datasets.xml.in.h:47 msgid "r:mass" msgstr "massa" #: ../data/datasets.xml.in.h:48 msgid "Mean Density" msgstr "Genomsnittlig densitet" #: ../data/datasets.xml.in.h:49 msgid "Surface Area" msgstr "Ytarea" #. Surface area of planet #: ../data/datasets.xml.in.h:51 msgid "!datasets!r:area" msgstr "" #: ../data/datasets.xml.in.h:52 msgid "Equatorial Gravity" msgstr "Ekvatoriell tyngdkraft" #: ../data/datasets.xml.in.h:53 msgid "r:gravity" msgstr "tyngdkraft" #: ../data/datasets.xml.in.h:54 msgid "Mean Surface Temperature" msgstr "Genomsnittlig yttemperatur" #: ../data/datasets.xml.in.h:55 msgid "r:temperature" msgstr "temperatur" #: ../data/elements.xml.in.h:1 msgid "Hydrogen" msgstr "Väte" #: ../data/elements.xml.in.h:2 msgid "Helium" msgstr "" #: ../data/elements.xml.in.h:3 msgid "Lithium" msgstr "Litium" #: ../data/elements.xml.in.h:4 msgid "Beryllium" msgstr "" #: ../data/elements.xml.in.h:5 msgid "Boron" msgstr "Bor" #: ../data/elements.xml.in.h:6 msgid "Carbon" msgstr "Kol" #: ../data/elements.xml.in.h:7 msgid "Nitrogen" msgstr "Kväve" #: ../data/elements.xml.in.h:8 msgid "Oxygen" msgstr "Syre" #: ../data/elements.xml.in.h:9 msgid "Fluorine" msgstr "Fluor" #: ../data/elements.xml.in.h:10 msgid "Neon" msgstr "" #: ../data/elements.xml.in.h:11 msgid "Sodium" msgstr "Natrium" #: ../data/elements.xml.in.h:12 msgid "Magnesium" msgstr "" #: ../data/elements.xml.in.h:13 msgid "Aluminum" msgstr "Aluminium" #: ../data/elements.xml.in.h:14 msgid "Silicon" msgstr "Kisel" #: ../data/elements.xml.in.h:15 msgid "Phosphorus" msgstr "Fosfor" #: ../data/elements.xml.in.h:16 msgid "Sulfur" msgstr "Svavel" #: ../data/elements.xml.in.h:17 msgid "Chlorine" msgstr "Klor" #: ../data/elements.xml.in.h:18 msgid "Argon" msgstr "" #: ../data/elements.xml.in.h:19 msgid "Potassium" msgstr "Kalium" #: ../data/elements.xml.in.h:20 msgid "Calcium" msgstr "Kalcium" #: ../data/elements.xml.in.h:21 msgid "Scandium" msgstr "Skandium" #: ../data/elements.xml.in.h:22 msgid "Titanium" msgstr "Titan" #: ../data/elements.xml.in.h:23 msgid "Vanadium" msgstr "Vanadin" #: ../data/elements.xml.in.h:24 msgid "Chromium" msgstr "Krom" #: ../data/elements.xml.in.h:25 msgid "Manganese" msgstr "Mangan" #: ../data/elements.xml.in.h:26 msgid "Iron" msgstr "Järn" #: ../data/elements.xml.in.h:27 msgid "Cobalt" msgstr "Kobolt" #: ../data/elements.xml.in.h:28 msgid "Nickel" msgstr "" #: ../data/elements.xml.in.h:29 msgid "Copper" msgstr "Koppar" #: ../data/elements.xml.in.h:30 msgid "Zinc" msgstr "Zink" #: ../data/elements.xml.in.h:31 msgid "Gallium" msgstr "" #: ../data/elements.xml.in.h:32 msgid "Germanium" msgstr "" #: ../data/elements.xml.in.h:33 msgid "Arsenic" msgstr "Arsenik" #: ../data/elements.xml.in.h:34 msgid "Selenium" msgstr "Selen" #: ../data/elements.xml.in.h:35 msgid "Bromine" msgstr "Brom" #: ../data/elements.xml.in.h:36 msgid "Krypton" msgstr "" #: ../data/elements.xml.in.h:37 msgid "Rubidium" msgstr "" #: ../data/elements.xml.in.h:38 msgid "Strontium" msgstr "" #: ../data/elements.xml.in.h:39 msgid "Yttrium" msgstr "" #: ../data/elements.xml.in.h:40 msgid "Zirconium" msgstr "Zirkonium" #: ../data/elements.xml.in.h:41 msgid "Niobium" msgstr "Niob" #: ../data/elements.xml.in.h:42 msgid "Molybdenum" msgstr "Molybden" #: ../data/elements.xml.in.h:43 msgid "Technetium" msgstr "Teknetium" #: ../data/elements.xml.in.h:44 msgid "Ruthenium" msgstr "Rutenium" #: ../data/elements.xml.in.h:45 msgid "Rhodium" msgstr "Rodium" #: ../data/elements.xml.in.h:46 msgid "Palladium" msgstr "" #: ../data/elements.xml.in.h:47 msgid "Silver" msgstr "" #: ../data/elements.xml.in.h:48 msgid "Cadmium" msgstr "Kadmium" #: ../data/elements.xml.in.h:49 msgid "Indium" msgstr "" #: ../data/elements.xml.in.h:50 msgid "Tin" msgstr "Tenn" #: ../data/elements.xml.in.h:51 msgid "Antimony" msgstr "Antimon" #: ../data/elements.xml.in.h:52 msgid "Tellurium" msgstr "Tellur" #: ../data/elements.xml.in.h:53 msgid "Iodine" msgstr "Jod" #: ../data/elements.xml.in.h:54 msgid "Xenon" msgstr "" #: ../data/elements.xml.in.h:55 msgid "Cesium" msgstr "" #: ../data/elements.xml.in.h:56 msgid "Barium" msgstr "" #: ../data/elements.xml.in.h:57 msgid "Lanthanum" msgstr "Lantan" #: ../data/elements.xml.in.h:58 msgid "Cerium" msgstr "" #: ../data/elements.xml.in.h:59 msgid "Praseodymium" msgstr "Praseodym" #: ../data/elements.xml.in.h:60 msgid "Neodymium" msgstr "Neodym" #: ../data/elements.xml.in.h:61 msgid "Promethium" msgstr "Prometium" #: ../data/elements.xml.in.h:62 msgid "Samarium" msgstr "" #: ../data/elements.xml.in.h:63 msgid "Europium" msgstr "" #: ../data/elements.xml.in.h:64 msgid "Gadolinium" msgstr "Gadolinium guld" #: ../data/elements.xml.in.h:65 msgid "Terbium" msgstr "" #: ../data/elements.xml.in.h:66 msgid "Dysprosium" msgstr "" #: ../data/elements.xml.in.h:67 msgid "Holmium" msgstr "" #: ../data/elements.xml.in.h:68 msgid "Erbium" msgstr "" #: ../data/elements.xml.in.h:69 msgid "Thulium" msgstr "Tulium" #: ../data/elements.xml.in.h:70 msgid "Ytterbium" msgstr "" #: ../data/elements.xml.in.h:71 msgid "Lutetium" msgstr "" #: ../data/elements.xml.in.h:72 msgid "Hafnium" msgstr "" #: ../data/elements.xml.in.h:73 msgid "Tantalum" msgstr "Tantal" #: ../data/elements.xml.in.h:74 msgid "Tungsten" msgstr "Volfram" #: ../data/elements.xml.in.h:75 msgid "Rhenium" msgstr "" #: ../data/elements.xml.in.h:76 msgid "Osmium" msgstr "" #: ../data/elements.xml.in.h:77 msgid "Iridium" msgstr "" #: ../data/elements.xml.in.h:78 msgid "Platinum" msgstr "Platina" #: ../data/elements.xml.in.h:79 msgid "Gold" msgstr "Guld" #. Chemical element #: ../data/elements.xml.in.h:81 msgid "!elements!Mercury" msgstr "Kvicksilver" #: ../data/elements.xml.in.h:82 msgid "Thallium" msgstr "Tallium" #: ../data/elements.xml.in.h:83 msgid "Lead" msgstr "Bly" #: ../data/elements.xml.in.h:84 msgid "Bismuth" msgstr "Vismut" #: ../data/elements.xml.in.h:85 msgid "Polonium" msgstr "" #: ../data/elements.xml.in.h:86 msgid "Astatine" msgstr "Astat" #: ../data/elements.xml.in.h:87 msgid "Radon" msgstr "" #: ../data/elements.xml.in.h:88 msgid "Francium" msgstr "" #: ../data/elements.xml.in.h:89 msgid "Radium" msgstr "" #: ../data/elements.xml.in.h:90 msgid "Actinium" msgstr "Aktinium" #: ../data/elements.xml.in.h:91 msgid "Thorium" msgstr "Torium" #: ../data/elements.xml.in.h:92 msgid "Protactinium" msgstr "Protaktinium" #: ../data/elements.xml.in.h:93 msgid "Uranium" msgstr "Uran" #: ../data/elements.xml.in.h:94 msgid "Neptunium" msgstr "" #: ../data/elements.xml.in.h:95 msgid "Plutonium" msgstr "" #: ../data/elements.xml.in.h:96 msgid "Americium" msgstr "" #: ../data/elements.xml.in.h:97 msgid "Curium" msgstr "" #: ../data/elements.xml.in.h:98 msgid "Berkelium" msgstr "" #: ../data/elements.xml.in.h:99 msgid "Californium" msgstr "" #: ../data/elements.xml.in.h:100 msgid "Einsteinium" msgstr "" #: ../data/elements.xml.in.h:101 msgid "Fermium" msgstr "" #: ../data/elements.xml.in.h:102 msgid "Mendelevium" msgstr "" #: ../data/elements.xml.in.h:103 msgid "Nobelium" msgstr "" #: ../data/elements.xml.in.h:104 msgid "Lawrencium" msgstr "" #: ../data/elements.xml.in.h:105 msgid "Rutherfordium" msgstr "" #: ../data/elements.xml.in.h:106 msgid "Dubnium" msgstr "" #: ../data/elements.xml.in.h:107 msgid "Seaborgium" msgstr "" #: ../data/elements.xml.in.h:108 msgid "Bohrium" msgstr "" #: ../data/elements.xml.in.h:109 msgid "Hassium" msgstr "" #: ../data/elements.xml.in.h:110 msgid "Meitnerium" msgstr "" #: ../data/elements.xml.in.h:111 msgid "Darmstadtium" msgstr "" #: ../data/elements.xml.in.h:112 msgid "Roentgenium" msgstr "" #: ../data/elements.xml.in.h:113 msgid "Copernicium" msgstr "" #: ../data/elements.xml.in.h:114 msgid "Ununtrium" msgstr "" #: ../data/elements.xml.in.h:115 msgid "Flerovium" msgstr "" #: ../data/elements.xml.in.h:116 msgid "Ununpentium" msgstr "" #: ../data/elements.xml.in.h:117 msgid "Livermorium" msgstr "" #: ../data/elements.xml.in.h:118 msgid "Ununseptium" msgstr "" #: ../data/elements.xml.in.h:119 msgid "Ununoctium" msgstr "" #: ../data/functions.xml.in.h:1 msgid "Matrices & Vectors" msgstr "Matriser & Vektorer" #: ../data/functions.xml.in.h:2 msgid "Construct Vector" msgstr "Skapa vektor" #: ../data/functions.xml.in.h:3 msgid "r:vector" msgstr "vektor" #: ../data/functions.xml.in.h:4 msgid "Returns a vector with listed elements." msgstr "Returnerar en vektor med listade element." #. Vector/matrix elements #: ../data/functions.xml.in.h:6 msgid "Elements" msgstr "Element" #: ../data/functions.xml.in.h:7 msgid "Generate Vector" msgstr "Skapa vektor" #: ../data/functions.xml.in.h:8 msgid "r:genvector" msgstr "" #: ../data/functions.xml.in.h:9 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:10 msgid "Function" msgstr "Funktion" #: ../data/functions.xml.in.h:11 msgid "Min" msgstr "Min" #: ../data/functions.xml.in.h:12 msgid "Max" msgstr "Max" #: ../data/functions.xml.in.h:13 msgid "Dimension / Step size" msgstr "Dimension / stegstorlek" #: ../data/functions.xml.in.h:14 msgid "Variable" msgstr "Variabel" #: ../data/functions.xml.in.h:15 msgid "Use step size" msgstr "Använd stegstorlek" #: ../data/functions.xml.in.h:16 msgid "Sort" msgstr "Sortera" #: ../data/functions.xml.in.h:17 msgid "r:sort" msgstr "sortera" #: ../data/functions.xml.in.h:18 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:19 msgid "Vector" msgstr "Vektor" #: ../data/functions.xml.in.h:20 msgid "Ascending" msgstr "Stigande" #: ../data/functions.xml.in.h:21 msgid "Rank" msgstr "Rangordna" #: ../data/functions.xml.in.h:22 msgid "r:rank" msgstr "rangordna" #: ../data/functions.xml.in.h:23 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:24 msgid "Vector Limits" msgstr "Vektorgränser" #: ../data/functions.xml.in.h:25 msgid "r:limits" msgstr "gränser" #: ../data/functions.xml.in.h:26 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:27 msgid "Lower limit" msgstr "Undre gräns" #: ../data/functions.xml.in.h:28 msgid "Upper limit" msgstr "Övre gräns" #: ../data/functions.xml.in.h:29 msgid "Dimension" msgstr "Dimension" #: ../data/functions.xml.in.h:30 msgid "r:dimension" msgstr "" #: ../data/functions.xml.in.h:31 msgid "Returns the number of elements in a vector." msgstr "Returnerar antalet element i en vektor." #: ../data/functions.xml.in.h:32 msgid "Merge Vectors" msgstr "Sammanslå vektorer" #: ../data/functions.xml.in.h:33 msgid "r:mergevectors" msgstr "" #: ../data/functions.xml.in.h:34 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:35 msgid "Vector 1" msgstr "Vektor 1" #: ../data/functions.xml.in.h:36 msgid "Vector 2" msgstr "Vektor 2" #: ../data/functions.xml.in.h:37 msgid "Construct Matrix" msgstr "Skapa matris" #: ../data/functions.xml.in.h:38 msgid "r:matrix" msgstr "matris" #: ../data/functions.xml.in.h:39 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:40 msgid "Rows" msgstr "Rader" #: ../data/functions.xml.in.h:41 msgid "Columns" msgstr "Kolumner" #: ../data/functions.xml.in.h:42 msgid "Convert Matrix to Vector" msgstr "Omvandla matris till vektor" #: ../data/functions.xml.in.h:43 msgid "r:matrix2vector" msgstr "" #: ../data/functions.xml.in.h:44 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:45 msgid "Matrix" msgstr "Matris" #: ../data/functions.xml.in.h:46 msgid "Matrix Area" msgstr "Matrisarea" #. Matrix area #: ../data/functions.xml.in.h:48 msgid "r:area" msgstr "" #: ../data/functions.xml.in.h:49 msgid "Returns a part of a matrix." msgstr "Returnerar en del av en matris." #: ../data/functions.xml.in.h:50 msgid "Start row" msgstr "Startrad" #: ../data/functions.xml.in.h:51 msgid "Start column" msgstr "Startkolumn" #: ../data/functions.xml.in.h:52 msgid "End row" msgstr "Slutrad" #: ../data/functions.xml.in.h:53 msgid "End column" msgstr "Slutkolumn" #: ../data/functions.xml.in.h:54 msgid "r:rows" msgstr "rader" #: ../data/functions.xml.in.h:55 msgid "Returns the number of rows in a matrix." msgstr "Returnerar antalet rader i en matris." #: ../data/functions.xml.in.h:56 msgid "r:columns" msgstr "kolumner" #: ../data/functions.xml.in.h:57 msgid "Returns the number of columns in a matrix." msgstr "Returner antalet kolumner i en matris." #: ../data/functions.xml.in.h:58 msgid "Extract row as vector" msgstr "Skapa vektor från rad" #: ../data/functions.xml.in.h:59 msgid "r:row" msgstr "rad" #: ../data/functions.xml.in.h:60 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:61 msgid "Row" msgstr "Rad" #: ../data/functions.xml.in.h:62 msgid "Extract Column as Vector" msgstr "Extrahera kolumn som vektor" #: ../data/functions.xml.in.h:63 msgid "r:column" msgstr "kolumn" #: ../data/functions.xml.in.h:64 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:65 msgid "Column" msgstr "Kolumn" #: ../data/functions.xml.in.h:66 msgid "r:elements" msgstr "" #: ../data/functions.xml.in.h:67 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:68 msgid "Matrix or vector" msgstr "Matris eller vektor" #. Vector/matrix element #: ../data/functions.xml.in.h:70 msgid "Element" msgstr "Element" #: ../data/functions.xml.in.h:71 msgid "r:element" msgstr "" #: ../data/functions.xml.in.h:72 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:73 msgid "Matrix/vector" msgstr "Matris/vektor" #: ../data/functions.xml.in.h:74 msgid "Row/index" msgstr "Rad/index" #: ../data/functions.xml.in.h:75 msgid "Transpose" msgstr "Transponera" #: ../data/functions.xml.in.h:76 msgid "r:transpose" msgstr "transponera" #: ../data/functions.xml.in.h:77 msgid "Returns the transpose of a matrix." msgstr "Returnerar transponeringen av en matris." #: ../data/functions.xml.in.h:78 msgid "Identity" msgstr "Identitetsmatris" #: ../data/functions.xml.in.h:79 msgid "r:identity" msgstr "identitetsmatris" #: ../data/functions.xml.in.h:80 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:81 msgid "Matrix or rows/columns" msgstr "Matris eller rader/kolumner" #: ../data/functions.xml.in.h:82 msgid "Determinant" msgstr "Determinanten" #: ../data/functions.xml.in.h:83 msgid "r:det" msgstr "" #: ../data/functions.xml.in.h:84 msgid "Calculates the determinant of a matrix." msgstr "Beräknar determinanten för en matris." #: ../data/functions.xml.in.h:85 msgid "Permanent" msgstr "Permanent" #: ../data/functions.xml.in.h:86 msgid "r:permanent" msgstr "" #: ../data/functions.xml.in.h:87 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:88 msgid "Adjugate (Adjoint)" msgstr "Adjungerad matris (Adjunkt)" #: ../data/functions.xml.in.h:89 msgid "r:adj" msgstr "" #: ../data/functions.xml.in.h:90 msgid "Calculates the adjugate or adjoint of a matrix." msgstr "Beräknar den adjungerade matrisen eller adjunkten för en matris." #: ../data/functions.xml.in.h:91 msgid "Cofactor" msgstr "Kofaktor" #: ../data/functions.xml.in.h:92 msgid "r:cofactor" msgstr "kofaktor" #: ../data/functions.xml.in.h:93 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:94 msgid "Matrix Inverse" msgstr "Matrisinvers" #: ../data/functions.xml.in.h:95 msgid "r:inverse" msgstr "invers" #: ../data/functions.xml.in.h:96 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:97 msgid "Load CSV File" msgstr "Ladda CSV-fil" #: ../data/functions.xml.in.h:98 msgid "r:load" msgstr "ladda" #: ../data/functions.xml.in.h:99 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:100 msgid "Filename" msgstr "Filnamn" #: ../data/functions.xml.in.h:101 msgid "First data row" msgstr "Första raden med data" #: ../data/functions.xml.in.h:102 msgid "Separator" msgstr "Avskiljare" #: ../data/functions.xml.in.h:103 msgid "Export To CSV File" msgstr "Exportera till CSV-fil" #: ../data/functions.xml.in.h:104 msgid "r:export" msgstr "exportera" #: ../data/functions.xml.in.h:105 msgid "Exports a matrix to a CSV data file." msgstr "Exporterar en matris till en CSV-datafil" #: ../data/functions.xml.in.h:106 msgid "Norm (length)" msgstr "Normal" #: ../data/functions.xml.in.h:107 msgid "r:norm" msgstr "" #: ../data/functions.xml.in.h:108 msgid "Calculates the norm/length of a vector." msgstr "Beräknar normalen för en vektor." #: ../data/functions.xml.in.h:109 msgid "Cross Product" msgstr "Vektoriell produkt" #: ../data/functions.xml.in.h:110 msgid "r:cross" msgstr "vektoriell" #: ../data/functions.xml.in.h:111 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:112 msgid "Combinatorics" msgstr "Kombinatorik" #: ../data/functions.xml.in.h:113 msgid "Factorial" msgstr "Fakultet" #: ../data/functions.xml.in.h:114 msgid "" "Calculates the factorial of an integer. Multiplies 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:115 msgid "r:factorial" msgstr "fakultet" #: ../data/functions.xml.in.h:116 msgid "Value" msgstr "Värde" #: ../data/functions.xml.in.h:117 msgid "Double Factorial" msgstr "Dubbelfakultet" #: ../data/functions.xml.in.h:118 msgid "r:factorial2" msgstr "fakultet2" #: ../data/functions.xml.in.h:119 msgid "" "Calculates the double factorial of an integer. Multiplies 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:120 msgid "Multifactorial" msgstr "Multifakultet" #: ../data/functions.xml.in.h:121 msgid "r:multifactorial" msgstr "multifakultet" #: ../data/functions.xml.in.h:122 msgid "" "Calculates the multifactorial of an integer. Multiplies 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:123 msgid "Binomial Coefficient" msgstr "Binomial koefficient" #: ../data/functions.xml.in.h:124 msgid "r:binomial" msgstr "" #: ../data/functions.xml.in.h:125 msgid "Exponent" msgstr "Exponent" #: ../data/functions.xml.in.h:126 msgid "Index" msgstr "Index" #: ../data/functions.xml.in.h:127 msgid "Hyperfactorial" msgstr "Hyperfakultet" #: ../data/functions.xml.in.h:128 msgid "r:hyperfactorial" msgstr "hyperfakultet" #: ../data/functions.xml.in.h:129 msgid "" "Calculates the hyperfactorial of an integer. Multiplies 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:130 msgid "Superfactorial" msgstr "Superfakultet" #: ../data/functions.xml.in.h:131 msgid "r:superfactorial" msgstr "superfakultet" #: ../data/functions.xml.in.h:132 msgid "" "Calculates the superfactorial of an integer. Multiplies 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:133 msgid "Permutations (Variations)" msgstr "Permutationer (Variationer)" #: ../data/functions.xml.in.h:134 msgid "r:perm,variations" msgstr "variationer" #: ../data/functions.xml.in.h:135 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:136 msgid "Objects" msgstr "Objekt" #: ../data/functions.xml.in.h:137 msgid "Size" msgstr "Storlek" #: ../data/functions.xml.in.h:138 msgid "Combinations" msgstr "Kombinationer" #: ../data/functions.xml.in.h:139 msgid "r:comb" msgstr "kombinationer" #: ../data/functions.xml.in.h:140 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:141 msgid "Derangements" msgstr "Derangemang" #: ../data/functions.xml.in.h:142 msgid "r:derangements" msgstr "derangemang" #: ../data/functions.xml.in.h:143 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:144 msgid "Number of elements" msgstr "Antal element" #: ../data/functions.xml.in.h:145 msgid "Number Theory" msgstr "Nummerteori" #: ../data/functions.xml.in.h:146 msgid "Absolute Value" msgstr "Absolut värde" #: ../data/functions.xml.in.h:147 msgid "r:abs" msgstr "" #: ../data/functions.xml.in.h:148 msgid "Arithmetics" msgstr "Aritmetik" #: ../data/functions.xml.in.h:149 msgid "Signum" msgstr "Sigma" #: ../data/functions.xml.in.h:150 msgid "r:sgn" msgstr "" #. A numerical value #: ../data/functions.xml.in.h:152 msgid "Number" msgstr "Nummer" #: ../data/functions.xml.in.h:153 msgid "Numerator" msgstr "Täljare" #: ../data/functions.xml.in.h:154 msgid "r:numerator" msgstr "täljare" #: ../data/functions.xml.in.h:155 msgid "Denominator" msgstr "Nämnare" #: ../data/functions.xml.in.h:156 msgid "r:denominator" msgstr "nämnare" #: ../data/functions.xml.in.h:157 msgid "Remainder" msgstr "Rest" #: ../data/functions.xml.in.h:158 msgid "r:rem" msgstr "" #: ../data/functions.xml.in.h:159 msgid "Modulus" msgstr "Modulus" #: ../data/functions.xml.in.h:160 msgid "r:mod" msgstr "" #: ../data/functions.xml.in.h:161 msgid "Negate" msgstr "Negera" #: ../data/functions.xml.in.h:162 msgid "r:neg" msgstr "" #: ../data/functions.xml.in.h:163 msgid "Reciprocal" msgstr "Reciprok" #: ../data/functions.xml.in.h:164 msgid "r:inv" msgstr "" #: ../data/functions.xml.in.h:165 msgid "Multiply" msgstr "Multiplicera" #: ../data/functions.xml.in.h:166 msgid "r:multiply" msgstr "multiplicera" #: ../data/functions.xml.in.h:167 msgid "Factors" msgstr "Faktorer" #: ../data/functions.xml.in.h:168 msgid "Add" msgstr "Addera" #: ../data/functions.xml.in.h:169 msgid "r:add" msgstr "addera" #: ../data/functions.xml.in.h:170 msgid "Terms" msgstr "Termer" #: ../data/functions.xml.in.h:171 msgid "Subtract" msgstr "Subtrahera" #: ../data/functions.xml.in.h:172 msgid "r:subtract" msgstr "subtrahera" #: ../data/functions.xml.in.h:173 msgid "Divide" msgstr "Dela" #: ../data/functions.xml.in.h:174 msgid "r:divide" msgstr "dela" #: ../data/functions.xml.in.h:175 msgid "Raise" msgstr "Upphöj" #: ../data/functions.xml.in.h:176 msgid "r:raise" msgstr "upphöj" #: ../data/functions.xml.in.h:177 msgid "Base" msgstr "Bas" #: ../data/functions.xml.in.h:178 msgid "Polynomials" msgstr "Polynomer" #: ../data/functions.xml.in.h:179 msgid "Coefficient" msgstr "Koefficient" #: ../data/functions.xml.in.h:180 msgid "r:coeff" msgstr "" #: ../data/functions.xml.in.h:181 msgid "Polynomial" msgstr "Polynom" #: ../data/functions.xml.in.h:182 msgid "Leading Coefficient" msgstr "Ledande koefficient" #: ../data/functions.xml.in.h:183 msgid "r:lcoeff" msgstr "" #: ../data/functions.xml.in.h:184 msgid "Trailing Coefficient" msgstr "Avslutande koefficient" #: ../data/functions.xml.in.h:185 msgid "r:tcoeff" msgstr "" #: ../data/functions.xml.in.h:186 msgid "Polynomial Degree" msgstr "Polynomgrad" #: ../data/functions.xml.in.h:187 msgid "r:degree" msgstr "grad" #: ../data/functions.xml.in.h:188 msgid "Lowest Degree (Valuation)" msgstr "Lägsta grad (valuering)" #: ../data/functions.xml.in.h:189 msgid "r:ldegree" msgstr "" #: ../data/functions.xml.in.h:190 msgid "Content Part" msgstr "Innehållsdel" #: ../data/functions.xml.in.h:191 msgid "r:pcontent" msgstr "" #: ../data/functions.xml.in.h:192 msgid "Primitive Part" msgstr "Primitiv del" #: ../data/functions.xml.in.h:193 msgid "r:primpart" msgstr "" #: ../data/functions.xml.in.h:194 msgid "Unit Part" msgstr "Enhetsdel" #: ../data/functions.xml.in.h:195 msgid "r:punit" msgstr "" #: ../data/functions.xml.in.h:196 msgid "Greatest Common Divisor" msgstr "Största gemensamma delare" #: ../data/functions.xml.in.h:197 msgid "r:gcd" msgstr "" #: ../data/functions.xml.in.h:198 msgid "1st value" msgstr "1:a värdet" #: ../data/functions.xml.in.h:199 msgid "2nd value" msgstr "2:a värdet" #: ../data/functions.xml.in.h:200 msgid "Least Common Multiple" msgstr "Minsta gemensamma multipel" #: ../data/functions.xml.in.h:201 msgid "r:lcm" msgstr "" #: ../data/functions.xml.in.h:202 msgid "Rounding" msgstr "Avrundning" #: ../data/functions.xml.in.h:203 msgid "Round" msgstr "Avrunda" #: ../data/functions.xml.in.h:204 msgid "r:round" msgstr "avrunda" #: ../data/functions.xml.in.h:205 msgid "Round Downwards" msgstr "Avrunda neråt" #: ../data/functions.xml.in.h:206 msgid "r:floor" msgstr "golv" #: ../data/functions.xml.in.h:207 msgid "Round Upwards" msgstr "Avrunda uppåt" #: ../data/functions.xml.in.h:208 msgid "r:ceil" msgstr "tak" #: ../data/functions.xml.in.h:209 msgid "Round Towards Zero" msgstr "Avrunda mot noll" #: ../data/functions.xml.in.h:210 msgid "r:trunc" msgstr "" #: ../data/functions.xml.in.h:211 msgid "Extract Integer Part" msgstr "Extrahera heltal" #: ../data/functions.xml.in.h:212 msgid "r:int" msgstr "" #: ../data/functions.xml.in.h:213 msgid "Extract Fractional Part" msgstr "Extrahera bråkdel" #: ../data/functions.xml.in.h:214 msgid "r:frac" msgstr "" #: ../data/functions.xml.in.h:215 msgid "Number Bases" msgstr "Nummerbaser" #: ../data/functions.xml.in.h:216 msgid "Number Base" msgstr "Nummerbas" #: ../data/functions.xml.in.h:217 msgid "r:base" msgstr "bas" #: ../data/functions.xml.in.h:218 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:219 msgid "Binary" msgstr "Binär" #: ../data/functions.xml.in.h:220 msgid "r:bin" msgstr "" #: ../data/functions.xml.in.h:221 msgid "Returns an integer from a binary number" msgstr "Returnerar ett heltal från ett binärt tal" #: ../data/functions.xml.in.h:222 msgid "Binary number" msgstr "Binärt nummer" #: ../data/functions.xml.in.h:223 msgid "Octal" msgstr "Oktal" #: ../data/functions.xml.in.h:224 msgid "r:oct" msgstr "okt" #: ../data/functions.xml.in.h:225 msgid "Returns an integer from an octal number" msgstr "Returnerar ett heltal från ett oktalt tal" #: ../data/functions.xml.in.h:226 msgid "Octal number" msgstr "Oktalt nummer" #: ../data/functions.xml.in.h:227 msgid "Hexadecimal" msgstr "Hexadecimal" #: ../data/functions.xml.in.h:228 msgid "r:hex" msgstr "" #: ../data/functions.xml.in.h:229 msgid "Returns a value from a hexadecimal number" msgstr "Returnerar ett värde från ett hexadecimalt tal" #: ../data/functions.xml.in.h:230 msgid "Hexadecimal number" msgstr "Hexadecimalt nummer" #: ../data/functions.xml.in.h:231 msgid "Integers" msgstr "Heltal" #: ../data/functions.xml.in.h:232 msgid "Even" msgstr "Jämnt" #: ../data/functions.xml.in.h:233 msgid "r:even" msgstr "jämn" #: ../data/functions.xml.in.h:234 msgid "Odd" msgstr "Ojämnt" #: ../data/functions.xml.in.h:235 msgid "r:odd" msgstr "udda" #: ../data/functions.xml.in.h:236 msgid "Step Functions" msgstr "Språngfunktioner" #: ../data/functions.xml.in.h:237 msgid "Heaviside Step Function" msgstr "Heavisides stegfunktion" #: ../data/functions.xml.in.h:238 msgid "r:heaviside" msgstr "" #: ../data/functions.xml.in.h:239 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 "" "Stegfunktion även kallad \"enhetsstegfunktion\". Returnerar 0 om x < 0, 1 " "om x > 0, och 1/2 om x = 0." #: ../data/functions.xml.in.h:240 msgid "Ramp Function" msgstr "Rampfunktion" #: ../data/functions.xml.in.h:241 msgid "r:ramp" msgstr "" #: ../data/functions.xml.in.h:242 msgid "Rectangular Function" msgstr "Rektangulär funktion" #: ../data/functions.xml.in.h:243 msgid "r:rectangular" msgstr "rektangulär" #: ../data/functions.xml.in.h:244 msgid "Sigmoid Function" msgstr "Sigmoidfunktion" #: ../data/functions.xml.in.h:245 msgid "r:sigmoid" msgstr "" #: ../data/functions.xml.in.h:246 msgid "Logit Transformation" msgstr "Logit transformation" #: ../data/functions.xml.in.h:247 msgid "r:logit" msgstr "" #: ../data/functions.xml.in.h:248 msgid "Triangular Function" msgstr "Triangulär funktion" #: ../data/functions.xml.in.h:249 msgid "r:triangular" msgstr "triangulär" #: ../data/functions.xml.in.h:250 msgid "Analysis" msgstr "Analys" #: ../data/functions.xml.in.h:251 msgid "Real Part" msgstr "Reell del" #: ../data/functions.xml.in.h:252 msgid "r:re" msgstr "" #: ../data/functions.xml.in.h:253 msgid "Complex number" msgstr "Komplext nummer" #: ../data/functions.xml.in.h:254 msgid "Imaginary Part" msgstr "Imaginär del" #: ../data/functions.xml.in.h:255 msgid "r:im" msgstr "" #: ../data/functions.xml.in.h:256 msgid "Gamma Function" msgstr "Gammafunktion" #: ../data/functions.xml.in.h:257 msgid "r:gamma" msgstr "" #: ../data/functions.xml.in.h:258 msgid "Beta Function" msgstr "Betafunktion" #: ../data/functions.xml.in.h:259 msgid "r:beta" msgstr "" #: ../data/functions.xml.in.h:260 msgid "Exponents & Logarithms" msgstr "Exponenter & Logaritmer" #: ../data/functions.xml.in.h:261 msgid "Square Root" msgstr "Kvadratrot" #: ../data/functions.xml.in.h:262 msgid "au:√,r:sqrt" msgstr "" #: ../data/functions.xml.in.h:263 msgid "Square" msgstr "Kvadrat" #: ../data/functions.xml.in.h:264 msgid "r:sq" msgstr "" #: ../data/functions.xml.in.h:265 msgid "Exponential (e^x)" msgstr "Exponentialfunktion (e^x)" #: ../data/functions.xml.in.h:266 msgid "r:exp" msgstr "" #: ../data/functions.xml.in.h:267 msgid "Natural Logarithm" msgstr "Naturlig logaritm" #: ../data/functions.xml.in.h:268 msgid "r:ln" msgstr "" #: ../data/functions.xml.in.h:269 msgid "Base-N Logarithm" msgstr "Bas-N-logaritm" #: ../data/functions.xml.in.h:270 msgid "r:log" msgstr "" #: ../data/functions.xml.in.h:271 msgid "Lambert W Function (Omega Function, Product Log)" msgstr "Lambers W-funktion (Omegafunktionen)" #: ../data/functions.xml.in.h:272 msgid "r:lambertw,productlog" msgstr "" #: ../data/functions.xml.in.h:273 msgid "Returns the inverse function for mx*e^x as ln() does for e^x." msgstr "" "Returnerar den inverterade funktionen för mx*e^x såsom ln() gör för e^x." #: ../data/functions.xml.in.h:274 msgid "Base-2 Logarithm" msgstr "Bas-2-logaritm" #: ../data/functions.xml.in.h:275 msgid "rs:log2" msgstr "" #: ../data/functions.xml.in.h:276 msgid "Returns the base n logarithm." msgstr "Returnerar logaritmen för bas n." #: ../data/functions.xml.in.h:277 msgid "Base-10 Logarithm" msgstr "Bas-10-logaritm" #: ../data/functions.xml.in.h:278 msgid "rs:log10" msgstr "" #: ../data/functions.xml.in.h:279 msgid "Complex Exponential (Cis)" msgstr "Komplex exponentialfunction (Cis)" #: ../data/functions.xml.in.h:280 msgid "r:cis" msgstr "" #: ../data/functions.xml.in.h:281 msgid "2 raised the to power X" msgstr "2 upphöjt med X" #: ../data/functions.xml.in.h:282 msgid "rs:exp2" msgstr "" #: ../data/functions.xml.in.h:283 msgid "10 raised the to power X" msgstr "10 upphöjt med X" #: ../data/functions.xml.in.h:284 msgid "rs:exp10" msgstr "" #: ../data/functions.xml.in.h:285 msgid "Cube Root" msgstr "Kubikrot" #: ../data/functions.xml.in.h:286 msgid "au:∛,r:cbrt" msgstr "" #: ../data/functions.xml.in.h:287 msgid "Nth root" msgstr "N:te roten" #: ../data/functions.xml.in.h:288 msgid "r:root" msgstr "rot" #: ../data/functions.xml.in.h:289 msgid "X raised to the power Y" msgstr "X upphöjt med Y" #: ../data/functions.xml.in.h:290 msgid "r:pow" msgstr "upphöj" #: ../data/functions.xml.in.h:291 msgid "Square root (x * pi)" msgstr "Kvadratrot (x * pi)" #: ../data/functions.xml.in.h:292 msgid "r:sqrtpi" msgstr "" #: ../data/functions.xml.in.h:293 msgid "Returns the non-negative square root of x * pi" msgstr "Returnerar icke-negativa kvadratroten av x * pi" #: ../data/functions.xml.in.h:294 msgid "Non-negative value" msgstr "Icke-negativt nummer" #: ../data/functions.xml.in.h:295 msgid "Trigonometry" msgstr "Trigonometri" #: ../data/functions.xml.in.h:296 msgid "Sine" msgstr "Sinus" #: ../data/functions.xml.in.h:297 msgid "r:sin" msgstr "" #: ../data/functions.xml.in.h:298 msgid "Angle" msgstr "Vinkel" #: ../data/functions.xml.in.h:299 msgid "Cosine" msgstr "Cosinus" #: ../data/functions.xml.in.h:300 msgid "r:cos" msgstr "" #: ../data/functions.xml.in.h:301 msgid "Tangent" msgstr "Tangens" #: ../data/functions.xml.in.h:302 msgid "r:tan" msgstr "" #: ../data/functions.xml.in.h:303 msgid "Inverse Sine" msgstr "Invers sinus" #: ../data/functions.xml.in.h:304 msgid "r:asin" msgstr "" #: ../data/functions.xml.in.h:305 msgid "Inverse Cosine" msgstr "Invers cosinus" #: ../data/functions.xml.in.h:306 msgid "r:acos" msgstr "" #: ../data/functions.xml.in.h:307 msgid "Inverse Tangent" msgstr "Invers tangens" #: ../data/functions.xml.in.h:308 msgid "r:atan" msgstr "" #: ../data/functions.xml.in.h:309 msgid "Hyperbolic Sine" msgstr "Sinus hyperbolicus" #: ../data/functions.xml.in.h:310 msgid "r:sinh" msgstr "" #: ../data/functions.xml.in.h:311 msgid "Hyperbolic Cosine" msgstr "Cosinus hyperbolicus" #: ../data/functions.xml.in.h:312 msgid "r:cosh" msgstr "" #: ../data/functions.xml.in.h:313 msgid "Hyperbolic Tangent" msgstr "Tangens hyperbolicus" #: ../data/functions.xml.in.h:314 msgid "r:tanh" msgstr "" #: ../data/functions.xml.in.h:315 msgid "Inverse Hyperbolic Sine" msgstr "Invers sinus hyperbolicus" #: ../data/functions.xml.in.h:316 msgid "r:asinh" msgstr "" #: ../data/functions.xml.in.h:317 msgid "Inverse Hyperbolic Cosine" msgstr "Invers cosinus hyperbolicus" #: ../data/functions.xml.in.h:318 msgid "r:acosh" msgstr "" #: ../data/functions.xml.in.h:319 msgid "Inverse Hyperbolic Tangent" msgstr "Invers tangens hyperbolicus" #: ../data/functions.xml.in.h:320 msgid "r:atanh" msgstr "" #: ../data/functions.xml.in.h:321 msgid "Radians to Default Angle Unit" msgstr "Radians till färvald vinkelenhet" #: ../data/functions.xml.in.h:322 msgid "r:radtodef" msgstr "" #: ../data/functions.xml.in.h:323 msgid "Radians" msgstr "Radianer" #: ../data/functions.xml.in.h:324 msgid "Secant" msgstr "Sekant" #: ../data/functions.xml.in.h:325 msgid "r:sec" msgstr "" #: ../data/functions.xml.in.h:326 msgid "Cosecant" msgstr "Cosekant" #: ../data/functions.xml.in.h:327 msgid "r:csc" msgstr "" #: ../data/functions.xml.in.h:328 msgid "Cotangent" msgstr "Cotangens" #: ../data/functions.xml.in.h:329 msgid "r:cot" msgstr "" #: ../data/functions.xml.in.h:330 msgid "Hyperbolic Secant" msgstr "Sekant hyperbolicus" #: ../data/functions.xml.in.h:331 msgid "r:sech" msgstr "" #: ../data/functions.xml.in.h:332 msgid "Hyperbolic Cosecant" msgstr "Cosekant hyperbolicus" #: ../data/functions.xml.in.h:333 msgid "r:csch" msgstr "" #: ../data/functions.xml.in.h:334 msgid "Hyperbolic Cotangent" msgstr "Cotangens hyperbolicus" #: ../data/functions.xml.in.h:335 msgid "r:coth" msgstr "" #: ../data/functions.xml.in.h:336 msgid "Inverse Secant" msgstr "Invers sekant" #: ../data/functions.xml.in.h:337 msgid "r:asec" msgstr "" #: ../data/functions.xml.in.h:338 msgid "Inverse Cosecant" msgstr "Invers cosekant" #: ../data/functions.xml.in.h:339 msgid "r:acsc" msgstr "" #: ../data/functions.xml.in.h:340 msgid "Inverse Cotangent" msgstr "Invers cotangens" #: ../data/functions.xml.in.h:341 msgid "r:acot" msgstr "" #: ../data/functions.xml.in.h:342 msgid "Inverse Hyperbolic Secant" msgstr "Invers sekant hyperbolicus" #: ../data/functions.xml.in.h:343 msgid "r:asech" msgstr "" #: ../data/functions.xml.in.h:344 msgid "Inverse Hyperbolic Cosecant" msgstr "Invers cosekant hyperbolicus" #: ../data/functions.xml.in.h:345 msgid "r:acsch" msgstr "" #: ../data/functions.xml.in.h:346 msgid "Inverse Hyperbolic Cotangent" msgstr "Invers cotangens hyperbolicus" #: ../data/functions.xml.in.h:347 msgid "r:acoth" msgstr "" #: ../data/functions.xml.in.h:348 msgid "Miscellaneous" msgstr "Diverse" #: ../data/functions.xml.in.h:349 msgid "Body Mass Index (BMI)" msgstr "" #: ../data/functions.xml.in.h:350 msgid "-r:bmi" msgstr "" #: ../data/functions.xml.in.h:351 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:353 msgid "Length" msgstr "Längd" #: ../data/functions.xml.in.h:354 msgid "Riemann Zeta" msgstr "Riemanns Zeta" #: ../data/functions.xml.in.h:355 msgid "r:zeta" msgstr "" #: ../data/functions.xml.in.h:356 msgid "Integral point" msgstr "Integralpunkt" #: ../data/functions.xml.in.h:357 msgid "Roman Number" msgstr "Romerskt tal" #: ../data/functions.xml.in.h:358 msgid "r:roman" msgstr "" #: ../data/functions.xml.in.h:359 msgid "Returns the value of a roman number." msgstr "Returnerar värdet för romerska siffror." #: ../data/functions.xml.in.h:360 msgid "Roman number" msgstr "Romerskt tal" #: ../data/functions.xml.in.h:361 msgid "Kronecker Delta" msgstr "Kroneckerdelta" #: ../data/functions.xml.in.h:362 msgid "r:kronecker" msgstr "" #: ../data/functions.xml.in.h:363 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:364 msgid "Value 1 (i)" msgstr "Värde 1 (i)" #: ../data/functions.xml.in.h:365 msgid "Value 2 (j)" msgstr "Värde 2 (j)" #: ../data/functions.xml.in.h:366 msgid "Fibonacci Number" msgstr "Fibonaccital" #: ../data/functions.xml.in.h:367 msgid "r:fibonacci" msgstr "" #: ../data/functions.xml.in.h:368 msgid "Returns the n-th term of the Fibonacci sequence." msgstr "Returnerar tal n i Fibonaccis talföljd." #: ../data/functions.xml.in.h:369 msgid "Index (n)" msgstr "Index (n)" #: ../data/functions.xml.in.h:370 msgid "Statistics" msgstr "Statistik" #: ../data/functions.xml.in.h:371 msgid "Descriptive Statistics" msgstr "Beskrivande statistik" #: ../data/functions.xml.in.h:372 msgid "Sum (total)" msgstr "Summa (total)" #: ../data/functions.xml.in.h:373 msgid "r:total" msgstr "totalt" #: ../data/functions.xml.in.h:374 msgid "Data" msgstr "Data" #: ../data/functions.xml.in.h:375 msgid "Percentile" msgstr "Percentil" #: ../data/functions.xml.in.h:376 msgid "r:percentile" msgstr "percentil" #: ../data/functions.xml.in.h:378 #, no-c-format msgid "Percentile (%)" msgstr "Percentil (%)" #: ../data/functions.xml.in.h:379 msgid "r:min" msgstr "" #: ../data/functions.xml.in.h:380 msgid "Returns the lowest value." msgstr "Returnerar det lägsta värdet." #: ../data/functions.xml.in.h:381 msgid "r:max" msgstr "" #: ../data/functions.xml.in.h:382 msgid "Returns the highest value." msgstr "Returnerar det högsta värdet." #: ../data/functions.xml.in.h:383 msgid "Mode" msgstr "Typvärde" #: ../data/functions.xml.in.h:384 msgid "r:mode" msgstr "typvärde" #: ../data/functions.xml.in.h:385 msgid "Returns the most frequently occurring value." msgstr "Returnerar det mest förekommande värdet." #: ../data/functions.xml.in.h:386 msgid "Range" msgstr "Omfång" #: ../data/functions.xml.in.h:387 msgid "r:range" msgstr "omfång" #: ../data/functions.xml.in.h:388 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:389 msgid "Median" msgstr "Median" #: ../data/functions.xml.in.h:390 msgid "r:median" msgstr "" #: ../data/functions.xml.in.h:391 msgid "Quartile" msgstr "Kvartil" #: ../data/functions.xml.in.h:392 msgid "r:quartile" msgstr "kvartil" #: ../data/functions.xml.in.h:393 msgid "Decile" msgstr "Decil" #: ../data/functions.xml.in.h:394 msgid "r:decile" msgstr "decil" #: ../data/functions.xml.in.h:395 msgid "Interquartile Range" msgstr "Kvartilavstånd" #: ../data/functions.xml.in.h:396 msgid "r:iqr" msgstr "" #: ../data/functions.xml.in.h:397 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:398 msgid "Number of Samples" msgstr "Antal" #. Number of samples #: ../data/functions.xml.in.h:400 msgid "r:number" msgstr "antal" #: ../data/functions.xml.in.h:401 msgid "Returns the number of samples." msgstr "Returnerar antalet prov." #: ../data/functions.xml.in.h:402 msgid "Random Number" msgstr "Slumptal" #: ../data/functions.xml.in.h:403 msgid "r:rand" msgstr "slumptal" #: ../data/functions.xml.in.h:404 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:405 msgid "Ceil" msgstr "Tak" #: ../data/functions.xml.in.h:406 msgid "Random Number Between Limits" msgstr "Slumptal mellan gränser" #: ../data/functions.xml.in.h:407 msgid "r:randbetween" msgstr "" #: ../data/functions.xml.in.h:408 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:409 msgid "Bottom" msgstr "Nedre gräns" #: ../data/functions.xml.in.h:410 msgid "Top" msgstr "Övre gräns" #: ../data/functions.xml.in.h:411 msgid "Means" msgstr "Medelvärde" #: ../data/functions.xml.in.h:412 msgid "Mean" msgstr "Medelvärde" #: ../data/functions.xml.in.h:413 msgid "r:mean,average" msgstr "medel" #: ../data/functions.xml.in.h:414 msgid "Harmonic Mean" msgstr "Harmoniskt medelvärde" #: ../data/functions.xml.in.h:415 msgid "r:harmmean" msgstr "harmmedel" #: ../data/functions.xml.in.h:416 msgid "Geometric Mean" msgstr "Geometriskt medelvärde" #: ../data/functions.xml.in.h:417 msgid "r:geomean" msgstr "geomedel" #: ../data/functions.xml.in.h:418 msgid "Trimmed Mean" msgstr "Trimmat medelvärde" #: ../data/functions.xml.in.h:419 msgid "r:trimmean" msgstr "" #: ../data/functions.xml.in.h:420 msgid "Trimmed percentage (at each end)" msgstr "Trimmad procent (i båda ändarna)" #: ../data/functions.xml.in.h:421 msgid "Winsorized Mean" msgstr "Winsor-medelvärde" #: ../data/functions.xml.in.h:422 msgid "r:winsormean" msgstr "" #: ../data/functions.xml.in.h:423 msgid "Winsorized percentage (at each end)" msgstr "Winsorprocent (i båda ändarna)" #: ../data/functions.xml.in.h:424 msgid "Weighted Mean" msgstr "Viktat medelvärde" #: ../data/functions.xml.in.h:425 msgid "r:weighmean" msgstr "" #: ../data/functions.xml.in.h:426 msgid "Weights" msgstr "Vikter" #: ../data/functions.xml.in.h:427 msgid "Quadratic Mean (RMS)" msgstr "Kvadratiskt medelvärde" #: ../data/functions.xml.in.h:428 msgid "r:rms" msgstr "" #: ../data/functions.xml.in.h:429 msgid "Moments" msgstr "Moment" #: ../data/functions.xml.in.h:430 msgid "Standard Deviation (entire population)" msgstr "Standardavvikelse (komplett population)" #: ../data/functions.xml.in.h:431 msgid "r:stdevp" msgstr "" #: ../data/functions.xml.in.h:432 msgid "Standard Deviation (random sampling)" msgstr "Standardavvikelse (slumpmässigt urval)" #: ../data/functions.xml.in.h:433 msgid "r:stdev" msgstr "standardavvikelse" #: ../data/functions.xml.in.h:434 msgid "Variance (entire population)" msgstr "Varians (komplett population)" #: ../data/functions.xml.in.h:435 msgid "r:varp" msgstr "" #: ../data/functions.xml.in.h:436 msgid "Variance (random sampling)" msgstr "Varians (slumpmässigt urval)" #: ../data/functions.xml.in.h:437 msgid "r:var" msgstr "" #: ../data/functions.xml.in.h:438 msgid "Standard Error" msgstr "Standardfel" #: ../data/functions.xml.in.h:439 msgid "r:stderr" msgstr "standardfel" #: ../data/functions.xml.in.h:440 msgid "Mean Deviation" msgstr "Medelavvikelse" #: ../data/functions.xml.in.h:441 msgid "r:meandev" msgstr "medelavvikelse" #: ../data/functions.xml.in.h:442 msgid "Covariance" msgstr "Kovarians" #: ../data/functions.xml.in.h:443 msgid "r:cov,r:covar" msgstr "" #: ../data/functions.xml.in.h:444 msgid "Data 1" msgstr "Data 1" #: ../data/functions.xml.in.h:445 msgid "Data 2" msgstr "Data 2" #: ../data/functions.xml.in.h:446 msgid "Pooled Variance" msgstr "Gemensam varians" #: ../data/functions.xml.in.h:447 msgid "r:poolvar" msgstr "" #: ../data/functions.xml.in.h:448 msgid "Regression" msgstr "Regression" #: ../data/functions.xml.in.h:449 msgid "Statistical Correlation" msgstr "Statistisk korrelation" #: ../data/functions.xml.in.h:450 msgid "r:cor" msgstr "" #: ../data/functions.xml.in.h:451 msgid "Pearson's Correlation Coefficient" msgstr "Pearsons korrelationskoefficient" #: ../data/functions.xml.in.h:452 msgid "r:pearson,r:correl" msgstr "korrelation" #: ../data/functions.xml.in.h:453 msgid "Spearman's Rho" msgstr "Spearmans Rho" #: ../data/functions.xml.in.h:454 msgid "r:spearman" msgstr "" #: ../data/functions.xml.in.h:455 msgid "Durbin-Watson" msgstr "Durbin-Watson" #: ../data/functions.xml.in.h:456 msgid "r:durbinwatson" msgstr "" #: ../data/functions.xml.in.h:457 msgid "Statistical Tests" msgstr "Statistika tester" #: ../data/functions.xml.in.h:458 msgid "Unpaired T-Test" msgstr "T-test" #: ../data/functions.xml.in.h:459 msgid "r:ttest" msgstr "" #: ../data/functions.xml.in.h:460 msgid "Paired T-Test" msgstr "Parvist t-test" #: ../data/functions.xml.in.h:461 msgid "r:pttest" msgstr "" #: ../data/functions.xml.in.h:462 msgid "Distribution" msgstr "Distribution" #: ../data/functions.xml.in.h:463 msgid "Rayleigh Distribution" msgstr "Rayleighfördelning" #: ../data/functions.xml.in.h:464 msgid "r:rayleigh" msgstr "" #: ../data/functions.xml.in.h:465 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:466 msgid "X" msgstr "X" #: ../data/functions.xml.in.h:467 msgid "Sigma" msgstr "Sigma" #: ../data/functions.xml.in.h:468 msgid "Rayleigh Tail Distribution" msgstr "Rayleighsvansfördelning" #: ../data/functions.xml.in.h:469 msgid "r:rayleightail" msgstr "" #: ../data/functions.xml.in.h:470 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:471 msgid "Pareto Distribution" msgstr "Paretofördelning" #: ../data/functions.xml.in.h:472 msgid "r:pareto" msgstr "" #: ../data/functions.xml.in.h:473 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:474 msgid "Scale" msgstr "Skala" #: ../data/functions.xml.in.h:475 msgid "Logistic Distribution" msgstr "Logistisk distribution" #: ../data/functions.xml.in.h:476 msgid "r:logistic" msgstr "" #: ../data/functions.xml.in.h:477 msgid "" "Returns the probability density p(x) at x for a logistic distribution with " "scale parameter. (from Gnumeric)" msgstr "" #: ../data/functions.xml.in.h:478 msgid "Date & Time" msgstr "Datum & Tid" #: ../data/functions.xml.in.h:479 msgid "Days between two dates" msgstr "Antal dagar mellan två datum" #: ../data/functions.xml.in.h:480 msgid "r:days" msgstr "dagar" #: ../data/functions.xml.in.h:481 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:482 msgid "First date" msgstr "Första datumet" #: ../data/functions.xml.in.h:483 msgid "Second date" msgstr "Andra datumet" #: ../data/functions.xml.in.h:484 msgid "Day counting basis" msgstr "Dagsräkningssystem" #: ../data/functions.xml.in.h:485 msgid "Financial function mode" msgstr "Läge för financiella funktioner" #: ../data/functions.xml.in.h:486 msgid "Years between two dates" msgstr "Antal är mellan två datum" #: ../data/functions.xml.in.h:487 msgid "r:yearfrac" msgstr "" #: ../data/functions.xml.in.h:488 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:489 msgid "Week of Year" msgstr "Vecka på året" #: ../data/functions.xml.in.h:490 msgid "r:week" msgstr "vecka" #: ../data/functions.xml.in.h:491 msgid "Date" msgstr "Datum" #: ../data/functions.xml.in.h:492 msgid "Week begins on Sunday" msgstr "Veckor börjar på söndag" #: ../data/functions.xml.in.h:493 msgid "Day of Week" msgstr "Veckodag" #: ../data/functions.xml.in.h:494 msgid "r:weekday" msgstr "veckodag" #: ../data/functions.xml.in.h:495 msgid "Month" msgstr "Månad" #: ../data/functions.xml.in.h:496 msgid "r:month" msgstr "månad" #: ../data/functions.xml.in.h:497 msgid "Day of Month" msgstr "Månadsdag" #: ../data/functions.xml.in.h:498 msgid "r:day" msgstr "dag" #: ../data/functions.xml.in.h:499 msgid "Year" msgstr "År" #: ../data/functions.xml.in.h:500 msgid "r:year" msgstr "år" #: ../data/functions.xml.in.h:501 msgid "Day of Year" msgstr "Dag på året" #: ../data/functions.xml.in.h:502 msgid "r:yearday" msgstr "årsdag" #: ../data/functions.xml.in.h:503 msgid "Current Time" msgstr "Nuvarande tid" #: ../data/functions.xml.in.h:504 msgid "r:time" msgstr "tid" #: ../data/functions.xml.in.h:505 msgid "Standard Date Format" msgstr "Standard-datumformat" #: ../data/functions.xml.in.h:506 msgid "r:isodate" msgstr "isodatum" #: ../data/functions.xml.in.h:507 msgid "Local Date Format" msgstr "Lokalt datumformat" #: ../data/functions.xml.in.h:508 msgid "r:localdate" msgstr "lokalt_datum" #: ../data/functions.xml.in.h:509 msgid "Date to Unix Timestamp" msgstr "Datum till Unixtid" #: ../data/functions.xml.in.h:510 msgid "r:timestamp" msgstr "" #: ../data/functions.xml.in.h:511 msgid "Unix Timestamp to Date" msgstr "Unixtid till datum" #: ../data/functions.xml.in.h:512 msgid "r:stamptodate" msgstr "" #: ../data/functions.xml.in.h:513 msgid "Timestamp" msgstr "Unixtid" #: ../data/functions.xml.in.h:514 msgid "Add Days" msgstr "Addera dagar" #: ../data/functions.xml.in.h:515 msgid "r:addDays" msgstr "adderaDagar" #: ../data/functions.xml.in.h:516 msgid "Days" msgstr "Dagar" #: ../data/functions.xml.in.h:517 msgid "Add Months" msgstr "Addera månader" #: ../data/functions.xml.in.h:518 msgid "r:addMonths" msgstr "adderaMånader" #: ../data/functions.xml.in.h:519 msgid "Months" msgstr "Månader" #: ../data/functions.xml.in.h:520 msgid "Add Years" msgstr "Addera år" #: ../data/functions.xml.in.h:521 msgid "r:addYears" msgstr "adderaÅr" #: ../data/functions.xml.in.h:522 msgid "Years" msgstr "Antal år" #: ../data/functions.xml.in.h:523 msgid "Add Time" msgstr "Addera tid" #: ../data/functions.xml.in.h:524 msgid "r:addTime" msgstr "adderaTid" #: ../data/functions.xml.in.h:525 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:526 ../data/units.xml.in.h:132 msgid "Time" msgstr "Tid" #: ../data/functions.xml.in.h:527 msgid "Utilities" msgstr "Verktyg" #: ../data/functions.xml.in.h:528 msgid "ASCII Value" msgstr "ASCII värde" #: ../data/functions.xml.in.h:529 msgid "r:code" msgstr "kod" #: ../data/functions.xml.in.h:530 msgid "Character" msgstr "Tecken" #: ../data/functions.xml.in.h:531 msgid "ASCII Char" msgstr "ASCII tecken" #: ../data/functions.xml.in.h:532 msgid "r:char" msgstr "tecken" #: ../data/functions.xml.in.h:533 msgid "Length of string" msgstr "Textsträngslängd" #: ../data/functions.xml.in.h:534 msgid "r:len" msgstr "längd" #: ../data/functions.xml.in.h:535 msgid "Text" msgstr "Text" #: ../data/functions.xml.in.h:536 msgid "Concatenate Strings" msgstr "Sammanfoga textsträngar" #: ../data/functions.xml.in.h:537 msgid "r:concatenate" msgstr "sammanfoga" #: ../data/functions.xml.in.h:538 msgid "Text string 1" msgstr "Textsträng 1" #: ../data/functions.xml.in.h:539 msgid "Text string 2" msgstr "Textsträng 2" #: ../data/functions.xml.in.h:540 msgid "Replace" msgstr "Ersätt" #: ../data/functions.xml.in.h:541 msgid "r:replace" msgstr "ersätt" #: ../data/functions.xml.in.h:542 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:543 msgid "Expression" msgstr "Uttryck" #: ../data/functions.xml.in.h:544 msgid "Original value" msgstr "Ursprungligt värde" #: ../data/functions.xml.in.h:545 msgid "New value" msgstr "Nytt värde" #: ../data/functions.xml.in.h:546 msgid "Precalculate expression" msgstr "Beräkna uttrycket först" #: ../data/functions.xml.in.h:547 msgid "Strip Units" msgstr "Ta bort enheter" #: ../data/functions.xml.in.h:548 msgid "r:nounit,strip_units" msgstr "" #: ../data/functions.xml.in.h:549 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:550 msgid "Process Vector Elements" msgstr "Modifiera vektorelement" #: ../data/functions.xml.in.h:551 msgid "r:process" msgstr "" #: ../data/functions.xml.in.h:552 msgid "Element variable" msgstr "Elementvariabel" #: ../data/functions.xml.in.h:553 msgid "Index variable" msgstr "Indexvariabel" #: ../data/functions.xml.in.h:554 msgid "Vector variable" msgstr "Vektorvariabel" #: ../data/functions.xml.in.h:555 msgid "Process Matrix Elements" msgstr "Modifiera matriselement" #: ../data/functions.xml.in.h:556 msgid "r:processm" msgstr "" #: ../data/functions.xml.in.h:557 msgid "Row variable" msgstr "Radvariabel" #: ../data/functions.xml.in.h:558 msgid "Column variable" msgstr "Kolumnvariabel" #: ../data/functions.xml.in.h:559 msgid "Matrix variable" msgstr "Matrisvariabel" #: ../data/functions.xml.in.h:560 msgid "Custom Sum of Elements" msgstr "Anpassad elementsumma" #: ../data/functions.xml.in.h:561 msgid "r:csum" msgstr "" #: ../data/functions.xml.in.h:562 msgid "First element" msgstr "Första elementet" #: ../data/functions.xml.in.h:563 msgid "Last element" msgstr "Sista elementet" #: ../data/functions.xml.in.h:564 msgid "Initial value" msgstr "Initialt värde" #: ../data/functions.xml.in.h:565 msgid "Value variable" msgstr "Värdevariabel" #: ../data/functions.xml.in.h:566 msgid "Select Vector Elements" msgstr "Utvälj vektorelement" #: ../data/functions.xml.in.h:567 msgid "r:select" msgstr "" #: ../data/functions.xml.in.h:568 msgid "Condition" msgstr "Förutsättning" #: ../data/functions.xml.in.h:569 msgid "Select first match" msgstr "Välj första matchande element" #: ../data/functions.xml.in.h:570 msgid "r:function" msgstr "funktion" #: ../data/functions.xml.in.h:571 msgid "Arguments" msgstr "Parametrar" #: ../data/functions.xml.in.h:572 msgid "Title" msgstr "Titel" #: ../data/functions.xml.in.h:573 msgid "r:title" msgstr "titel" #: ../data/functions.xml.in.h:575 msgid "Display Error" msgstr "Visa felmeddelande" #: ../data/functions.xml.in.h:576 msgid "r:error" msgstr "fel" #: ../data/functions.xml.in.h:577 msgid "Message" msgstr "Meddelande" #: ../data/functions.xml.in.h:578 msgid "Display Warning" msgstr "Visa varning" #: ../data/functions.xml.in.h:579 msgid "r:warning" msgstr "varning" #: ../data/functions.xml.in.h:580 msgid "Display Message" msgstr "Visa meddelande" #: ../data/functions.xml.in.h:581 msgid "r:message" msgstr "meddelande" #: ../data/functions.xml.in.h:582 msgid "Save as Variable" msgstr "Spara som variabel" #: ../data/functions.xml.in.h:583 msgid "r:save" msgstr "spara" #: ../data/functions.xml.in.h:584 msgid "Category" msgstr "Kategori" #: ../data/functions.xml.in.h:585 msgid "RPN Stack Register" msgstr "RPN-stackregister" #: ../data/functions.xml.in.h:586 msgid "r:register" msgstr "" #: ../data/functions.xml.in.h:587 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:588 msgid "RPN Stack Vector" msgstr "RPN-stackvektor" #: ../data/functions.xml.in.h:589 msgid "r:stack" msgstr "" #: ../data/functions.xml.in.h:590 msgid "Returns the RPN stack as a vector." msgstr "Returnerar RPN-stacken som en vektor." #: ../data/functions.xml.in.h:591 msgid "Is Number" msgstr "Är nummer" #: ../data/functions.xml.in.h:592 msgid "r:isNumber" msgstr "ärNummer" #: ../data/functions.xml.in.h:593 msgid "Is Real" msgstr "Är reellt" #: ../data/functions.xml.in.h:594 msgid "r:isReal" msgstr "ärReellt" #: ../data/functions.xml.in.h:595 msgid "Is Rational" msgstr "Är rationellt" #: ../data/functions.xml.in.h:596 msgid "r:isRational" msgstr "ärRationellt" #: ../data/functions.xml.in.h:597 msgid "Is Integer" msgstr "Är heltal" #: ../data/functions.xml.in.h:598 msgid "r:isInteger" msgstr "ärHeltal" #: ../data/functions.xml.in.h:599 msgid "Represents Number" msgstr "Representar nummer" #: ../data/functions.xml.in.h:600 msgid "r:representsNumber" msgstr "representerarNummer" #: ../data/functions.xml.in.h:601 msgid "Represents Real" msgstr "Representerar reellt tal" #: ../data/functions.xml.in.h:602 msgid "r:representsReal" msgstr "representerarReelt" #: ../data/functions.xml.in.h:603 msgid "Represents Rational" msgstr "Representerar rationellt tal" #: ../data/functions.xml.in.h:604 msgid "r:representsRational" msgstr "representerarRationellt" #: ../data/functions.xml.in.h:605 msgid "Represents Integer" msgstr "Representerar ett heltal" #: ../data/functions.xml.in.h:606 msgid "r:representsInteger" msgstr "representarHeltal" #: ../data/functions.xml.in.h:607 msgid "Logical" msgstr "Logik" #: ../data/functions.xml.in.h:608 msgid "For...Do" msgstr "För...utför" #: ../data/functions.xml.in.h:609 msgid "r:for" msgstr "för" #: ../data/functions.xml.in.h:610 msgid "Initial value of counter" msgstr "Initialt värde för räknare" #: ../data/functions.xml.in.h:611 msgid "Counter variable" msgstr "Räknarvariabel" #: ../data/functions.xml.in.h:612 msgid "For condition" msgstr "Medans-villkor" #: ../data/functions.xml.in.h:613 msgid "Counter update function" msgstr "Funktion för uppdatering av räknare" #: ../data/functions.xml.in.h:614 msgid "Do function" msgstr "Funktion" #: ../data/functions.xml.in.h:615 msgid "If...Then...Else" msgstr "Om...då...annars" #: ../data/functions.xml.in.h:616 msgid "r:if" msgstr "om" #: ../data/functions.xml.in.h:617 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:618 msgid "Expression if condition is met" msgstr "Uttryck om villkoret uppfylls" #: ../data/functions.xml.in.h:619 msgid "Expression if condition is NOT met" msgstr "Uttryck om villkoret INTE uppfylls" #: ../data/functions.xml.in.h:620 msgid "Logical Exclusive OR" msgstr "" #: ../data/functions.xml.in.h:621 msgid "r:xor" msgstr "" #: ../data/functions.xml.in.h:622 msgid "Value 1" msgstr "Värde 1" #: ../data/functions.xml.in.h:623 msgid "Value 2" msgstr "Värde 2" #: ../data/functions.xml.in.h:624 msgid "Bitwise Exclusive OR" msgstr "" #: ../data/functions.xml.in.h:625 msgid "r:bitxor" msgstr "" #: ../data/functions.xml.in.h:626 msgid "Bitwise Shift" msgstr "" #: ../data/functions.xml.in.h:627 msgid "r:shift" msgstr "" #: ../data/functions.xml.in.h:628 msgid "Bits" msgstr "" #: ../data/functions.xml.in.h:629 msgid "Algebra" msgstr "Algebra" #: ../data/functions.xml.in.h:630 msgid "Sum" msgstr "Summa" #: ../data/functions.xml.in.h:631 msgid "au:Σ,r:sum" msgstr "au:Σ,summa" #: ../data/functions.xml.in.h:632 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:633 msgid "Term expression" msgstr "Termuttryck" #: ../data/functions.xml.in.h:634 msgid "Lower limit (i)" msgstr "Undre gräns (i)" #: ../data/functions.xml.in.h:635 msgid "Upper limit (n)" msgstr "Övre gräns (n)" #: ../data/functions.xml.in.h:636 msgid "Product" msgstr "Produkt" #: ../data/functions.xml.in.h:637 msgid "au:Π,r:product" msgstr "au:Π,produkt" #: ../data/functions.xml.in.h:638 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:639 msgid "Factor expression" msgstr "Faktoruttryck" #: ../data/functions.xml.in.h:640 msgid "Solve for multiple variables" msgstr "Lös för flera variabler" #: ../data/functions.xml.in.h:641 msgid "r:multisolve" msgstr "" #: ../data/functions.xml.in.h:642 msgid "Equation vector" msgstr "Ekvationsvektor" #: ../data/functions.xml.in.h:643 msgid "Variable vector" msgstr "Variabelvektor" #: ../data/functions.xml.in.h:644 msgid "Solve equation" msgstr "Lös ekvation" #: ../data/functions.xml.in.h:645 msgid "r:solve" msgstr "lös" #: ../data/functions.xml.in.h:646 msgid "Equation" msgstr "Ekvation" #: ../data/functions.xml.in.h:647 msgid "With respect to" msgstr "Med avseende på" #: ../data/functions.xml.in.h:648 msgid "Solve for two variables" msgstr "Lös för två variabler" #: ../data/functions.xml.in.h:649 msgid "r:solve2" msgstr "lös2" #: ../data/functions.xml.in.h:650 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:651 msgid "Equation 1" msgstr "Ekvation 1" #: ../data/functions.xml.in.h:652 msgid "Equation 2" msgstr "Ekvation 2" #: ../data/functions.xml.in.h:653 msgid "Variable 1" msgstr "Variabel 1" #: ../data/functions.xml.in.h:654 msgid "Variable 2" msgstr "Variabel 2" #: ../data/functions.xml.in.h:655 msgid "Find Linear Function" msgstr "Finn linjär funktion" #: ../data/functions.xml.in.h:656 msgid "r:linearfunction" msgstr "linjär_funktion" #: ../data/functions.xml.in.h:657 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:658 msgid "x1" msgstr "" #: ../data/functions.xml.in.h:659 msgid "y1" msgstr "" #: ../data/functions.xml.in.h:660 msgid "x2" msgstr "" #: ../data/functions.xml.in.h:661 msgid "y2" msgstr "" #: ../data/functions.xml.in.h:662 msgid "Calculus" msgstr "Calculus" #: ../data/functions.xml.in.h:663 msgid "Differentiate" msgstr "Derivera" #: ../data/functions.xml.in.h:664 msgid "r:diff" msgstr "" #: ../data/functions.xml.in.h:665 msgid "Order" msgstr "Ordning" #: ../data/functions.xml.in.h:666 msgid "Integrate" msgstr "Integrera" #: ../data/functions.xml.in.h:667 msgid "r:integrate" msgstr "integrera" #: ../data/functions.xml.in.h:668 msgid "Variable of integration" msgstr "Variabel för integration" #: ../data/functions.xml.in.h:669 msgid "Extreme Values" msgstr "Extremvärden" #: ../data/functions.xml.in.h:670 msgid "r:extremum" msgstr "" #: ../data/functions.xml.in.h:671 msgid "Geometry" msgstr "Geometri" #: ../data/functions.xml.in.h:672 msgid "Triangle" msgstr "Triangel" #: ../data/functions.xml.in.h:673 msgid "Hypotenuse" msgstr "Hypotenusa" #: ../data/functions.xml.in.h:674 msgid "r:hypot" msgstr "" #: ../data/functions.xml.in.h:675 msgid "Side A" msgstr "Sida A" #: ../data/functions.xml.in.h:676 msgid "Side B" msgstr "Sida B" #: ../data/functions.xml.in.h:677 msgid "Triangle Area" msgstr "Triangelarea" #: ../data/functions.xml.in.h:678 msgid "r:triangle" msgstr "triangel" #: ../data/functions.xml.in.h:679 msgid "Height" msgstr "Höjd" #: ../data/functions.xml.in.h:680 msgid "Triangle Perimeter" msgstr "Triangelomkrets" #: ../data/functions.xml.in.h:681 msgid "r:triangle_perimeter" msgstr "triangelomkrets" #: ../data/functions.xml.in.h:682 msgid "Circle" msgstr "Cirkel" #: ../data/functions.xml.in.h:683 msgid "Circle Area" msgstr "Cirkelarea" #: ../data/functions.xml.in.h:684 msgid "r:circle" msgstr "cirkel" #: ../data/functions.xml.in.h:685 msgid "Calculates the area of a circle using the radius" msgstr "Beräknar arean för en cirkel." #: ../data/functions.xml.in.h:686 msgid "Radius" msgstr "Radie" #: ../data/functions.xml.in.h:687 msgid "Circle Circumference" msgstr "Cirkelomkrets" #: ../data/functions.xml.in.h:688 msgid "r:circumference" msgstr "omkrets" #: ../data/functions.xml.in.h:689 msgid "Cylinder" msgstr "Cylinder" #: ../data/functions.xml.in.h:690 msgid "Cylinder Volume" msgstr "Cylindervolym" #: ../data/functions.xml.in.h:691 msgid "r:cylinder" msgstr "" #: ../data/functions.xml.in.h:692 msgid "Surface Area of Cylinder" msgstr "Ytarea för en cylinder" #: ../data/functions.xml.in.h:693 msgid "r:cylinder_sa" msgstr "cylinderyta" #: ../data/functions.xml.in.h:694 msgid "Cone" msgstr "Kon" #: ../data/functions.xml.in.h:695 msgid "Cone Volume" msgstr "Konvolym" #: ../data/functions.xml.in.h:696 msgid "r:cone" msgstr "kon" #: ../data/functions.xml.in.h:697 msgid "Surface Area of Cone" msgstr "Ytarea för en kon" #: ../data/functions.xml.in.h:698 msgid "r:cone_sa" msgstr "konyta" #: ../data/functions.xml.in.h:699 msgid "Sphere" msgstr "Sfär" #: ../data/functions.xml.in.h:700 msgid "Sphere Volume" msgstr "Sfärvolym" #: ../data/functions.xml.in.h:701 msgid "r:sphere" msgstr "sfär" #: ../data/functions.xml.in.h:702 msgid "Surface Area of Sphere" msgstr "Ytarea för en sfär" #: ../data/functions.xml.in.h:703 msgid "r:sphere_sa" msgstr "sfäryta" #: ../data/functions.xml.in.h:704 msgid "Square Area" msgstr "Kvadratarea" #: ../data/functions.xml.in.h:705 msgid "r:square" msgstr "kvadrat" #: ../data/functions.xml.in.h:706 msgid "Length of side" msgstr "Sidans längd" #: ../data/functions.xml.in.h:707 msgid "Square Perimeter" msgstr "Kvadratomkrets" #: ../data/functions.xml.in.h:708 msgid "r:square_perimeter" msgstr "kvadratomkrets" #: ../data/functions.xml.in.h:709 msgid "Cube" msgstr "Kub" #: ../data/functions.xml.in.h:710 msgid "Cube Volume" msgstr "Kubvolym" #: ../data/functions.xml.in.h:711 msgid "r:cube" msgstr "kub" #: ../data/functions.xml.in.h:712 msgid "Surface Area of Cube" msgstr "Ytarea för en kub" #: ../data/functions.xml.in.h:713 msgid "r:cube_sa" msgstr "kubyta" #: ../data/functions.xml.in.h:714 msgid "Rectangle" msgstr "Rektangel" #: ../data/functions.xml.in.h:715 msgid "Rectangle Area" msgstr "Rektangelarea" #: ../data/functions.xml.in.h:716 msgid "r:rect" msgstr "rektangel" #: ../data/functions.xml.in.h:717 msgid "Width" msgstr "Bredd" #: ../data/functions.xml.in.h:718 msgid "Rectangle Perimeter" msgstr "Rektangelomkrets" #: ../data/functions.xml.in.h:719 msgid "r:rect_perimeter" msgstr "rektangelomkrets" #: ../data/functions.xml.in.h:720 msgid "Prism" msgstr "Prism" #: ../data/functions.xml.in.h:721 msgid "Volume of Rectangular Prism" msgstr "Volym för en rektangulär prism" #: ../data/functions.xml.in.h:722 msgid "r:rectprism" msgstr "rektangelprism" #: ../data/functions.xml.in.h:723 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:724 msgid "Surface Area of Rectangular Prism" msgstr "Ytarea för en rektangulär prism" #: ../data/functions.xml.in.h:725 msgid "r:rectprism_sa" msgstr "rektangelprismyta" #: ../data/functions.xml.in.h:726 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:727 msgid "Volume of Triangular Prism" msgstr "Volym för en triangulär prism" #: ../data/functions.xml.in.h:728 msgid "r:triangleprism" msgstr "triangelprism" #: ../data/functions.xml.in.h:729 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:730 msgid "Pyramid" msgstr "Pyramid" #: ../data/functions.xml.in.h:731 msgid "Pyramid Volume" msgstr "Pyramidvolym" #: ../data/functions.xml.in.h:732 msgid "r:pyramid" msgstr "" #: ../data/functions.xml.in.h:733 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:734 msgid "Length of base" msgstr "Basens längd" #: ../data/functions.xml.in.h:735 msgid "Width of base" msgstr "Basens bredd" #: ../data/functions.xml.in.h:736 msgid "Volume of Regular Tetrahedron" msgstr "Volym för en liksidig tetrahedron" #: ../data/functions.xml.in.h:737 msgid "r:tetrahedron" msgstr "" #: ../data/functions.xml.in.h:738 msgid "Surface Area of Regular Tetrahedron" msgstr "Ytarea för en liksidig tetrahedron" #: ../data/functions.xml.in.h:739 msgid "r:tetrahedron_sa" msgstr "tetrahedronyta" #: ../data/functions.xml.in.h:740 msgid "Height of Regular Tetrahedron" msgstr "Höjden på en liksidig tetrahedron" #: ../data/functions.xml.in.h:741 msgid "r:tetrahedron_height" msgstr "tetrahedronhöjd" #: ../data/functions.xml.in.h:742 msgid "Volume of Square Pyramid" msgstr "Volym för en kvadratisk pyramid" #: ../data/functions.xml.in.h:743 msgid "r:sqpyramid" msgstr "kvpyramid" #: ../data/functions.xml.in.h:744 msgid "Surface Area of Square Pyramid" msgstr "Ytarea för en kvadratisk pyramid" #: ../data/functions.xml.in.h:745 msgid "r:sqpyramid_sa" msgstr "kvpyramidyta" #: ../data/functions.xml.in.h:746 msgid "Height of Square Pyramid" msgstr "Höjden på en kvadratisk pyramid" #: ../data/functions.xml.in.h:747 msgid "r:sqpyramid_height" msgstr "kvpyramidhöjd" #: ../data/functions.xml.in.h:748 msgid "Parallelogram" msgstr "Parallelogram" #: ../data/functions.xml.in.h:749 msgid "Parallelogram Area" msgstr "Parallelogramarea" #: ../data/functions.xml.in.h:750 msgid "r:parallelogram" msgstr "parallellogram" #: ../data/functions.xml.in.h:751 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:752 msgid "Parallelogram Perimeter" msgstr "Parallelogramomkrets" #: ../data/functions.xml.in.h:753 msgid "r:parallelogram_perimeter" msgstr "parallellogramomkrets" #: ../data/functions.xml.in.h:754 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:755 msgid "Trapezoid" msgstr "Trapetsoid" #: ../data/functions.xml.in.h:756 msgid "Trapezoid Area" msgstr "Trapetsoidarea" #: ../data/functions.xml.in.h:757 msgid "r:trapezoid" msgstr "trapetsoid" #: ../data/functions.xml.in.h:758 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:759 msgid "Economics" msgstr "Ekonomi" #: ../data/functions.xml.in.h:760 msgid "Microeconomics" msgstr "Mikroekonomi" #: ../data/functions.xml.in.h:761 msgid "Elasticity" msgstr "Elasticitet" #: ../data/functions.xml.in.h:762 msgid "r:elasticity" msgstr "elasticitet" #: ../data/functions.xml.in.h:763 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:764 msgid "Demand function" msgstr "Efterfrågefunktion" #: ../data/functions.xml.in.h:765 msgid "Price" msgstr "Pris" #: ../data/functions.xml.in.h:766 msgid "Price variable" msgstr "Prisvariabel" #: ../data/functions.xml.in.h:767 msgid "Consumer Surplus" msgstr "Konsumentöverskott" #: ../data/functions.xml.in.h:768 msgid "r:csurplus" msgstr "konsumentöverskott" #: ../data/functions.xml.in.h:769 msgid "Supply function or price" msgstr "Tillgångsfunktion eller pris" #: ../data/functions.xml.in.h:770 msgid "Quantity variabel" msgstr "Kvantitetsvariabel" #: ../data/functions.xml.in.h:771 msgid "Producer Surplus" msgstr "Producentöverskott" #: ../data/functions.xml.in.h:772 msgid "r:psurplus" msgstr "producentöverskott" #: ../data/functions.xml.in.h:773 msgid "Supply function" msgstr "Tillgångsfunktion" #: ../data/functions.xml.in.h:774 msgid "Demand function or price" msgstr "Efterfrågefunktion eller pris" #: ../data/functions.xml.in.h:775 msgid "Finance" msgstr "Finans" #: ../data/functions.xml.in.h:776 msgid "Sum-of-Years Digits Depreciation" msgstr "Årlig avskrivningssumma" #: ../data/functions.xml.in.h:777 msgid "r:syd" msgstr "" #: ../data/functions.xml.in.h:778 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:779 msgid "Cost" msgstr "Kostnad" #: ../data/functions.xml.in.h:780 msgid "Salvage value" msgstr "Slutvärde" #: ../data/functions.xml.in.h:781 msgid "Life" msgstr "Livslängd" #: ../data/functions.xml.in.h:782 msgid "Period" msgstr "Period" #: ../data/functions.xml.in.h:783 msgid "Straight Line Depreciation" msgstr "Linjär avskrivning" #: ../data/functions.xml.in.h:784 msgid "r:sln" msgstr "" #: ../data/functions.xml.in.h:785 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:786 msgid "Present Value" msgstr "Nuvärde" #: ../data/functions.xml.in.h:787 msgid "r:pv" msgstr "" #: ../data/functions.xml.in.h:788 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:789 msgid "Interest rate" msgstr "Räntesats" #: ../data/functions.xml.in.h:790 msgid "Number of periods" msgstr "Antal perioder" #: ../data/functions.xml.in.h:791 msgid "Payment made each period" msgstr "Periodisk avbetalning " #: ../data/functions.xml.in.h:792 msgid "Future value" msgstr "Framtida värde" #: ../data/functions.xml.in.h:793 msgid "Type" msgstr "Typ" #: ../data/functions.xml.in.h:794 msgid "Nominal Interest Rate" msgstr "Nominell räntesats" #: ../data/functions.xml.in.h:795 msgid "r:nominal" msgstr "" #: ../data/functions.xml.in.h:796 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:797 msgid "Effective interest rate" msgstr "Effektiv räntesats" #: ../data/functions.xml.in.h:798 msgid "Periods" msgstr "Antal perioder" #: ../data/functions.xml.in.h:799 msgid "Zero Coupon" msgstr "Nollkupong" #: ../data/functions.xml.in.h:800 msgid "r:zero_coupon" msgstr "" #: ../data/functions.xml.in.h:801 msgid "Calculates the value of a zero-coupon (pure discount) bond." msgstr "" #: ../data/functions.xml.in.h:802 msgid "Face value" msgstr "Nominellt värde" #: ../data/functions.xml.in.h:803 msgid "Treasury Bill Yield" msgstr "Avkastningen för statsskuldväxel" #: ../data/functions.xml.in.h:804 msgid "r:tbillyield" msgstr "" #: ../data/functions.xml.in.h:805 msgid "Returns the yield for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:806 msgid "Settlement date" msgstr "Avräkningsdatum" #: ../data/functions.xml.in.h:807 msgid "Maturity date" msgstr "Mognadsdatum" #: ../data/functions.xml.in.h:808 msgid "Price per $100 face value" msgstr "Pris per 100 kr nominellt värde" #: ../data/functions.xml.in.h:809 msgid "Treasury Bill Price" msgstr "Värde för statsskuldväxel" #: ../data/functions.xml.in.h:810 msgid "r:tbillprice" msgstr "" #: ../data/functions.xml.in.h:811 msgid "Returns the price per $100 value for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:812 msgid "Discount rate" msgstr "Diskonto" #: ../data/functions.xml.in.h:813 msgid "Treasury Bill Equivalent" msgstr "Statsskultväxelavkastning motsvarande obligation" #: ../data/functions.xml.in.h:814 msgid "r:tbilleq" msgstr "" #: ../data/functions.xml.in.h:815 msgid "Returns the bond equivalent for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:816 msgid "Interest paid on a given period of an investment (ISPMT)" msgstr "Ränta betalad under specifik betalningsperiod (ISPMT)" #: ../data/functions.xml.in.h:817 msgid "r:ispmt" msgstr "" #: ../data/functions.xml.in.h:818 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:819 msgid "Periodic interest rate" msgstr "Periodisk räntesats" #: ../data/functions.xml.in.h:820 msgid "Amortizement period" msgstr "Amorteringsperiod" #: ../data/functions.xml.in.h:821 msgid "Present value" msgstr "Nuvärde" #: ../data/functions.xml.in.h:822 msgid "Payment for a loan" msgstr "Betalning för ett lån" #: ../data/functions.xml.in.h:823 msgid "r:pmt" msgstr "" #: ../data/functions.xml.in.h:824 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. Note that the " "interest rate here refers to the rate for each period and if you calculate " "with an annual rate, each period will be interpreted as a whole year (to get " "monthly payments, divide the result by 12)." msgstr "" #: ../data/functions.xml.in.h:825 msgid "Rate" msgstr "Räntesats" #: ../data/functions.xml.in.h:826 msgid "Periods of an investment" msgstr "Perioder för en investering" #: ../data/functions.xml.in.h:827 msgid "r:nper" msgstr "" #: ../data/functions.xml.in.h:828 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:829 msgid "Duration" msgstr "Duration" #: ../data/functions.xml.in.h:830 msgid "r:duration" msgstr "" #: ../data/functions.xml.in.h:831 msgid "Calculates the duration of a security." msgstr "Beräknar livslängden på en säkerhet." #: ../data/functions.xml.in.h:833 #, no-c-format msgid "Annual coupon rate (%)" msgstr "Årlig kupongränta (%)" #: ../data/functions.xml.in.h:835 #, no-c-format msgid "Annualized yield (%)" msgstr "Årlig avkastning (%)" #. Reccurance #: ../data/functions.xml.in.h:837 msgid "Frequency" msgstr "Frekvens" #: ../data/functions.xml.in.h:838 msgid "Periods for investment to attain desired value" msgstr "Perioder för investering att uppnå önskat värde" #: ../data/functions.xml.in.h:839 msgid "r:g_duration" msgstr "" #: ../data/functions.xml.in.h:840 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:841 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:842 msgid "r:ppmt" msgstr "" #: ../data/functions.xml.in.h:843 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:844 msgid "Desired future value" msgstr "Önskat framtida värde" #: ../data/functions.xml.in.h:845 msgid "Effective Interest Rate" msgstr "Effektiv räntesats" #: ../data/functions.xml.in.h:846 msgid "r:effect" msgstr "" #: ../data/functions.xml.in.h:847 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:848 msgid "Nominal interest rate" msgstr "Nominell räntesats" #: ../data/functions.xml.in.h:849 msgid "Future Value" msgstr "Framtida värde" #: ../data/functions.xml.in.h:850 msgid "r:fv" msgstr "" #: ../data/functions.xml.in.h:851 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:852 msgid "Return on continuously compounded interest" msgstr "Avkastning på fortlöpande sammansatt ränta" #: ../data/functions.xml.in.h:853 msgid "r:continuous" msgstr "" #: ../data/functions.xml.in.h:854 msgid "" "Calculates the return on continuously compounded interest, given the " "principal, nominal rate and time in years." msgstr "" #: ../data/functions.xml.in.h:855 msgid "Principal" msgstr "" #: ../data/functions.xml.in.h:856 msgid "Compound" msgstr "Sammansatt" #: ../data/functions.xml.in.h:857 msgid "r:compound" msgstr "" #: ../data/functions.xml.in.h:858 msgid "" "Returns the value of an investment, given the principal, nominal interest " "rate, compounding frequency and time." msgstr "" #: ../data/functions.xml.in.h:859 msgid "Periods per year" msgstr "Perioder per år" #: ../data/functions.xml.in.h:860 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:861 msgid "r:ipmt" msgstr "" #: ../data/functions.xml.in.h:862 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:863 msgid "Interest rate for a fully invested security" msgstr "Räntesats för betalt värdepapper" #: ../data/functions.xml.in.h:864 msgid "r:intrate" msgstr "" #: ../data/functions.xml.in.h:865 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:866 msgid "Investment" msgstr "Investering" #: ../data/functions.xml.in.h:867 msgid "Redemption" msgstr "Utlösande summa" #: ../data/functions.xml.in.h:868 msgid "Dollar Fraction" msgstr "Kronor till bråktal" #: ../data/functions.xml.in.h:869 msgid "r:dollarfr" msgstr "" #: ../data/functions.xml.in.h:870 msgid "" "Converts a decimal dollar price into a dollar price expressed as a fraction." msgstr "" #: ../data/functions.xml.in.h:871 msgid "Decimal dollar" msgstr "Bråktal till kronor" #: ../data/functions.xml.in.h:872 msgid "Denominator of fraction" msgstr "Bråktalets nämnare " #: ../data/functions.xml.in.h:873 msgid "Dollar Decimal" msgstr "Decimaltal" #: ../data/functions.xml.in.h:874 msgid "r:dollarde" msgstr "" #: ../data/functions.xml.in.h:875 msgid "" "Converts a dollar price expressed as a fraction into a dollar price " "expressed as a decimal number." msgstr "" #: ../data/functions.xml.in.h:876 msgid "Fractional dollar" msgstr "Bråktal" #: ../data/functions.xml.in.h:877 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:878 msgid "r:received" msgstr "" #: ../data/functions.xml.in.h:879 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:880 msgid "Discount rate for a security" msgstr "Reduceringshastighet för säkerhet" #: ../data/functions.xml.in.h:881 msgid "r:disc" msgstr "" #: ../data/functions.xml.in.h:882 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:883 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:884 msgid "r:accrintm" msgstr "" #: ../data/functions.xml.in.h:885 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:886 msgid "Issue date" msgstr "Startdatum" #: ../data/functions.xml.in.h:887 msgid "Annual rate of security" msgstr "Årlig hastighet" #: ../data/functions.xml.in.h:888 msgid "Par value" msgstr "Nominellt värde" #: ../data/functions.xml.in.h:889 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:890 msgid "r:accrint" msgstr "" #: ../data/functions.xml.in.h:891 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:892 msgid "First interest" msgstr "Första ränteinbetalning" #: ../data/functions.xml.in.h:893 msgid "Number of coupons to be paid" msgstr "Antal förfallande kuponger" #: ../data/functions.xml.in.h:894 msgid "r:coupnum" msgstr "" #: ../data/functions.xml.in.h:895 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:896 msgid "Price per $100 face value of a discounted security" msgstr "Pris per 100 kr nominellt värde för diskonterat värdepapper" #: ../data/functions.xml.in.h:897 msgid "r:pricedisc" msgstr "" #: ../data/functions.xml.in.h:898 msgid "" "Calculates and returns the price per $100 face value of a discounted " "security. 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 kr värde av en diskonterad 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:899 msgid "Discount" msgstr "Diskonto" #: ../data/functions.xml.in.h:900 msgid "Price per $100 face value of a security" msgstr "Pris per 100 kr nominellt värde för säkerhet" #: ../data/functions.xml.in.h:901 msgid "r:pricemat" msgstr "" #: ../data/functions.xml.in.h:902 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:903 msgid "Annual yield" msgstr "Årlig avkastning" #: ../data/functions.xml.in.h:904 msgid "Level-Coupon Bond" msgstr "Jämn kupongobligation" #: ../data/functions.xml.in.h:905 msgid "r:level_coupon" msgstr "" #: ../data/functions.xml.in.h:906 msgid "Calculates the value of a level-coupon bond." msgstr "" #: ../data/functions.xml.in.h:907 msgid "Coupon rate" msgstr "Kupongränta" #: ../data/functions.xml.in.h:908 msgid "Coupons per year" msgstr "Antal kuponger per år" #: ../data/functions.xml.in.h:909 msgid "Market interest rate" msgstr "Marknadsränta" #: ../data/planets.xml.in.h:1 msgid "Earth" msgstr "Jorden" #: ../data/planets.xml.in.h:2 msgid "Mars" msgstr "" #. Planet #: ../data/planets.xml.in.h:4 msgid "!planets!Mercury" msgstr "Merkurius" #: ../data/planets.xml.in.h:5 msgid "Venus" msgstr "" #: ../data/planets.xml.in.h:6 msgid "Jupiter" msgstr "" #: ../data/planets.xml.in.h:7 msgid "Saturn" msgstr "Saturnus" #: ../data/planets.xml.in.h:8 msgid "Neptune" msgstr "Neptunus" #: ../data/planets.xml.in.h:9 msgid "Pluto" msgstr "" #: ../data/planets.xml.in.h:10 msgid "Uranus" msgstr "" #. Unit category #: ../data/units.xml.in.h:2 msgid "!units!Length" msgstr "Längd" #: ../data/units.xml.in.h:3 msgid "Meter" msgstr "" #: ../data/units.xml.in.h:4 msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "a:m,meter" #: ../data/units.xml.in.h:5 msgid "Kilometer" msgstr "" #: ../data/units.xml.in.h:6 msgid "Decimeter" msgstr "" #: ../data/units.xml.in.h:7 msgid "Centimeter" msgstr "Centimeter" #: ../data/units.xml.in.h:8 msgid "Millimeter" msgstr "" #: ../data/units.xml.in.h:9 msgid "Nautical Mile" msgstr "Sjömil" #: ../data/units.xml.in.h:10 msgid "r:nautical_mile,p:nautical_miles" msgstr "sjömil" #: ../data/units.xml.in.h:11 msgid "Ångström" msgstr "Ångström" #: ../data/units.xml.in.h:12 msgid "aru:Å,u:ångström,angstrom" msgstr "" #: ../data/units.xml.in.h:13 msgid "U.S. Survey Inch" msgstr "" #: ../data/units.xml.in.h:14 msgid "ar:US_in,US_inch,p:US_inches" msgstr "" #: ../data/units.xml.in.h:15 msgid "Inch" msgstr "Tum" #: ../data/units.xml.in.h:16 msgid "ar:in,inch,p:inches" msgstr "tum,a:in,inch" #: ../data/units.xml.in.h:17 msgid "Hand" msgstr "" #: ../data/units.xml.in.h:18 msgid "r:hand,p:hands" msgstr "" #: ../data/units.xml.in.h:19 msgid "Foot" msgstr "Engelsk Fot" #: ../data/units.xml.in.h:20 msgid "ar:ft,foot,p:feet" msgstr "" #: ../data/units.xml.in.h:21 msgid "U.S. Survey Foot" msgstr "" #: ../data/units.xml.in.h:22 msgid "ar:US_ft,US_foot,p:US_feet" msgstr "" #: ../data/units.xml.in.h:23 msgid "Link" msgstr "Länk" #: ../data/units.xml.in.h:24 msgid "ar:li,link,p:links" msgstr "" #: ../data/units.xml.in.h:25 msgid "Yard" msgstr "" #: ../data/units.xml.in.h:26 msgid "ar:yd,yard,p:yards" msgstr "" #: ../data/units.xml.in.h:27 msgid "Rod (pole/perch)" msgstr "" #: ../data/units.xml.in.h:28 msgid "ar:rd,rod,p:rods" msgstr "" #: ../data/units.xml.in.h:29 msgid "Fathom" msgstr "Famn" #: ../data/units.xml.in.h:30 msgid "r:fathom,p:fathoms" msgstr "" #: ../data/units.xml.in.h:31 msgid "Chain" msgstr "" #: ../data/units.xml.in.h:32 msgid "ar:ch,chain,p:chains" msgstr "" #: ../data/units.xml.in.h:33 msgid "Furlong" msgstr "" #: ../data/units.xml.in.h:34 msgid "ar:fur,furlong,p:furlongs" msgstr "" #: ../data/units.xml.in.h:35 msgid "Mile" msgstr "" #: ../data/units.xml.in.h:36 msgid "ar:mi,mile,p:miles" msgstr "" #: ../data/units.xml.in.h:37 msgid "U.S. Survey Mile" msgstr "" #: ../data/units.xml.in.h:38 msgid "ar:US_mi,US_mile,p:US_miles" msgstr "" #: ../data/units.xml.in.h:39 msgid "Mil (1/1000 in)" msgstr "" #: ../data/units.xml.in.h:40 msgid "r:mil,p:mils" msgstr "" #: ../data/units.xml.in.h:41 msgid "Astronomical Unit" msgstr "Astronomisk enhet" #: ../data/units.xml.in.h:42 msgid "ar:AU,astronomical_unit,p:astronomical_units" msgstr "a:AU,astronomisk_enhet,p:astronomiska_enheter" #: ../data/units.xml.in.h:43 msgid "Light Year" msgstr "Ljusår" #: ../data/units.xml.in.h:44 msgid "ar:ly,lightyear,p:lightyears" msgstr "a:ly,ljusår" #: ../data/units.xml.in.h:45 msgid "Parsec" msgstr "" #: ../data/units.xml.in.h:46 msgid "ar:pc,parsec,p:parsecs" msgstr "a:pc,parsek,p:parseks" #: ../data/units.xml.in.h:47 msgid "Pied du roi (French Royal Foot)" msgstr "" #: ../data/units.xml.in.h:48 msgid "r:pied_du_roi" msgstr "" #: ../data/units.xml.in.h:49 msgid "Pouce (French Royal Inch)" msgstr "" #: ../data/units.xml.in.h:50 msgid "r:pouce" msgstr "" #: ../data/units.xml.in.h:51 msgid "Ligne" msgstr "" #: ../data/units.xml.in.h:52 msgid "r:ligne" msgstr "" #: ../data/units.xml.in.h:53 msgid "Toise" msgstr "" #: ../data/units.xml.in.h:54 msgid "r:toise" msgstr "" #. Unit category #: ../data/units.xml.in.h:56 msgid "!units!Angle" msgstr "Vinkel" #: ../data/units.xml.in.h:57 msgid "Plane Angle" msgstr "Planvinkel" #: ../data/units.xml.in.h:58 msgid "Meter per Meter" msgstr "Meter per meter" #: ../data/units.xml.in.h:59 msgid "Radian" msgstr "Radian" #: ../data/units.xml.in.h:60 msgid "ar:rad,radian,p:radians" msgstr "" #: ../data/units.xml.in.h:61 msgid "Degree" msgstr "Grad" #: ../data/units.xml.in.h:62 msgid "ar:deg,au:°,degree,p:degrees" msgstr "a:deg,au:°,grad,p:grader" #: ../data/units.xml.in.h:63 msgid "Gradian (Gon)" msgstr "Gradient (Gon)" #: ../data/units.xml.in.h:64 msgid "ar:gra,gradian,p:gradians,gon,p:gons" msgstr "" #: ../data/units.xml.in.h:65 msgid "Arcminute" msgstr "" #: ../data/units.xml.in.h:66 msgid "r:arcminute,p:arcminutes" msgstr "" #: ../data/units.xml.in.h:67 msgid "Arcsecond" msgstr "" #: ../data/units.xml.in.h:68 msgid "r:arcsecond,p:arcseconds" msgstr "" #: ../data/units.xml.in.h:69 msgid "Turn" msgstr "" #: ../data/units.xml.in.h:70 msgid "r:turn,p:turns" msgstr "" #: ../data/units.xml.in.h:71 msgid "Solid Angle" msgstr "Rymdvinkel" #: ../data/units.xml.in.h:72 msgid "Square Meter per Square Meter" msgstr "Kvadratmeter per kvadratmeter" #: ../data/units.xml.in.h:73 msgid "Steradian" msgstr "Steradian" #: ../data/units.xml.in.h:74 msgid "ar:sr,steradian,p:steradians" msgstr "" #: ../data/units.xml.in.h:75 msgid "Angular Acceleration" msgstr "Vinkelacceleration" #: ../data/units.xml.in.h:76 msgid "Radians per Second Squared" msgstr "Radianter per kvadratsekund" #: ../data/units.xml.in.h:77 msgid "Angular Velocity" msgstr "Vinkelhastighet" #: ../data/units.xml.in.h:78 msgid "Radians per Second" msgstr "Radianter per sekund" #. Unit category #: ../data/units.xml.in.h:80 msgid "!units!Mass" msgstr "Massa" #: ../data/units.xml.in.h:81 msgid "Gram" msgstr "" #: ../data/units.xml.in.h:82 msgid "ar:g,gram,p:grams" msgstr "a:g,gram" #: ../data/units.xml.in.h:83 msgid "Kilogram" msgstr "" #: ../data/units.xml.in.h:84 msgid "Hectogram" msgstr "Hektogram" #: ../data/units.xml.in.h:85 msgid "Metric Ton (Tonne)" msgstr "Ton" #: ../data/units.xml.in.h:86 msgid "ar:t,tonne,p:tonnes,ton,p:tons" msgstr "a:t,ton" #: ../data/units.xml.in.h:87 msgid "Grain" msgstr "" #: ../data/units.xml.in.h:88 msgid "ar:gr,grain,p:grains" msgstr "" #: ../data/units.xml.in.h:89 msgid "Pennyweight" msgstr "" #: ../data/units.xml.in.h:90 msgid "ar:pwt,pennyweight,p:pennyweights" msgstr "" #: ../data/units.xml.in.h:91 msgid "Ounce (troy)" msgstr "" #: ../data/units.xml.in.h:92 msgid "ar:oz_t,troy_ounce,p:troy_ounces" msgstr "" #: ../data/units.xml.in.h:93 msgid "Pound (troy)" msgstr "Pund (troy)" #: ../data/units.xml.in.h:94 msgid "ar:lb_t,troy_pound,p:troy_pounds" msgstr "" #: ../data/units.xml.in.h:95 msgid "Dram" msgstr "" #: ../data/units.xml.in.h:96 msgid "ar:dr,dram,p:drams" msgstr "" #: ../data/units.xml.in.h:97 msgid "Ounce" msgstr "" #: ../data/units.xml.in.h:98 msgid "ar:oz,ounce,p:ounces" msgstr "" #: ../data/units.xml.in.h:99 msgid "Pound" msgstr "Pund" #: ../data/units.xml.in.h:100 msgid "ar:lb,pound,p:pounds" msgstr "" #: ../data/units.xml.in.h:101 msgid "Short Hundredweight" msgstr "" #: ../data/units.xml.in.h:102 msgid "ar:cwt,hundredweight,p:hundredweights" msgstr "" #: ../data/units.xml.in.h:103 msgid "Long Hundredweight" msgstr "" #: ../data/units.xml.in.h:104 msgid "ar:l_cwt,long_hundredweight,p:long_hundredweights" msgstr "" #: ../data/units.xml.in.h:105 msgid "Short Ton" msgstr "" #: ../data/units.xml.in.h:106 msgid "ar:s_ton,short_ton,p:short_tons" msgstr "" #: ../data/units.xml.in.h:107 msgid "Long Ton" msgstr "" #: ../data/units.xml.in.h:108 msgid "ar:l_ton,long_ton,p:long_tons" msgstr "" #: ../data/units.xml.in.h:109 msgid "Stone" msgstr "" #: ../data/units.xml.in.h:110 msgid "r:stone,p:stones" msgstr "" #: ../data/units.xml.in.h:111 msgid "Cental" msgstr "" #: ../data/units.xml.in.h:112 msgid "r:cental,p:centals" msgstr "" #: ../data/units.xml.in.h:113 msgid "Carat" msgstr "Karat" #: ../data/units.xml.in.h:114 msgid "r:carat,p:carats" msgstr "karat" #: ../data/units.xml.in.h:115 msgid "Pfund" msgstr "" #: ../data/units.xml.in.h:116 msgid "r:pfund" msgstr "" #: ../data/units.xml.in.h:117 msgid "Zentner" msgstr "" #: ../data/units.xml.in.h:118 msgid "r:zentner" msgstr "" #: ../data/units.xml.in.h:120 msgid "Kilogram per Cubic Meter" msgstr "Kilogram per kubikmeter" #: ../data/units.xml.in.h:121 msgid "Gram per Cubic Decimeter" msgstr "Gram per kubikdecimeter" #: ../data/units.xml.in.h:122 msgid "Gram per Cubic Centimeter" msgstr "Gram per kubikcentimeter" #: ../data/units.xml.in.h:123 msgid "Atomic Mass" msgstr "Atommassa" #: ../data/units.xml.in.h:124 msgid "Gram per Mole" msgstr "Gram per mol" #: ../data/units.xml.in.h:125 msgid "Atomic Mass Unit" msgstr "Atommassenhet" #: ../data/units.xml.in.h:126 msgid "ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units" msgstr "a:u,a:AMU,atommassenhet,p:atommassenheter" #: ../data/units.xml.in.h:127 msgid "Dalton" msgstr "" #: ../data/units.xml.in.h:128 msgid "ar:Da,dalton,p:daltons" msgstr "" #: ../data/units.xml.in.h:129 msgid "Kilodalton" msgstr "Kilodalton" #: ../data/units.xml.in.h:130 msgid "Mass Fraction" msgstr "Massbråk" #: ../data/units.xml.in.h:131 msgid "Kilogram per Kilogram" msgstr "Kilogram per kilogram" #: ../data/units.xml.in.h:133 msgid "Second" msgstr "Sekund" #: ../data/units.xml.in.h:134 msgid "ar:s,second,p:seconds" msgstr "a:s,sekund,p:sekunder" #: ../data/units.xml.in.h:135 msgid "Minute" msgstr "Minut" #: ../data/units.xml.in.h:136 msgid "ar:min,minute,p:minutes" msgstr "a:min,minut,p:minuter" #: ../data/units.xml.in.h:137 msgid "Hour" msgstr "Timme" #: ../data/units.xml.in.h:138 msgid "ar:h,hour,p:hours" msgstr "a:h,timme,p:timmar" #: ../data/units.xml.in.h:139 msgid "Day" msgstr "Dag" #: ../data/units.xml.in.h:140 msgid "ar:d,day,p:days" msgstr "a:d,dag,p:dagar" #: ../data/units.xml.in.h:141 msgid "Week" msgstr "Vecka" #: ../data/units.xml.in.h:142 msgid "r:week,p:weeks" msgstr "vecka,p:veckor" #: ../data/units.xml.in.h:143 msgid "Fortnight" msgstr "" #: ../data/units.xml.in.h:144 msgid "r:fortnight,p:fortnights" msgstr "" #: ../data/units.xml.in.h:145 msgid "Julian Year" msgstr "Julianskt år" #: ../data/units.xml.in.h:146 msgid "r:year,p:years" msgstr "år" #. Unit category #: ../data/units.xml.in.h:148 msgid "!units!Frequency" msgstr "Frekvens" #: ../data/units.xml.in.h:149 msgid "Hertz" msgstr "" #: ../data/units.xml.in.h:150 msgid "ar:Hz,hertz" msgstr "" #: ../data/units.xml.in.h:151 msgid "Electricity" msgstr "Elektricitet" #: ../data/units.xml.in.h:152 msgid "Electric Current" msgstr "Elektrisk ström" #: ../data/units.xml.in.h:153 msgid "Ampere" msgstr "Ampere" #: ../data/units.xml.in.h:154 msgid "ar:A,ampere,p:amperes" msgstr "a:A,ampere" #: ../data/units.xml.in.h:155 msgid "Abampere" msgstr "Abampere" #: ../data/units.xml.in.h:156 msgid "r:abampere,a:abA,a:aA,p:abamperes" msgstr "" #: ../data/units.xml.in.h:157 msgid "Current Density" msgstr "Strömtäthet" #: ../data/units.xml.in.h:158 msgid "Ampere per Meter Squared" msgstr "Ampere per kvadratmeter" #: ../data/units.xml.in.h:159 msgid "Electric Charge" msgstr "Elektrisk laddning" #: ../data/units.xml.in.h:160 msgid "Second Ampere" msgstr "Sekundampere" #: ../data/units.xml.in.h:161 msgid "Coulomb" msgstr "Coulomb" #: ../data/units.xml.in.h:162 msgid "ar:C,coulomb,p:coulombs" msgstr "a:C,coulomb" #: ../data/units.xml.in.h:163 msgid "Abcoulomb" msgstr "Abcoulomb" #: ../data/units.xml.in.h:164 msgid "r:abcoulomb,p:abcoulombs,a:abC,a:aC" msgstr "" #: ../data/units.xml.in.h:165 msgid "Statcoloumb (Franklin)" msgstr "" #: ../data/units.xml.in.h:166 msgid "r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins" msgstr "" #: ../data/units.xml.in.h:167 msgid "Electric Charge Density" msgstr "Laddningstäthet" #: ../data/units.xml.in.h:168 msgid "Coulomb per Cubic Meter" msgstr "Coulomb per kubikmeter" #: ../data/units.xml.in.h:169 msgid "Electric Flux Density" msgstr "Elektrisk flödestäthet" #: ../data/units.xml.in.h:170 msgid "Coulomb per Meter Squared" msgstr "Coulomb per kvadratmeter" #: ../data/units.xml.in.h:171 msgid "Electric Potential" msgstr "Elektrisk potential" #: ../data/units.xml.in.h:172 msgid "Watt per Ampere" msgstr "Watt per ampere" #: ../data/units.xml.in.h:173 msgid "Volt" msgstr "" #: ../data/units.xml.in.h:174 msgid "ar:V,volt,p:volts" msgstr "a:V,volt" #: ../data/units.xml.in.h:175 msgid "Statvolt" msgstr "" #: ../data/units.xml.in.h:176 msgid "r:statvolt,p:statvolts,a:statV" msgstr "" #: ../data/units.xml.in.h:177 msgid "Abvolt" msgstr "Abvolt" #: ../data/units.xml.in.h:178 msgid "r:abvolt,p:abvolts,a:abV" msgstr "" #: ../data/units.xml.in.h:179 msgid "Capacitance" msgstr "Kapasitans" #: ../data/units.xml.in.h:180 msgid "Coulomb per Volt" msgstr "Coloumb per volt" #: ../data/units.xml.in.h:181 msgid "Farad" msgstr "" #: ../data/units.xml.in.h:182 msgid "ar:F,farad,p:farads" msgstr "a:F,farad" #: ../data/units.xml.in.h:183 msgid "Electric Resistance" msgstr "Resistans" #: ../data/units.xml.in.h:184 msgid "Volt per Ampere" msgstr "Volt per ampere" #: ../data/units.xml.in.h:185 msgid "Ohm" msgstr "" #: ../data/units.xml.in.h:186 msgid "au:Ω,r:ohm,p:ohms" msgstr "au:Ω,ohm" #: ../data/units.xml.in.h:187 msgid "Abohm" msgstr "Abohm" #: ../data/units.xml.in.h:188 msgid "r:abohm,p:abohms,au:abΩ" msgstr "" #: ../data/units.xml.in.h:189 msgid "Statohm" msgstr "" #: ../data/units.xml.in.h:190 msgid "r:statohm,p:statohms,au:statΩ" msgstr "" #: ../data/units.xml.in.h:191 msgid "Electric Conductance" msgstr "Induktion" #: ../data/units.xml.in.h:192 msgid "Ampere per Volt" msgstr "Ampere per volt" #: ../data/units.xml.in.h:193 msgid "Siemens" msgstr "" #: ../data/units.xml.in.h:194 msgid "ar:S,siemens" msgstr "" #: ../data/units.xml.in.h:195 msgid "Electric Field Strength" msgstr "Elektrisk fältstyrka" #: ../data/units.xml.in.h:196 msgid "Volt per Meter" msgstr "Volt per meter" #: ../data/units.xml.in.h:197 msgid "Permittivity" msgstr "Permitivitet" #: ../data/units.xml.in.h:198 msgid "Farad per Meter" msgstr "Farad per meter" #: ../data/units.xml.in.h:199 msgid "Inductance" msgstr "Induktans" #: ../data/units.xml.in.h:200 msgid "Weber per Ampere" msgstr "Weber per ampere" #: ../data/units.xml.in.h:201 msgid "Henry" msgstr "" #: ../data/units.xml.in.h:202 msgid "ar:H,henry,p:henrys" msgstr "a:H,henry" #: ../data/units.xml.in.h:203 msgid "Permeability" msgstr "Permeabilitet" #: ../data/units.xml.in.h:204 msgid "Henry per Meter" msgstr "Henry per meter" #: ../data/units.xml.in.h:205 msgid "Temperature" msgstr "Temperatur" #: ../data/units.xml.in.h:206 msgid "Kelvin" msgstr "" #: ../data/units.xml.in.h:207 msgid "ar:K,kelvin,p:kelvins" msgstr "a:K,kelvin" #: ../data/units.xml.in.h:208 msgid "Degree Celsius" msgstr "Grader Celsius" #: ../data/units.xml.in.h:209 msgid "" "ar:oC,au:°C,au:℃,r:celsius,p:celsius,centigrade,p:centigrades" msgstr "ar:oC,au:°C,au:℃,r:celsius" #: ../data/units.xml.in.h:210 msgid "Degree Rankine" msgstr "Grader Rankine" #: ../data/units.xml.in.h:211 msgid "ar:oR,au:°R,r:rankine" msgstr "" #: ../data/units.xml.in.h:212 msgid "Degree Fahrenheit" msgstr "Grader Fahrenheit" #: ../data/units.xml.in.h:213 msgid "ar:oF,au:°F,au:℉,r:fahrenheit" msgstr "" #: ../data/units.xml.in.h:214 msgid "Substance" msgstr "Substans" #: ../data/units.xml.in.h:215 msgid "Mole" msgstr "Mol" #: ../data/units.xml.in.h:216 msgid "ar:mol,mole,p:moles" msgstr "mol" #: ../data/units.xml.in.h:217 msgid "Einstein" msgstr "" #: ../data/units.xml.in.h:218 msgid "r:einstein,p:einsteins" msgstr "einstein" #: ../data/units.xml.in.h:219 msgid "Substance Concentration" msgstr "Substanskoncentration" #: ../data/units.xml.in.h:220 msgid "Mole per Cubic Meter" msgstr "Mol per kubikmeter" #: ../data/units.xml.in.h:221 msgid "Catalytic Activity" msgstr "Katalytisk aktivitet" #: ../data/units.xml.in.h:222 msgid "Reciprocal Seconds Mole" msgstr "Reciproka sekundmol" #: ../data/units.xml.in.h:223 msgid "Katal" msgstr "" #: ../data/units.xml.in.h:224 msgid "ar:kat,katal,p:katals" msgstr "a:kat,katal" #: ../data/units.xml.in.h:225 msgid "Catalytic Concentration" msgstr "Katalytisk koncentration" #: ../data/units.xml.in.h:226 msgid "Katal per Cubic Meter" msgstr "Katal per kubikmeter" #: ../data/units.xml.in.h:227 msgid "Light" msgstr "Ljus" #: ../data/units.xml.in.h:228 msgid "Luminous Intensity" msgstr "Luminansintensitet" #: ../data/units.xml.in.h:229 msgid "Candela" msgstr "Candela" #: ../data/units.xml.in.h:230 msgid "ar:cd,candela,p:candelas" msgstr "a:cd,candela" #: ../data/units.xml.in.h:231 msgid "Luminance" msgstr "Luminans" #: ../data/units.xml.in.h:232 msgid "Candela per Meter Squared" msgstr "Candela per kvadratmeter" #: ../data/units.xml.in.h:233 msgid "Stilb" msgstr "" #: ../data/units.xml.in.h:234 msgid "ar:sb,stilb,p:stilbs" msgstr "" #: ../data/units.xml.in.h:235 msgid "Luminous Flux" msgstr "Luminansflöde" #: ../data/units.xml.in.h:236 msgid "Candela Steradian" msgstr "Candelasteradian" #: ../data/units.xml.in.h:237 msgid "Lumen" msgstr "" #: ../data/units.xml.in.h:238 msgid "ar:lm,lumen,p:lumens" msgstr "a:lm,lumen" #: ../data/units.xml.in.h:239 msgid "Illuminance" msgstr "Illuminans" #: ../data/units.xml.in.h:240 msgid "Lumen per Meter Squared" msgstr "Lumen per kvadratmeter" #: ../data/units.xml.in.h:241 msgid "Lumen per Foot Squared" msgstr "Lumen per kvadratfor" #: ../data/units.xml.in.h:242 msgid "Lux" msgstr "" #: ../data/units.xml.in.h:243 msgid "ar:lx,lux" msgstr "" #: ../data/units.xml.in.h:244 msgid "Foot-Candle" msgstr "" #: ../data/units.xml.in.h:245 msgid "ar:fc,footcandle,p:footcandles" msgstr "" #: ../data/units.xml.in.h:246 msgid "Phot" msgstr "" #: ../data/units.xml.in.h:247 msgid "ar:ph,phot,p:phots" msgstr "" #: ../data/units.xml.in.h:248 msgid "Radiant Intensity" msgstr "Strålningsstyrka" #: ../data/units.xml.in.h:249 msgid "Watt per Steradian" msgstr "Watt per steradian" #: ../data/units.xml.in.h:250 msgid "Irradiance" msgstr "Irradians" #: ../data/units.xml.in.h:251 msgid "Watt per Meter Squared" msgstr "Watt per kvadratmeter" #: ../data/units.xml.in.h:252 msgid "Einstein per Meter Squared per Second" msgstr "Einsteins per kvadratmeter per sekund" #: ../data/units.xml.in.h:253 msgid "Microeinstein per Meter Squared per Second" msgstr "Kikroeinstein per kvadratmeter per sekund" #: ../data/units.xml.in.h:254 msgid "Radiance" msgstr "Radians" #: ../data/units.xml.in.h:255 msgid "Watt per Square Meter Steradian" msgstr "Watt per steradiankvadratmeter" #: ../data/units.xml.in.h:256 msgid "Area" msgstr "" #: ../data/units.xml.in.h:257 msgid "Square Meter" msgstr "Kvadratmeter" #: ../data/units.xml.in.h:258 msgid "Square Kilometer" msgstr "Kvadratkilometer" #: ../data/units.xml.in.h:259 msgid "Are" msgstr "" #: ../data/units.xml.in.h:260 msgid "ar:a,are,p:ares" msgstr "" #: ../data/units.xml.in.h:261 msgid "Hectare" msgstr "Hektar" #: ../data/units.xml.in.h:262 msgid "Barn" msgstr "" #: ../data/units.xml.in.h:263 msgid "ar:b,barn,p:barns" msgstr "" #: ../data/units.xml.in.h:264 msgid "Rood" msgstr "" #: ../data/units.xml.in.h:265 msgid "r:rood,p:roods" msgstr "" #: ../data/units.xml.in.h:266 msgid "Acre" msgstr "" #: ../data/units.xml.in.h:267 msgid "r:acre,p:acres" msgstr "" #: ../data/units.xml.in.h:268 msgid "Section" msgstr "" #: ../data/units.xml.in.h:269 msgid "r:section,p:sections" msgstr "" #: ../data/units.xml.in.h:270 msgid "Township" msgstr "" #: ../data/units.xml.in.h:271 msgid "r:township,p:townships" msgstr "" #: ../data/units.xml.in.h:272 msgid "Square Foot" msgstr "Kvadratfot" #: ../data/units.xml.in.h:273 msgid "Square Inch" msgstr "Kvadrattum" #: ../data/units.xml.in.h:274 msgid "Square Mile" msgstr "Kvadratmile" #: ../data/units.xml.in.h:275 msgid "Volume" msgstr "Volym" #: ../data/units.xml.in.h:276 msgid "Cubic Meter" msgstr "Kubikmeter" #: ../data/units.xml.in.h:277 msgid "Liter" msgstr "" #: ../data/units.xml.in.h:278 msgid "ar:L,a:l,liter,p:liters,litre,p:litres" msgstr "a:L,a:l,liter" #: ../data/units.xml.in.h:279 msgid "Milliliter" msgstr "" #: ../data/units.xml.in.h:280 msgid "Centiliter" msgstr "Centiliter" #: ../data/units.xml.in.h:281 msgid "Deciliter" msgstr "" #: ../data/units.xml.in.h:282 msgid "Cubic Inch" msgstr "Kubiktum" #: ../data/units.xml.in.h:283 msgid "Fuel Economy" msgstr "Bränsleförbrukning" #: ../data/units.xml.in.h:284 msgid "Liter per Kilometer" msgstr "Liter per kilometer" #: ../data/units.xml.in.h:285 msgid "Kilometer per Liter" msgstr "Kilometer per liter" #: ../data/units.xml.in.h:286 msgid "Miles per Gallon" msgstr "" #: ../data/units.xml.in.h:287 msgid "a-cr:mpg" msgstr "" #: ../data/units.xml.in.h:288 msgid "Cooking" msgstr "Matlagning" #: ../data/units.xml.in.h:289 msgid "Teaspoon" msgstr "Tesked" #: ../data/units.xml.in.h:290 msgid "r:teaspoon,p:teaspoons" msgstr "tesked,p:teskedar" #: ../data/units.xml.in.h:291 msgid "Dessertspoon" msgstr "Dessertsked" #: ../data/units.xml.in.h:292 msgid "r:dessertspoon,p:dessertspoons" msgstr "dessertsked,p:dessertskedar" #: ../data/units.xml.in.h:293 msgid "Tablespoon" msgstr "Matsked" #: ../data/units.xml.in.h:294 msgid "r:tablespoon,p:tablespoons" msgstr "matsked,p:matskedar" #: ../data/units.xml.in.h:295 msgid "Cup" msgstr "" #: ../data/units.xml.in.h:296 msgid "r:cup,p:cups" msgstr "kopp,p:koppar" #: ../data/units.xml.in.h:297 msgid "Imperial Capacity" msgstr "" #: ../data/units.xml.in.h:298 msgid "Imperial Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:299 msgid "ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces" msgstr "" #: ../data/units.xml.in.h:300 msgid "Imperial Gill" msgstr "" #: ../data/units.xml.in.h:301 msgid "ar:UK_gi,imperial_gill,p:imperial_gills" msgstr "" #: ../data/units.xml.in.h:302 msgid "Imperial Pint" msgstr "" #: ../data/units.xml.in.h:303 msgid "ar:UK_pt,imperial_pint,p:imperial_pints" msgstr "" #: ../data/units.xml.in.h:304 msgid "Imperial Quart" msgstr "" #: ../data/units.xml.in.h:305 msgid "ar:UK_qt,imperial_quart,p:imperial_quarts" msgstr "" #: ../data/units.xml.in.h:306 msgid "Imperial Gallon" msgstr "" #: ../data/units.xml.in.h:307 msgid "ar:UK_gal,imperial_gallon,p:imperial_gallons" msgstr "" #: ../data/units.xml.in.h:308 msgid "Imperial Minim" msgstr "" #: ../data/units.xml.in.h:309 msgid "r:imperial_minim,p:imperial_minims" msgstr "" #: ../data/units.xml.in.h:310 msgid "Imperial Fluid Scuple" msgstr "" #: ../data/units.xml.in.h:311 msgid "r:imperial_fluid_scuple,p:imperial_fluid_scuples" msgstr "" #: ../data/units.xml.in.h:312 msgid "Imperial Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:313 msgid "ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms" msgstr "" #: ../data/units.xml.in.h:314 msgid "Imperial Bushel" msgstr "" #: ../data/units.xml.in.h:315 msgid "ar:UK_bu,imperial_bushel,p:imperial_bushels" msgstr "" #: ../data/units.xml.in.h:316 msgid "U.S. Capacity" msgstr "" #: ../data/units.xml.in.h:317 msgid "U.S. Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:318 msgid "ar:fl_oz,fluid_ounce,p:fluid_ounces" msgstr "" #: ../data/units.xml.in.h:319 msgid "U.S. Gill" msgstr "" #: ../data/units.xml.in.h:320 msgid "ar:gi,gill,p:gills" msgstr "" #: ../data/units.xml.in.h:321 msgid "U.S. Liquid Pints" msgstr "" #: ../data/units.xml.in.h:322 msgid "ar:liq_pt,liquid_pint,p:liquid_pints" msgstr "" #: ../data/units.xml.in.h:323 msgid "U.S. Liquid Quarts" msgstr "" #: ../data/units.xml.in.h:324 msgid "ar:liq_qt,liquid_quart,p:liquid_quarts" msgstr "" #: ../data/units.xml.in.h:325 msgid "U.S. Minim" msgstr "" #: ../data/units.xml.in.h:326 msgid "r:minim,p:minims" msgstr "" #: ../data/units.xml.in.h:327 msgid "U.S. Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:328 msgid "ar:fl_dr,fluid_drachm,p:fluid_drachms" msgstr "" #: ../data/units.xml.in.h:329 msgid "U.S. Dry Pint" msgstr "" #: ../data/units.xml.in.h:330 msgid "ar:dry_pt,dry_pint,p:dry_pints" msgstr "" #: ../data/units.xml.in.h:331 msgid "U.S. Dry Quart" msgstr "" #: ../data/units.xml.in.h:332 msgid "ar:dry_qt,dry_quart,p:dry_quarts" msgstr "" #: ../data/units.xml.in.h:333 msgid "U.S. Peck" msgstr "" #: ../data/units.xml.in.h:334 msgid "ar:pk,peck,p:pecks" msgstr "" #: ../data/units.xml.in.h:335 msgid "U.S. Bushel" msgstr "" #: ../data/units.xml.in.h:336 msgid "ar:bu,bushel,p:bushels" msgstr "" #: ../data/units.xml.in.h:337 msgid "U.S. Gallon" msgstr "" #: ../data/units.xml.in.h:338 msgid "ar:gal,gallon,p:gallons" msgstr "" #: ../data/units.xml.in.h:339 msgid "U.S. Barrel (oil)" msgstr "" #: ../data/units.xml.in.h:340 msgid "ar:bbl,barrel,p:barrels" msgstr "" #: ../data/units.xml.in.h:341 msgid "Specific Volume" msgstr "Specifik volym" #: ../data/units.xml.in.h:342 msgid "Cubic Meter per Kilogram" msgstr "Kubikmeter per kilogram" #: ../data/units.xml.in.h:343 msgid "Speed" msgstr "Hastighet" #: ../data/units.xml.in.h:344 msgid "Meter per Second" msgstr "Meter per sekund" #: ../data/units.xml.in.h:345 msgid "Kilometer per Hour" msgstr "Kilometer per timme" #: ../data/units.xml.in.h:346 msgid "Nautical Mile per Hour" msgstr "Sjömil per timme" #: ../data/units.xml.in.h:347 msgid "Knot" msgstr "Knop" #: ../data/units.xml.in.h:348 msgid "r:knot,p:knots" msgstr "knop" #: ../data/units.xml.in.h:349 msgid "Miles per Hour" msgstr "Miles per Hour" #: ../data/units.xml.in.h:350 msgid "a-cr:mph" msgstr "" #: ../data/units.xml.in.h:351 msgid "Acceleration" msgstr "Acceleration" #: ../data/units.xml.in.h:352 msgid "Meter per Second Squared" msgstr "Meter per kvadratsekund" #: ../data/units.xml.in.h:353 msgid "Galileo" msgstr "" #: ../data/units.xml.in.h:354 msgid "ar:Gal,galileo,p:galileos" msgstr "a:Gal,galileo" #: ../data/units.xml.in.h:355 msgid "Gee" msgstr "" #: ../data/units.xml.in.h:356 msgid "r:gee,p:gees" msgstr "" #: ../data/units.xml.in.h:357 msgid "Magnetism" msgstr "Magnetism" #: ../data/units.xml.in.h:358 msgid "Wave Number" msgstr "Vågtal" #: ../data/units.xml.in.h:359 msgid "Reciprocal Meter" msgstr "Reciproka meter" #: ../data/units.xml.in.h:360 msgid "Magnetic Field Strength" msgstr "Magnetisk fältstyrka" #: ../data/units.xml.in.h:361 msgid "Ampere per Meter" msgstr "Ampere per meter" #: ../data/units.xml.in.h:362 msgid "Oersted" msgstr "" #: ../data/units.xml.in.h:363 msgid "ar:Oe,oersted,p:oersteds" msgstr "a:Oe,oersted" #: ../data/units.xml.in.h:364 msgid "Magnetic Flux" msgstr "Magnetiskt flöde" #: ../data/units.xml.in.h:365 msgid "Volt Seconds" msgstr "Voltsekund" #: ../data/units.xml.in.h:366 msgid "Weber" msgstr "" #: ../data/units.xml.in.h:367 msgid "ar:Wb,weber,p:webers" msgstr "a:Wb,weber" #: ../data/units.xml.in.h:368 msgid "Maxwell" msgstr "" #: ../data/units.xml.in.h:369 msgid "ar:Mx,maxwell,p:maxwells" msgstr "a:Mx,maxwell" #: ../data/units.xml.in.h:370 msgid "Magnetic Flux Density" msgstr "Magnetisk flödestäthet" #: ../data/units.xml.in.h:371 msgid "Weber per Meter Squared" msgstr "Weber per kvadratmeter" #: ../data/units.xml.in.h:372 msgid "Tesla" msgstr "" #: ../data/units.xml.in.h:373 msgid "ar:T,tesla,p:teslas" msgstr "a:T,tesla" #: ../data/units.xml.in.h:374 msgid "Gauss" msgstr "" #: ../data/units.xml.in.h:375 msgid "r:gauss" msgstr "" #: ../data/units.xml.in.h:376 msgid "Force" msgstr "Kraft" #: ../data/units.xml.in.h:377 msgid "Meter Kilogram per Second Squared" msgstr "Meterkilogram per kvadratsekund" #: ../data/units.xml.in.h:378 msgid "Newton" msgstr "" #: ../data/units.xml.in.h:379 msgid "ar:N,newton,p:newtons" msgstr "a:N,newton" #: ../data/units.xml.in.h:380 msgid "Dyne" msgstr "" #: ../data/units.xml.in.h:381 msgid "ar:dyn,dyne,p:dynes" msgstr "" #: ../data/units.xml.in.h:382 msgid "Pound-force" msgstr "" #: ../data/units.xml.in.h:383 msgid "ar:lbf,pound_force" msgstr "" #: ../data/units.xml.in.h:384 msgid "Pound Foot per Second Squared" msgstr "Pundfot per kvadratsekund" #: ../data/units.xml.in.h:385 msgid "Poundal" msgstr "" #: ../data/units.xml.in.h:386 msgid "r:poundal,p:poundals,a:pdl" msgstr "" #: ../data/units.xml.in.h:387 msgid "Pond (Gram-Force)" msgstr "" #: ../data/units.xml.in.h:388 msgid "r:pond,p:ponds,a:gf" msgstr "" #: ../data/units.xml.in.h:389 msgid "Kilopond (Kilogram-Force)" msgstr "" #: ../data/units.xml.in.h:390 msgid "Moment of Force" msgstr "Kraftmoment" #: ../data/units.xml.in.h:391 msgid "Newton Meter" msgstr "Newtonmeter" #: ../data/units.xml.in.h:392 msgid "Pressure" msgstr "Tryck" #: ../data/units.xml.in.h:393 msgid "Newton per Meter Squared" msgstr "Newton per kvadratmeter" #: ../data/units.xml.in.h:394 msgid "Pound-force per Square Inch" msgstr "Pound-force per kvadrattum" #: ../data/units.xml.in.h:395 msgid "Pascal" msgstr "" #: ../data/units.xml.in.h:396 msgid "ar:Pa,pascal,p:pascals" msgstr "a:Pa,pascal" #: ../data/units.xml.in.h:397 msgid "Pound-force per Square Inch (psi)" msgstr "Pound-force per kvadrattum (psi)" #: ../data/units.xml.in.h:398 msgid "a-cr:psi" msgstr "" #: ../data/units.xml.in.h:399 msgid "Bar" msgstr "Bar" #: ../data/units.xml.in.h:400 msgid "r:bar,p:bars" msgstr "" #: ../data/units.xml.in.h:401 msgid "Atmosphere" msgstr "Atmosfär" #: ../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 "Torr" msgstr "" #: ../data/units.xml.in.h:404 msgid "r:torr,p:torrs" msgstr "" #: ../data/units.xml.in.h:405 msgid "Millimeter of Mercury" msgstr "Millimeter kvicksilver" #: ../data/units.xml.in.h:406 msgid "ar:mmHg" msgstr "" #: ../data/units.xml.in.h:407 msgid "Inch of Mercury" msgstr "Fot kvicksilver" #: ../data/units.xml.in.h:408 msgid "ar:inHg" msgstr "" #: ../data/units.xml.in.h:409 msgid "Dynamic Viscosity" msgstr "Dynamisk viskositet" #: ../data/units.xml.in.h:410 msgid "Pascal Second" msgstr "Pascalsekund" #: ../data/units.xml.in.h:411 msgid "Poise" msgstr "" #: ../data/units.xml.in.h:412 msgid "ar:P,poise,p:poises" msgstr "a:P,poise" #: ../data/units.xml.in.h:413 msgid "Kinematic Viscosity" msgstr "Kinematisk viskositet" #: ../data/units.xml.in.h:414 msgid "Square Meter per Second" msgstr "Kvadratmeter per sekund" #: ../data/units.xml.in.h:415 msgid "Stokes" msgstr "" #: ../data/units.xml.in.h:416 msgid "ar:St,stokes" msgstr "" #: ../data/units.xml.in.h:417 msgid "Surface Tension" msgstr "Ytspänning" #: ../data/units.xml.in.h:418 msgid "Newton per Meter" msgstr "Newton per meter" #: ../data/units.xml.in.h:419 msgid "Energy" msgstr "Energi" #: ../data/units.xml.in.h:420 msgid "Joule" msgstr "" #: ../data/units.xml.in.h:421 msgid "ar:J,joule,p:joules" msgstr "a:J,joule" #: ../data/units.xml.in.h:422 msgid "Watt Hour" msgstr "Watttimme" #: ../data/units.xml.in.h:423 msgid "Kilowatt Hour" msgstr "Kilowatttimme" #: ../data/units.xml.in.h:424 msgid "Calorie (international table)" msgstr "Kalorier (international table)" #: ../data/units.xml.in.h:425 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:426 msgid "Calorie (capital C)" msgstr "Kalorier (med stort K)" #: ../data/units.xml.in.h:427 msgid "cr:Calorie,cp:Calories" msgstr "" #: ../data/units.xml.in.h:428 msgid "Calorie (thermochemical)" msgstr "Kalorier (termokemiska)" #: ../data/units.xml.in.h:429 msgid "ars:cal_th" msgstr "" #: ../data/units.xml.in.h:430 msgid "Gram of TNT" msgstr "Gram TNT" #: ../data/units.xml.in.h:431 msgid "a-cr:gTNT,gramTNT" msgstr "" #: ../data/units.xml.in.h:432 msgid "Ton of TNT" msgstr "Ton TNT" #: ../data/units.xml.in.h:433 msgid "a-cr:tTNT,tonTNT" msgstr "" #: ../data/units.xml.in.h:434 msgid "Calorie (15 degrees Celsius)" msgstr "Kalorier (15 grader Celsius)" #: ../data/units.xml.in.h:435 msgid "ars:cal_fifteen" msgstr "as:cal_femton" #: ../data/units.xml.in.h:436 msgid "Calorie (mean)" msgstr "Kalorier (medel)" #: ../data/units.xml.in.h:437 msgid "ars:cal_mean" msgstr "as:cal_medel" #: ../data/units.xml.in.h:438 msgid "British Thermal Unit (IT)" msgstr "" #: ../data/units.xml.in.h:439 msgid "ar:Btu" msgstr "" #: ../data/units.xml.in.h:440 msgid "Electron Volt" msgstr "Elektronvolt" #: ../data/units.xml.in.h:441 msgid "ar:eV,electron_volt,p:electron_volts" msgstr "a:eV,elektronvolt" #: ../data/units.xml.in.h:442 msgid "Erg" msgstr "" #: ../data/units.xml.in.h:443 msgid "r:erg,p:ergs" msgstr "" #: ../data/units.xml.in.h:444 msgid "Foe" msgstr "" #: ../data/units.xml.in.h:445 msgid "r:foe,p:foes" msgstr "" #: ../data/units.xml.in.h:446 msgid "Foot-Pound Force" msgstr "" #: ../data/units.xml.in.h:447 msgid "Hartree" msgstr "" #: ../data/units.xml.in.h:448 msgid "ar:Ha,as:E_h,hartree" msgstr "" #: ../data/units.xml.in.h:449 msgid "Rydberg" msgstr "Rydberg" #: ../data/units.xml.in.h:450 msgid "ar:Ry,s:rydberg_unit" msgstr "ar:Ry,s:rydberg_enhet" #: ../data/units.xml.in.h:451 msgid "Specific Energy" msgstr "Specifik energi" #: ../data/units.xml.in.h:452 msgid "Joule per Kilogram" msgstr "Joule per kilogram" #: ../data/units.xml.in.h:453 msgid "Power" msgstr "Effekt" #: ../data/units.xml.in.h:454 msgid "Joule per Second" msgstr "Joule per sekund" #: ../data/units.xml.in.h:455 msgid "Watt" msgstr "" #: ../data/units.xml.in.h:456 msgid "ar:W,watt,p:watts" msgstr "a:W,watt" #: ../data/units.xml.in.h:457 msgid "Horse Power" msgstr "Hästkraft" #: ../data/units.xml.in.h:458 msgid "ar:hp,horsepower,p:horsepowers" msgstr "a:hp,hästkraft,p:hästkrafter" #: ../data/units.xml.in.h:459 msgid "Pferdestärke" msgstr "" #: ../data/units.xml.in.h:460 msgid "ar:PS,u:pferdestärke" msgstr "" #: ../data/units.xml.in.h:461 msgid "Entropy" msgstr "Entropi" #: ../data/units.xml.in.h:462 msgid "Joule per Kelvin" msgstr "Joule per Kelvin" #: ../data/units.xml.in.h:463 msgid "Specific Entropy" msgstr "Specifik entropi" #: ../data/units.xml.in.h:464 msgid "Joule per Kilogram Kelvin" msgstr "Joule per kilogram kelvin" #: ../data/units.xml.in.h:465 msgid "Thermal Conductivity" msgstr "Termisk konduktivitet" #: ../data/units.xml.in.h:466 msgid "Watt per Meter Kelvin" msgstr "Watt per meter kelvin" #: ../data/units.xml.in.h:467 msgid "Energy Density" msgstr "Energitäthet" #: ../data/units.xml.in.h:468 msgid "Joule per Cubic Meter" msgstr "Joule per kubikmeter" #: ../data/units.xml.in.h:469 msgid "Molar Energy" msgstr "Molarenergi" #: ../data/units.xml.in.h:470 msgid "Joule per Mole" msgstr "Joule per mol" #: ../data/units.xml.in.h:471 msgid "Molar Entropy" msgstr "Molarentropi" #: ../data/units.xml.in.h:472 msgid "Joule per Mole Kelvin" msgstr "Joule per mol kelvin" #: ../data/units.xml.in.h:473 msgid "Radioactivity" msgstr "Radioaktivitet" #: ../data/units.xml.in.h:474 msgid "Becquerel" msgstr "Becquerel" #: ../data/units.xml.in.h:475 msgid "ar:Bq,becquerel,p:becquerels" msgstr "a:Bq,becquerel" #: ../data/units.xml.in.h:476 msgid "Curie" msgstr "" #: ../data/units.xml.in.h:477 msgid "ar:Ci,curie,p:curies" msgstr "a:Ci,curie" #: ../data/units.xml.in.h:478 msgid "Absorbed Dose" msgstr "Absorberad dos" #: ../data/units.xml.in.h:479 msgid "Gray" msgstr "" #: ../data/units.xml.in.h:480 msgid "ar:Gy,gray,p:grays" msgstr "a:Gy,gray" #: ../data/units.xml.in.h:481 msgid "Rad" msgstr "Rad" #: ../data/units.xml.in.h:482 msgid "r:rad_radioactivity" msgstr "rad_radioaktivitet" #: ../data/units.xml.in.h:483 msgid "Dose Equivalent" msgstr "Dosekvivalent" #: ../data/units.xml.in.h:484 msgid "Sievert" msgstr "" #: ../data/units.xml.in.h:485 msgid "ar:Sv,sievert,p:sieverts" msgstr "a:Sv,sievert" #: ../data/units.xml.in.h:486 msgid "Rem" msgstr "" #: ../data/units.xml.in.h:487 msgid "r:rem_radioactivity" msgstr "rem_radioaktivitet" #: ../data/units.xml.in.h:488 msgid "Exposure" msgstr "Exponering" #: ../data/units.xml.in.h:489 msgid "Coulomb per Kilogram" msgstr "Coloumb per kilogram" #: ../data/units.xml.in.h:490 msgid "Roentgen" msgstr "Röntgen" #: ../data/units.xml.in.h:491 msgid "ar:R,roentgen,p:roentgens" msgstr "a:R,roentgen" #: ../data/units.xml.in.h:492 msgid "Absorbed Dose Rate" msgstr "Absorberad dosrat" #: ../data/units.xml.in.h:493 msgid "Gray per Second" msgstr "Gray per sekund" #: ../data/units.xml.in.h:494 msgid "Ratio" msgstr "" #: ../data/units.xml.in.h:495 msgid "Neper" msgstr "" #: ../data/units.xml.in.h:496 msgid "ar:Np,neper,p:nepers" msgstr "a:Np,neper" #: ../data/units.xml.in.h:497 msgid "Bel" msgstr "" #: ../data/units.xml.in.h:498 msgid "ar:B,bel,p:bels" msgstr "a:B,bel" #: ../data/units.xml.in.h:499 msgid "Decibel" msgstr "" #: ../data/units.xml.in.h:500 msgid "Information" msgstr "" #: ../data/units.xml.in.h:501 msgid "Bit" msgstr "Bit" #: ../data/units.xml.in.h:502 msgid "r:bit,p:bits" msgstr "bit,p:bitar" #: ../data/units.xml.in.h:503 msgid "Byte (8-bit)" msgstr "Byte (8-bit)" #: ../data/units.xml.in.h:504 msgid "r:byte,p:bytes,octet,p:octets" msgstr "byte,oktet" #: ../data/units.xml.in.h:505 msgid "Nibble" 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 "Tribble" msgstr "" #: ../data/units.xml.in.h:508 msgid "r:tribble,p:tribbles" msgstr "" #: ../data/units.xml.in.h:509 msgid "Word (16-bit)" msgstr "" #: ../data/units.xml.in.h:510 msgid "r:word,p:words" msgstr "" #: ../data/units.xml.in.h:511 msgid "Kilobyte" msgstr "" #: ../data/units.xml.in.h:512 msgid "Kibibyte" msgstr "" #: ../data/units.xml.in.h:513 msgid "Mebibyte" msgstr "" #: ../data/units.xml.in.h:514 msgid "Gibibyte" msgstr "" #: ../data/units.xml.in.h:515 msgid "Megabyte" msgstr "" #: ../data/units.xml.in.h:516 msgid "Gigabyte" msgstr "" #: ../data/units.xml.in.h:517 msgid "Terabyte" msgstr "" #: ../data/units.xml.in.h:518 msgid "Kilobit" msgstr "" #: ../data/units.xml.in.h:519 msgid "Kibibit" msgstr "" #: ../data/units.xml.in.h:520 msgid "Mebibit" msgstr "" #: ../data/units.xml.in.h:521 msgid "Gibibit" msgstr "" #: ../data/units.xml.in.h:522 msgid "Megabit" msgstr "" #: ../data/units.xml.in.h:523 msgid "Gigabit" msgstr "" #: ../data/units.xml.in.h:524 msgid "Terabit" msgstr "" #: ../data/units.xml.in.h:525 msgid "Typography" msgstr "Typografi" #: ../data/units.xml.in.h:526 msgid "PostScript Point" msgstr "PostScipt-punkt" #: ../data/units.xml.in.h:527 msgid "ar:pt,a:pts,point,p:points" msgstr "punkt,point,p:punkter,p:points" #: ../data/units.xml.in.h:528 msgid "PostScript Pica" msgstr "PostScript-pica" #: ../data/units.xml.in.h:529 msgid "r:pica,p:picas" msgstr "" #: ../data/units.xml.in.h:530 msgid "ATA Pica" msgstr "ATA-pica" #: ../data/units.xml.in.h:531 msgid "r:ata_pica,p:ata_picas" msgstr "" #: ../data/units.xml.in.h:532 msgid "ATA Point" msgstr "ATA-punkt" #: ../data/units.xml.in.h:533 msgid "r:ata_point,a:ata_pt,p:ata_points" msgstr "" #: ../data/units.xml.in.h:534 msgid "New Didot Point" msgstr "Ny Didotpunkt" #: ../data/units.xml.in.h:535 msgid "r:new_didot" msgstr "" #: ../data/units.xml.in.h:536 msgid "Didot Point" msgstr "Didotpunkt" #: ../data/units.xml.in.h:537 msgid "r:didot,a:dd" msgstr "" #: ../data/units.xml.in.h:538 msgid "Cicero" msgstr "" #: ../data/units.xml.in.h:539 msgid "r:cicero" msgstr "" #: ../data/variables.xml.in.h:1 msgid "Small Numbers" msgstr "Små tal" #: ../data/variables.xml.in.h:2 msgid "Per Mille" msgstr "Promille" #: ../data/variables.xml.in.h:3 msgid "r:permille,au:‰" msgstr "" #: ../data/variables.xml.in.h:4 msgid "Per Myriad" msgstr "Permyriad" #: ../data/variables.xml.in.h:5 msgid "r:permyriad,au:‱" msgstr "" #: ../data/variables.xml.in.h:6 msgid "Percent" msgstr "Procent" #: ../data/variables.xml.in.h:8 #, no-c-format msgid "a:%,r:percent" msgstr "a:%,r:procent" #: ../data/variables.xml.in.h:9 msgid "Large Numbers" msgstr "Stora tal" #: ../data/variables.xml.in.h:10 msgid "Googolplex" msgstr "" #: ../data/variables.xml.in.h:11 msgid "r:googolplex" msgstr "" #: ../data/variables.xml.in.h:12 msgid "Googol" msgstr "" #: ../data/variables.xml.in.h:13 msgid "r:googol" msgstr "" #: ../data/variables.xml.in.h:14 msgid "Centillion" msgstr "" #: ../data/variables.xml.in.h:15 msgid "-r:centillion" msgstr "" #: ../data/variables.xml.in.h:16 msgid "Vigintillion" msgstr "Deciljard" #: ../data/variables.xml.in.h:17 msgid "-r:vigintillion" msgstr "deciljard,p:deciljarder" #: ../data/variables.xml.in.h:18 msgid "Novemdecillion" msgstr "Deciljon" #: ../data/variables.xml.in.h:19 msgid "-r:novemdecillion" msgstr "deciljon,p:deciljoner" #: ../data/variables.xml.in.h:20 msgid "Octodecillion" msgstr "Noniljard" #: ../data/variables.xml.in.h:21 msgid "-r:octodecillion" msgstr "noniljard,p:noniljarder" #: ../data/variables.xml.in.h:22 msgid "Septendecillion" msgstr "Noniljon" #: ../data/variables.xml.in.h:23 msgid "-r:septendecillion" msgstr "noniljon,p:noniljoner" #: ../data/variables.xml.in.h:24 msgid "Sexdecillion" msgstr "Oktiljard" #: ../data/variables.xml.in.h:25 msgid "-r:sexdecillion" msgstr "oktiljard,p:oktiljarder" #: ../data/variables.xml.in.h:26 msgid "Quindecillion" msgstr "Oktiljon" #: ../data/variables.xml.in.h:27 msgid "-r:quindecillion" msgstr "oktiljon,p:oktiljoner" #: ../data/variables.xml.in.h:28 msgid "Quattuordecillion" msgstr "Septiljard" #: ../data/variables.xml.in.h:29 msgid "-r:quattuordecillion" msgstr "septiljard,p:septiljarder" #: ../data/variables.xml.in.h:30 msgid "Tredecillion" msgstr "Septiljon" #: ../data/variables.xml.in.h:31 msgid "-r:tredecillion" msgstr "septiljon,p:septiljoner" #: ../data/variables.xml.in.h:32 msgid "Duodecillion" msgstr "Sextiljard" #: ../data/variables.xml.in.h:33 msgid "-r:duodecillion" msgstr "sextiljard,p:sextiljarder" #: ../data/variables.xml.in.h:34 msgid "Undecillion" msgstr "Sextiljon" #: ../data/variables.xml.in.h:35 msgid "-r:undecillion" msgstr "sextiljon,p:sextiljoner" #: ../data/variables.xml.in.h:36 msgid "Decillion" msgstr "Kvintiljard" #: ../data/variables.xml.in.h:37 msgid "-r:decillion" msgstr "kvintiljard,p:kvintiljarder" #: ../data/variables.xml.in.h:38 msgid "Nonillion" msgstr "Kvintiljon" #: ../data/variables.xml.in.h:39 msgid "-r:nonillion" msgstr "kvintiljon,p:kvintiljoner" #: ../data/variables.xml.in.h:40 msgid "Octillion" msgstr "Kvadriljard" #: ../data/variables.xml.in.h:41 msgid "-r:octillion" msgstr "kvadriljard,p:kvadriljarder" #: ../data/variables.xml.in.h:42 msgid "Septillion" msgstr "Kvadriljon" #: ../data/variables.xml.in.h:43 msgid "-r:septillion" msgstr "kvadriljon,p:kvadriljoner" #: ../data/variables.xml.in.h:44 msgid "Sextillion" msgstr "Triljard" #: ../data/variables.xml.in.h:45 msgid "-r:sextillion" msgstr "triljard,p:triljarder" #: ../data/variables.xml.in.h:46 msgid "Quintillion" msgstr "Triljon" #: ../data/variables.xml.in.h:47 msgid "-r:quintillion" msgstr "triljon,p:triljoner" #: ../data/variables.xml.in.h:48 msgid "Quadrillion" msgstr "Biljard" #: ../data/variables.xml.in.h:49 msgid "-r:quadrillion" msgstr "biljard,p:biljarder" #: ../data/variables.xml.in.h:50 msgid "Trillion" msgstr "Biljon" #: ../data/variables.xml.in.h:51 msgid "-r:trillion" msgstr "biljon,p:biljoner" #: ../data/variables.xml.in.h:52 msgid "Billion" msgstr "Miljard" #: ../data/variables.xml.in.h:53 msgid "-r:billion" msgstr "miljard,p:miljarder" #: ../data/variables.xml.in.h:54 msgid "Million" msgstr "Miljon" #: ../data/variables.xml.in.h:55 msgid "-r:million" msgstr "miljon,p:miljoner" #: ../data/variables.xml.in.h:56 msgid "Thousand" msgstr "Tusen" #: ../data/variables.xml.in.h:57 msgid "-r:thousand" msgstr "tusen" #: ../data/variables.xml.in.h:58 msgid "Hundred" msgstr "Hundra" #: ../data/variables.xml.in.h:59 msgid "-r:hundred" msgstr "hundra" #: ../data/variables.xml.in.h:60 msgid "Physical Constants" msgstr "Fysiska konstanter" #: ../data/variables.xml.in.h:61 msgid "Universal Constants" msgstr "Universala konstanter" #: ../data/variables.xml.in.h:62 msgid "Speed of Light in Vacuum" msgstr "Ljusets hastighet i vakuum" #: ../data/variables.xml.in.h:63 msgid "ar:c,speed_of_light" msgstr "a:c,ljusets_hastighet" #: ../data/variables.xml.in.h:64 msgid "Planck Time" msgstr "Planck-tid" #: ../data/variables.xml.in.h:65 msgid "r:planck_time,ais:t_P" msgstr "" #: ../data/variables.xml.in.h:66 msgid "Planck Temperature" msgstr "Planck-temperatur" #: ../data/variables.xml.in.h:67 msgid "r:planck_temperature,ais:T_P" msgstr "" #: ../data/variables.xml.in.h:68 msgid "Planck Mass" msgstr "Planck-massa" #: ../data/variables.xml.in.h:69 msgid "r:planck_mass,ais:m_P" msgstr "" #: ../data/variables.xml.in.h:70 msgid "Planck Length" msgstr "Planck-längd" #: ../data/variables.xml.in.h:71 msgid "r:planck_length,ais:l_P" msgstr "" #: ../data/variables.xml.in.h:72 msgid "Planck Constant" msgstr "Plancks konstant" #: ../data/variables.xml.in.h:73 msgid "r:planck,au:ℎ" msgstr "" #: ../data/variables.xml.in.h:74 msgid "Planck Constant over 2 pi" msgstr "Plancks konstant över 2 pi" #: ../data/variables.xml.in.h:75 msgid "r:planck2pi,au:ℏ" msgstr "" #: ../data/variables.xml.in.h:76 msgid "Newtonian Constant of Gravitation" msgstr "Newtonska gravitationskonstanten" #: ../data/variables.xml.in.h:77 msgid "r:newtonian_constant,a:G" msgstr "" #: ../data/variables.xml.in.h:78 msgid "Electric Constant (Permittivity of Free Space)" msgstr "Elektriska konstanten" #: ../data/variables.xml.in.h:79 msgid "r:electric_constant,aisu:ε_0" msgstr "" #: ../data/variables.xml.in.h:80 msgid "Magnetic Constant (Permeability of Free Space)" msgstr "Magnetiska konstanten" #: ../data/variables.xml.in.h:81 msgid "r:magnetic_constant,aisu:μ_0" msgstr "" #: ../data/variables.xml.in.h:82 msgid "Characteristic Impedance of Vacuum" msgstr "Karaktäristisk impedans för vakuum" #: ../data/variables.xml.in.h:83 msgid "r:characteristic_impedance,ais:Z_0" msgstr "" #: ../data/variables.xml.in.h:84 msgid "Electromagnetic Constants" msgstr "Elektromagnetiska konstanter" #: ../data/variables.xml.in.h:85 msgid "Bohr Magneton" msgstr "Bohrs magneton" #: ../data/variables.xml.in.h:86 msgid "r:bohr_magneton,aisu:μ_B" msgstr "" #: ../data/variables.xml.in.h:87 msgid "Conductance Quantum" msgstr "Konduktanskvantum" #: ../data/variables.xml.in.h:88 msgid "r:conductance_quantum,ais:G_0" msgstr "" #: ../data/variables.xml.in.h:89 msgid "Elementary Charge" msgstr "Elementarladdning" #: ../data/variables.xml.in.h:90 msgid "r:elementary_charge,ais:e_charge" msgstr "" #: ../data/variables.xml.in.h:91 msgid "Josephson Constant" msgstr "Josephsons konstant" #: ../data/variables.xml.in.h:92 msgid "r:josephson,ais:K_J" msgstr "" #: ../data/variables.xml.in.h:93 msgid "Magnetic Flux Quantum" msgstr "Magnetflödeskonstanten" #: ../data/variables.xml.in.h:94 msgid "r:magnetic_flux_quantum,aisu:Φ_0" msgstr "" #: ../data/variables.xml.in.h:95 msgid "Nuclear Magneton" msgstr "Kärnmagneton" #: ../data/variables.xml.in.h:96 msgid "r:nuclear_magneton,aisu:μ_N" msgstr "" #: ../data/variables.xml.in.h:97 msgid "von Klitzing Constant" msgstr "von Klitzing-konstanten" #: ../data/variables.xml.in.h:98 msgid "r:klitzing,ais:R_K" msgstr "" #: ../data/variables.xml.in.h:99 msgid "Atomic and Nuclear Constants" msgstr "Atomära och nukleära konstanter" #: ../data/variables.xml.in.h:100 msgid "Alpha Particle Mass" msgstr "Alfapartikelmassa" #: ../data/variables.xml.in.h:101 msgid "r:alpha_particle_mass,aisu:m_α" msgstr "" #: ../data/variables.xml.in.h:102 msgid "Bohr Radius" msgstr "Bohr-radie" #: ../data/variables.xml.in.h:103 msgid "r:bohr_radius,ais:a_0" msgstr "" #: ../data/variables.xml.in.h:104 msgid "Classical Electron Radius" msgstr "Klassisk elektron-radie" #: ../data/variables.xml.in.h:105 msgid "r:classical_electron_radius,ais:r_e" msgstr "" #: ../data/variables.xml.in.h:106 msgid "Compton Wavelength" msgstr "Compton-våglängd" #: ../data/variables.xml.in.h:107 msgid "r:compton_wavelength,aisu:λ_C" msgstr "" #: ../data/variables.xml.in.h:108 msgid "Electron Mass" msgstr "Elektronmassa" #: ../data/variables.xml.in.h:109 msgid "r:electron_mass,ais:m_e" msgstr "" #: ../data/variables.xml.in.h:110 msgid "Helion Mass" msgstr "Helion-massa" #: ../data/variables.xml.in.h:111 msgid "r:helion_mass,ais:m_h" msgstr "" #: ../data/variables.xml.in.h:112 msgid "Neutron Mass" msgstr "Neutronmassa" #: ../data/variables.xml.in.h:113 msgid "r:neutron_mass,ais:m_n" msgstr "" #: ../data/variables.xml.in.h:114 msgid "Proton Mass" msgstr "Protonmassa" #: ../data/variables.xml.in.h:115 msgid "r:proton_mass,ais:m_p" msgstr "" #: ../data/variables.xml.in.h:116 msgid "Rydberg Constant" msgstr "Rydbergs konstant" #: ../data/variables.xml.in.h:117 msgid "r:rydberg,aisu:R_∞" msgstr "" #: ../data/variables.xml.in.h:118 msgid "Tau Mass" msgstr "Tau-massa" #: ../data/variables.xml.in.h:119 msgid "r:tau_mass,aisu:m_τ" msgstr "" #: ../data/variables.xml.in.h:120 msgid "Physico-Chemical Constants" msgstr "Fysikalisk-kemiska konstanter" #: ../data/variables.xml.in.h:121 msgid "Atomic Mass Constant" msgstr "Atommassenhet" #: ../data/variables.xml.in.h:122 msgid "r:atomic_mass,ais:m_u" msgstr "atommassa,ais:m_u" #: ../data/variables.xml.in.h:123 msgid "Avogadro Constant" msgstr "Avogadros konstant" #: ../data/variables.xml.in.h:124 msgid "r:avogadro,ais:N_A" msgstr "" #: ../data/variables.xml.in.h:125 msgid "Boltzmann Constant" msgstr "Boltzmanns konstant" #: ../data/variables.xml.in.h:126 msgid "r:boltzmann,ais:k_B" msgstr "" #: ../data/variables.xml.in.h:127 msgid "Faraday Constant" msgstr "Faradays konstant" #: ../data/variables.xml.in.h:128 msgid "r:faraday" msgstr "" #: ../data/variables.xml.in.h:129 msgid "First Radiation Constant" msgstr "Första strålningskonstanten" #: ../data/variables.xml.in.h:130 msgid "r:first_radiation,ais:c_1" msgstr "" #: ../data/variables.xml.in.h:131 msgid "Ideal Gas Constant" msgstr "Gaskonstant" #: ../data/variables.xml.in.h:132 msgid "r:ideal_gas" msgstr "" #: ../data/variables.xml.in.h:133 msgid "Second Radiation Constant" msgstr "Andra strålningskonstanten" #: ../data/variables.xml.in.h:134 msgid "r:second_radiation,ais:c_2" msgstr "" #: ../data/variables.xml.in.h:135 msgid "Basic Constants" msgstr "Grundläggande konstanter" #: ../data/variables.xml.in.h:136 msgid "Golden Ratio" msgstr "Golden ratio" #: ../data/variables.xml.in.h:137 msgid "r:golden,au:φ" msgstr "" #: ../data/variables.xml.in.h:138 msgid "Omega Constant" msgstr "Omegakonstanten" #: ../data/variables.xml.in.h:139 msgid "r:omega" msgstr "" #: ../data/variables.xml.in.h:140 msgid "Pythagoras' Constant (sqrt 2)" msgstr "Pythagoras konstant (sqrt 2)" #: ../data/variables.xml.in.h:141 msgid "r:pythagoras" msgstr "" #: ../data/variables.xml.in.h:142 msgid "Apery's Constant" msgstr "Aperys konstant" #: ../data/variables.xml.in.h:143 msgid "r:apery" msgstr "" #: ../data/variables.xml.in.h:144 msgid "Base of Natural Logarithms (e)" msgstr "Basen för naturliga logaritmer (e)" #: ../data/variables.xml.in.h:145 msgid "r:e" msgstr "" #: ../data/variables.xml.in.h:146 msgid "Archimedes' Constant (pi)" msgstr "Archimedes konstant (pi)" #: ../data/variables.xml.in.h:147 msgid "au:π,r:pi" msgstr "" #: ../data/variables.xml.in.h:148 msgid "Euler's Constant" msgstr "Eulers konstant" #: ../data/variables.xml.in.h:149 msgid "au:γ,r:euler" msgstr "" #: ../data/variables.xml.in.h:150 msgid "Catalan's Constant" msgstr "Catalans konstant" #: ../data/variables.xml.in.h:151 msgid "r:catalan" msgstr "" #: ../data/variables.xml.in.h:152 msgid "Special Numbers" msgstr "Speciella nummer" #: ../data/variables.xml.in.h:153 msgid "Imaginary i (sqrt -1)" msgstr "Imaginärt i (sqrt -1)" #: ../data/variables.xml.in.h:154 msgid "r:i" msgstr "" #: ../data/variables.xml.in.h:155 msgid "Infinity" msgstr "Oändlighet" #: ../data/variables.xml.in.h:156 msgid "a:∞,r:infinity" msgstr "a:∞,r:oändlighet" #: ../data/variables.xml.in.h:157 msgid "Positive Infinity" msgstr "Positiv oändlighet" #: ../data/variables.xml.in.h:158 msgid "r:plus_infinity" msgstr "plus_oändlighet" #: ../data/variables.xml.in.h:159 msgid "Negative Infinity" msgstr "Negativ oändlighet" #: ../data/variables.xml.in.h:160 msgid "r:minus_infinity" msgstr "minus_oändlighet" #: ../data/variables.xml.in.h:161 msgid "Undefined" msgstr "Odefinierad" #: ../data/variables.xml.in.h:162 msgid "r:undefined" msgstr "odefinierad" #: ../data/variables.xml.in.h:163 msgid "False" msgstr "Falskt" #: ../data/variables.xml.in.h:164 msgid "r:false,r:no" msgstr "falskt,nej" #: ../data/variables.xml.in.h:165 msgid "True" msgstr "Sant" #: ../data/variables.xml.in.h:166 msgid "r:true,r:yes" msgstr "sant,ja" #: ../data/variables.xml.in.h:167 msgid "Unknowns" msgstr "Okända" #: ../data/variables.xml.in.h:168 msgid "r:x" msgstr "" #: ../data/variables.xml.in.h:169 msgid "r:y" msgstr "" #: ../data/variables.xml.in.h:170 msgid "r:z" msgstr "" #~ msgid "Ionization Potential" #~ msgstr "Joniseringspotential" #~ msgid "r:ionization" #~ msgstr "jonisering" #~ msgid "Covalent Radius" #~ msgstr "Kovalent radie" #~ msgid "r:covalent" #~ msgstr "kovalent" #~ msgid "Value 1 (n)" #~ msgstr "Värde 1 (n)" #~ msgid "Derive" #~ msgstr "Derivera" #~ 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.10/config.h.in0000644000175000017500000000557012757636737013245 00000000000000/* config.h.in. Generated from configure.ac 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 `int_n_cs_precedes' is a member of `struct lconv'. */ #undef HAVE_STRUCT_LCONV_INT_N_CS_PRECEDES /* Define to 1 if `int_p_cs_precedes' is a member of `struct lconv'. */ #undef HAVE_STRUCT_LCONV_INT_P_CS_PRECEDES /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_UNORDERED_MAP /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* 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 home page for this package. */ #undef PACKAGE_URL /* 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.10/po/0000755000175000017500000000000012757636740011703 500000000000000libqalculate-0.9.10/po/Makefile.in.in0000644000175000017500000001575612757636727014320 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 = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ localedir = @localedir@ 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)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" 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; else echo "$(ALL_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 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(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="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = ChangeLog 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 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ INTLTOOL_V_MSGFMT = $(INTLTOOL__v_MSGFMT_$(V)) INTLTOOL__v_MSGFMT_= $(INTLTOOL__v_MSGFMT_$(AM_DEFAULT_VERBOSITY)) INTLTOOL__v_MSGFMT_0 = @echo " MSGFMT" $@; .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $* $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(INTLTOOL_V_MSGFMT)$(MSGFMT) -o $@ $< .po.gmo: $(INTLTOOL_V_MSGFMT)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 linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(localedir)/$$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 ctags tags CTAGS 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)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(localedir)/$$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.10/po/POTFILES.in0000644000175000017500000000056112705146643013371 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.10/po/ChangeLog0000644000175000017500000000000012705146643013352 00000000000000libqalculate-0.9.10/po/zh_CN.po0000644000175000017500000017176212744163340013165 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: 2016-07-21 17:14+0200\n" "PO-Revision-Date: 2007-07-31 15:34+0800\n" "Last-Translator: Roy Qu \n" "Language-Team: Simplified Chinese\n" "Language: \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:102 ../src/qalc.cc:152 ../src/qalc.cc:2051 #: ../libqalculate/util.cc:538 msgid "yes" msgstr "yes" #: ../src/qalc.cc:103 ../src/qalc.cc:154 ../src/qalc.cc:2051 #: ../libqalculate/util.cc:539 msgid "no" msgstr "no" #: ../src/qalc.cc:104 ../libqalculate/util.cc:546 msgid "true" msgstr "true" #: ../src/qalc.cc:105 ../libqalculate/util.cc:547 msgid "false" msgstr "false" #: ../src/qalc.cc:106 ../src/qalc.cc:671 ../src/qalc.cc:686 ../src/qalc.cc:1608 #: ../src/qalc.cc:2050 ../src/qalc.cc:2135 ../libqalculate/util.cc:554 msgid "on" msgstr "on" #: ../src/qalc.cc:107 ../src/qalc.cc:618 ../src/qalc.cc:644 ../src/qalc.cc:656 #: ../src/qalc.cc:669 ../src/qalc.cc:684 ../src/qalc.cc:1596 #: ../src/qalc.cc:1606 ../src/qalc.cc:1628 ../src/qalc.cc:1635 #: ../src/qalc.cc:1657 ../src/qalc.cc:2050 ../src/qalc.cc:2122 #: ../src/qalc.cc:2135 ../src/qalc.cc:2155 ../src/qalc.cc:2160 #: ../src/qalc.cc:2170 ../libqalculate/util.cc:555 msgid "off" msgstr "off" #: ../src/qalc.cc:159 msgid "Please answer yes or no" msgstr "请回答yes或者no" #: ../src/qalc.cc:166 ../src/qalc.cc:788 ../src/qalc.cc:1557 #: ../src/qalc.cc:2012 ../src/qalc.cc:2068 ../src/qalc.cc:2080 #: ../src/qalc.cc:2202 ../src/qalc.cc:2214 msgid "unknown" msgstr "unknown" #: ../src/qalc.cc:172 ../src/qalc.cc:450 ../src/qalc.cc:481 ../src/qalc.cc:559 #: ../src/qalc.cc:574 ../src/qalc.cc:1515 ../src/qalc.cc:1526 #: ../src/qalc.cc:1561 ../src/qalc.cc:1576 ../src/qalc.cc:2060 #: ../src/qalc.cc:2062 ../src/qalc.cc:2095 ../src/qalc.cc:2113 msgid "none" msgstr "none" #: ../src/qalc.cc:174 ../src/qalc.cc:785 ../src/qalc.cc:1554 #: ../src/qalc.cc:2009 ../src/qalc.cc:2082 ../src/qalc.cc:2216 msgid "non-matrix" msgstr "non-matrix" #: ../src/qalc.cc:176 ../src/qalc.cc:783 ../src/qalc.cc:1552 #: ../src/qalc.cc:2007 ../src/qalc.cc:2086 ../src/qalc.cc:2220 msgid "complex" msgstr "complex" #: ../src/qalc.cc:178 ../src/qalc.cc:782 ../src/qalc.cc:1551 #: ../src/qalc.cc:2006 ../src/qalc.cc:2088 ../src/qalc.cc:2222 msgid "real" msgstr "real" #: ../src/qalc.cc:180 ../src/qalc.cc:784 ../src/qalc.cc:1553 #: ../src/qalc.cc:2008 ../src/qalc.cc:2084 ../src/qalc.cc:2218 #: ../libqalculate/Function.cc:1539 msgid "number" msgstr "number" #: ../src/qalc.cc:182 ../src/qalc.cc:781 ../src/qalc.cc:1550 #: ../src/qalc.cc:2005 ../src/qalc.cc:2090 ../src/qalc.cc:2224 msgid "rational" msgstr "rational" #: ../src/qalc.cc:184 ../src/qalc.cc:780 ../src/qalc.cc:1549 #: ../src/qalc.cc:2004 ../src/qalc.cc:2092 ../src/qalc.cc:2226 #: ../libqalculate/Function.cc:1694 msgid "integer" msgstr "integer" #: ../src/qalc.cc:186 ../src/qalc.cc:775 ../src/qalc.cc:1544 #: ../src/qalc.cc:1999 ../src/qalc.cc:2070 ../src/qalc.cc:2204 msgid "non-zero" msgstr "non-zero" #: ../src/qalc.cc:188 ../src/qalc.cc:771 ../src/qalc.cc:1540 #: ../src/qalc.cc:1995 ../src/qalc.cc:2072 ../src/qalc.cc:2206 msgid "positive" msgstr "positive" #: ../src/qalc.cc:190 ../src/qalc.cc:774 ../src/qalc.cc:1543 #: ../src/qalc.cc:1998 ../src/qalc.cc:2078 ../src/qalc.cc:2212 msgid "non-negative" msgstr "non-negative" #: ../src/qalc.cc:192 msgid "negatve" msgstr "negatve" #: ../src/qalc.cc:194 ../src/qalc.cc:772 ../src/qalc.cc:1541 #: ../src/qalc.cc:1996 ../src/qalc.cc:2076 ../src/qalc.cc:2210 msgid "non-positive" msgstr "non-positive" #: ../src/qalc.cc:197 msgid "Unrecognized assumption." msgstr "未被承认的假设" #: ../src/qalc.cc:336 ../libqalculate/Calculator.cc:8910 #, fuzzy, c-format msgid "It has been %s day(s) since the exchange rates last were updated." msgstr "距离最后一次汇率更新已超过一周了。" #: ../src/qalc.cc:341 msgid "Do you wish to update the exchange rates now?" msgstr "" #: ../src/qalc.cc:354 ../src/qalc.cc:355 msgid "" "\n" "Press Enter to continue." msgstr "" "\n" "按回车键继续" #: ../src/qalc.cc:363 ../src/qalc.cc:364 ../src/qalc.cc:365 ../src/qalc.cc:465 #: ../src/qalc.cc:468 ../src/qalc.cc:590 ../src/qalc.cc:601 ../src/qalc.cc:610 msgid "Illegal value" msgstr "非法值" #. qalc command #: ../src/qalc.cc:379 ../src/qalc.cc:562 ../src/qalc.cc:1378 #: ../src/qalc.cc:1488 ../src/qalc.cc:1563 ../src/qalc.cc:1566 #: ../src/qalc.cc:1696 ../src/qalc.cc:2095 ../src/qalc.cc:2096 #: ../src/qalc.cc:2277 ../src/qalc.cc:2817 msgid "base" msgstr "base" #: ../src/qalc.cc:379 ../src/qalc.cc:381 ../src/qalc.cc:1613 #: ../src/qalc.cc:2137 msgid "input base" msgstr "input base" #: ../src/qalc.cc:379 msgid "output base" msgstr "output base" #: ../src/qalc.cc:382 ../src/qalc.cc:1568 ../src/qalc.cc:1615 #: ../src/qalc.cc:2108 ../src/qalc.cc:2145 msgid "roman" msgstr "roman" #: ../src/qalc.cc:383 ../src/qalc.cc:1570 ../src/qalc.cc:2106 msgid "time" msgstr "time" #: ../src/qalc.cc:384 ../src/qalc.cc:2102 ../src/qalc.cc:2143 msgid "hex" msgstr "hex" #: ../src/qalc.cc:384 ../src/qalc.cc:1426 ../src/qalc.cc:2772 msgid "hexadecimal" msgstr "hexadecimal" #: ../src/qalc.cc:385 ../src/qalc.cc:2096 ../src/qalc.cc:2137 msgid "bin" msgstr "bin" #: ../src/qalc.cc:385 ../src/qalc.cc:1431 ../src/qalc.cc:2781 msgid "binary" msgstr "binary" #: ../src/qalc.cc:386 ../src/qalc.cc:2098 ../src/qalc.cc:2139 msgid "oct" msgstr "oct" #: ../src/qalc.cc:386 ../src/qalc.cc:1436 ../src/qalc.cc:2790 msgid "octal" msgstr "octal" #: ../src/qalc.cc:387 ../src/qalc.cc:2100 ../src/qalc.cc:2141 msgid "dec" msgstr "dec" #: ../src/qalc.cc:387 msgid "decimal" msgstr "decimal" #: ../src/qalc.cc:388 ../src/qalc.cc:2104 msgid "sex" msgstr "sex" #: ../src/qalc.cc:388 ../src/qalc.cc:1569 msgid "sexagesimal" msgstr "sexagesimal" #: ../src/qalc.cc:405 ../src/qalc.cc:448 ../src/qalc.cc:1574 #: ../src/qalc.cc:2113 msgid "base display" msgstr "base display" #: ../src/qalc.cc:410 msgid "Illegal base." msgstr "Illegal base." #: ../src/qalc.cc:418 ../src/qalc.cc:1558 ../src/qalc.cc:2067 msgid "assumptions" msgstr "assumptions" #: ../src/qalc.cc:428 ../src/qalc.cc:1520 ../src/qalc.cc:2061 msgid "all prefixes" msgstr "all prefixes" #: ../src/qalc.cc:429 ../src/qalc.cc:1583 ../src/qalc.cc:2116 msgid "complex numbers" msgstr "complex numbers" #: ../src/qalc.cc:430 ../src/qalc.cc:1593 ../src/qalc.cc:2121 msgid "excessive parentheses" msgstr "excessive parentheses" #: ../src/qalc.cc:431 ../src/qalc.cc:1612 ../src/qalc.cc:1729 #: ../src/qalc.cc:2136 msgid "functions" msgstr "functions" #: ../src/qalc.cc:432 ../src/qalc.cc:1620 ../src/qalc.cc:2150 msgid "infinite numbers" msgstr "infinite numbers" #: ../src/qalc.cc:433 ../src/qalc.cc:1668 ../src/qalc.cc:2177 msgid "show negative exponents" msgstr "show negative exponents" #: ../src/qalc.cc:434 ../src/qalc.cc:1536 ../src/qalc.cc:2064 msgid "assume nonzero denominators" msgstr "assume nonzero denominators" #: ../src/qalc.cc:435 ../src/qalc.cc:1537 ../src/qalc.cc:2065 msgid "warn nonzero denominators" msgstr "warn nonzero denominators" #: ../src/qalc.cc:436 ../src/qalc.cc:1654 ../src/qalc.cc:2169 msgid "prefixes" msgstr "prefixes" #: ../src/qalc.cc:437 ../src/qalc.cc:1584 ../src/qalc.cc:2117 msgid "denominator prefixes" msgstr "denominator prefixes" #: ../src/qalc.cc:438 ../src/qalc.cc:1652 ../src/qalc.cc:2167 msgid "place units separately" msgstr "place units separately" #: ../src/qalc.cc:439 ../src/qalc.cc:1582 ../src/qalc.cc:2115 msgid "calculate variables" msgstr "calculate variables" #: ../src/qalc.cc:440 ../src/qalc.cc:1581 ../src/qalc.cc:2114 msgid "calculate functions" msgstr "calculate functions" #: ../src/qalc.cc:441 ../src/qalc.cc:1672 ../src/qalc.cc:2181 msgid "sync units" msgstr "sync units" #: ../src/qalc.cc:442 ../src/qalc.cc:1662 ../src/qalc.cc:2171 msgid "round to even" msgstr "round to even" #. qalc command #: ../src/qalc.cc:443 ../src/qalc.cc:1381 ../src/qalc.cc:1663 #: ../src/qalc.cc:1709 ../src/qalc.cc:2172 ../src/qalc.cc:2265 msgid "rpn" msgstr "rpn" #: ../src/qalc.cc:444 ../src/qalc.cc:1664 ../src/qalc.cc:2173 msgid "rpn syntax" msgstr "rpn syntax" #: ../src/qalc.cc:445 ../src/qalc.cc:1669 ../src/qalc.cc:2178 msgid "short multiplication" msgstr "short multiplication" #: ../src/qalc.cc:446 ../src/qalc.cc:1622 ../src/qalc.cc:2153 msgid "lowercase e" msgstr "lowercase e" #: ../src/qalc.cc:447 ../src/qalc.cc:1623 ../src/qalc.cc:2154 msgid "lowercase numbers" msgstr "lowercase numbers" #: ../src/qalc.cc:451 ../src/qalc.cc:1577 ../src/qalc.cc:2113 msgid "normal" msgstr "normal" #: ../src/qalc.cc:452 ../src/qalc.cc:1578 ../src/qalc.cc:2113 msgid "alternative" msgstr "alternative" #: ../src/qalc.cc:457 ../src/qalc.cc:486 ../src/qalc.cc:500 ../src/qalc.cc:524 #: ../src/qalc.cc:538 ../src/qalc.cc:552 ../src/qalc.cc:567 ../src/qalc.cc:581 #: ../src/qalc.cc:628 ../src/qalc.cc:637 ../src/qalc.cc:677 ../src/qalc.cc:691 msgid "Illegal value." msgstr "非法数值。" #: ../src/qalc.cc:462 ../src/qalc.cc:1671 ../src/qalc.cc:2180 msgid "spell out logical" msgstr "spell out logical" #: ../src/qalc.cc:463 ../src/qalc.cc:1592 ../src/qalc.cc:2119 msgid "dot as separator" msgstr "dot as separator" #: ../src/qalc.cc:464 ../src/qalc.cc:1621 ../src/qalc.cc:2152 msgid "limit implicit multiplication" msgstr "limit implicit multiplication" #: ../src/qalc.cc:466 ../src/qalc.cc:1670 ../src/qalc.cc:2179 msgid "spacious" msgstr "spacious" #: ../src/qalc.cc:467 ../src/qalc.cc:1673 ../src/qalc.cc:2182 msgid "unicode" msgstr "unicode" #: ../src/qalc.cc:470 ../src/qalc.cc:1674 ../src/qalc.cc:1731 #: ../src/qalc.cc:2183 msgid "units" msgstr "units" #: ../src/qalc.cc:471 ../src/qalc.cc:1675 ../src/qalc.cc:2184 msgid "unknowns" msgstr "unknowns" #: ../src/qalc.cc:472 ../src/qalc.cc:1683 ../src/qalc.cc:1730 #: ../src/qalc.cc:2191 msgid "variables" msgstr "variables" #: ../src/qalc.cc:473 ../src/qalc.cc:1512 ../src/qalc.cc:2059 msgid "abbreviations" msgstr "abbreviations" #: ../src/qalc.cc:474 ../src/qalc.cc:1667 ../src/qalc.cc:2176 msgid "show ending zeroes" msgstr "show ending zeroes" #: ../src/qalc.cc:475 ../src/qalc.cc:1619 ../src/qalc.cc:2151 msgid "indicate infinite series" msgstr "indicate infinite series" #: ../src/qalc.cc:476 ../src/qalc.cc:1521 ../src/qalc.cc:2062 msgid "angle unit" msgstr "angle unit" #: ../src/qalc.cc:478 ../src/qalc.cc:1523 ../src/qalc.cc:1524 msgid "rad" msgstr "rad" #: ../src/qalc.cc:478 ../src/qalc.cc:2062 msgid "radians" msgstr "radians" #: ../src/qalc.cc:479 msgid "deg" msgstr "deg" #: ../src/qalc.cc:479 ../src/qalc.cc:2062 msgid "degrees" msgstr "degrees" #: ../src/qalc.cc:480 ../src/qalc.cc:1525 msgid "gra" msgstr "gra" #: ../src/qalc.cc:480 ../src/qalc.cc:2062 msgid "gradians" msgstr "gradians" #: ../src/qalc.cc:491 ../src/qalc.cc:1645 ../src/qalc.cc:2166 #: ../src/qalc.cc:2318 #, fuzzy msgid "parsing mode" msgstr "exp mode" #: ../src/qalc.cc:493 ../src/qalc.cc:1647 ../src/qalc.cc:2166 #: ../src/qalc.cc:2326 #, fuzzy msgid "adaptive" msgstr "alternative" #: ../src/qalc.cc:494 ../src/qalc.cc:1648 ../src/qalc.cc:2166 #: ../src/qalc.cc:2323 msgid "implicit first" msgstr "" #: ../src/qalc.cc:495 ../src/qalc.cc:1649 ../src/qalc.cc:2166 #: ../src/qalc.cc:2320 #, fuzzy msgid "conventional" msgstr "可选的" #: ../src/qalc.cc:505 ../src/qalc.cc:938 ../src/qalc.cc:1676 #: ../src/qalc.cc:2185 msgid "update exchange rates" msgstr "" #: ../src/qalc.cc:506 ../src/qalc.cc:1679 ../src/qalc.cc:2187 msgid "never" msgstr "" #: ../src/qalc.cc:508 ../src/qalc.cc:1678 ../src/qalc.cc:2186 #, fuzzy msgid "ask" msgstr "ans" #: ../src/qalc.cc:515 ../src/qalc.cc:1638 ../src/qalc.cc:2165 msgid "multiplication sign" msgstr "multiplication sign" #: ../src/qalc.cc:529 ../src/qalc.cc:1585 ../src/qalc.cc:2118 msgid "division sign" msgstr "division sign" #: ../src/qalc.cc:543 ../src/qalc.cc:1529 ../src/qalc.cc:2063 msgid "approximation" msgstr "近似" #. qalc command #: ../src/qalc.cc:545 ../src/qalc.cc:587 ../src/qalc.cc:670 ../src/qalc.cc:1411 #: ../src/qalc.cc:1531 ../src/qalc.cc:1607 ../src/qalc.cc:1699 #: ../src/qalc.cc:2063 ../src/qalc.cc:2120 ../src/qalc.cc:2135 #: ../src/qalc.cc:2281 msgid "exact" msgstr "exact" #: ../src/qalc.cc:546 ../src/qalc.cc:1532 ../src/qalc.cc:2063 msgid "try exact" msgstr "try exact" #. qalc command #: ../src/qalc.cc:547 ../src/qalc.cc:796 ../src/qalc.cc:1417 #: ../src/qalc.cc:1533 ../src/qalc.cc:1694 ../src/qalc.cc:1924 #: ../src/qalc.cc:1934 ../src/qalc.cc:2022 ../src/qalc.cc:2063 #: ../src/qalc.cc:2285 msgid "approximate" msgstr "approximate" #: ../src/qalc.cc:557 ../src/qalc.cc:1559 ../src/qalc.cc:2095 msgid "autoconversion" msgstr "autoconversion" #: ../src/qalc.cc:560 ../src/qalc.cc:1482 msgid "best" msgstr "best" #: ../src/qalc.cc:561 ../src/qalc.cc:1482 ../src/qalc.cc:1562 #: ../src/qalc.cc:2095 ../src/qalc.cc:2808 #, fuzzy msgid "optimal" msgstr "可选的" #: ../src/qalc.cc:572 ../src/qalc.cc:1513 ../src/qalc.cc:2060 msgid "algebra mode" msgstr "algebra mode" #. qalc command #: ../src/qalc.cc:575 ../src/qalc.cc:1505 ../src/qalc.cc:1516 #: ../src/qalc.cc:1714 ../src/qalc.cc:2043 ../src/qalc.cc:2060 msgid "simplify" msgstr "simplify" #: ../src/qalc.cc:576 ../src/qalc.cc:1517 ../src/qalc.cc:2060 msgid "factorize" msgstr "factorize" #: ../src/qalc.cc:598 ../src/qalc.cc:1666 ../src/qalc.cc:1712 #: ../src/qalc.cc:2175 msgid "save mode" msgstr "save mode" #: ../src/qalc.cc:607 ../src/qalc.cc:1665 ../src/qalc.cc:1711 #: ../src/qalc.cc:2174 msgid "save definitions" msgstr "save definitions" #: ../src/qalc.cc:616 ../src/qalc.cc:1594 ../src/qalc.cc:2122 msgid "exp mode" msgstr "exp mode" #: ../src/qalc.cc:619 ../src/qalc.cc:1597 ../src/qalc.cc:2124 msgid "auto" msgstr "auto" #: ../src/qalc.cc:620 ../src/qalc.cc:1598 ../src/qalc.cc:2128 msgid "pure" msgstr "pure" #: ../src/qalc.cc:621 ../src/qalc.cc:1599 ../src/qalc.cc:2130 msgid "scientific" msgstr "scientific" #: ../src/qalc.cc:622 ../src/qalc.cc:1600 ../src/qalc.cc:2126 msgid "engineering" msgstr "engineering" #: ../src/qalc.cc:633 ../src/qalc.cc:1653 ../src/qalc.cc:2168 msgid "precision" msgstr "precision" #: ../src/qalc.cc:642 ../src/qalc.cc:1624 ../src/qalc.cc:2155 msgid "max decimals" msgstr "max decimals" #: ../src/qalc.cc:654 ../src/qalc.cc:1631 ../src/qalc.cc:2160 msgid "min decimals" msgstr "min decimals" #: ../src/qalc.cc:667 ../src/qalc.cc:1604 ../src/qalc.cc:2135 msgid "fractions" msgstr "fractions" #: ../src/qalc.cc:672 ../src/qalc.cc:1609 ../src/qalc.cc:2135 msgid "combined" msgstr "combined" #: ../src/qalc.cc:682 ../src/qalc.cc:1655 ../src/qalc.cc:2170 msgid "read precision" msgstr "read precision" #: ../src/qalc.cc:685 ../src/qalc.cc:1658 ../src/qalc.cc:2170 msgid "always" msgstr "always" #: ../src/qalc.cc:686 ../src/qalc.cc:1659 ../src/qalc.cc:2170 msgid "when decimals" msgstr "" #: ../src/qalc.cc:710 msgid "Unrecognized option." msgstr "无法识别的选项。" #: ../src/qalc.cc:742 #, fuzzy msgid "Variables:" msgstr "变量" #: ../src/qalc.cc:744 #, fuzzy msgid "Name" msgstr "名称" #: ../src/qalc.cc:745 ../src/qalc.cc:2018 msgid "Value" msgstr "值" #: ../src/qalc.cc:761 ../src/qalc.cc:1985 ../libqalculate/Function.cc:1863 msgid "matrix" msgstr "matrix" #: ../src/qalc.cc:763 ../src/qalc.cc:1987 ../libqalculate/Function.cc:1802 msgid "vector" msgstr "vector" #: ../src/qalc.cc:773 ../src/qalc.cc:1542 ../src/qalc.cc:1997 #: ../src/qalc.cc:2074 ../src/qalc.cc:2208 msgid "negative" msgstr "negative" #: ../src/qalc.cc:790 ../src/qalc.cc:2014 msgid "default assumptions" msgstr "缺省假设" #: ../src/qalc.cc:811 #, fuzzy msgid "Functions:" msgstr "函数" #: ../src/qalc.cc:825 #, fuzzy msgid "Units:" msgstr "单位" #: ../src/qalc.cc:832 msgid "No local variables, functions or units have been defined." msgstr "" #: ../src/qalc.cc:837 ../src/qalc.cc:897 #, fuzzy msgid "" "For more information about a specific function, variable or unit, please use " "the info command (in interactive mode)." msgstr "输入info 名称 以获取关于函数,变量或单位的信息。(例:info sin)" #: ../src/qalc.cc:932 msgid "usage: qalc [options] [expression]" msgstr "用法:qalc [选项] [表达式]" #: ../src/qalc.cc:934 msgid "where options are:" msgstr "可用选项有:" #: ../src/qalc.cc:935 ../src/qalc.cc:1696 msgid "BASE" msgstr "BASE" #: ../src/qalc.cc:936 msgid "set the result number base" msgstr "" #: ../src/qalc.cc:939 msgid "FILE" msgstr "文件" #: ../src/qalc.cc:940 msgid "executes commands from a file first" msgstr "首先执行指定文件中的命令" #: ../src/qalc.cc:942 msgid "start in interactive mode" msgstr "" #: ../src/qalc.cc:944 #, fuzzy msgid "displays a list of all user-defined variables, functions and units." msgstr "\"%s\"不是合法的变量/函数/单位。" #: ../src/qalc.cc:946 msgid "displays a list of all functions." msgstr "" #: ../src/qalc.cc:948 msgid "displays a list of all units." msgstr "" #: ../src/qalc.cc:950 msgid "displays a list of all variables." msgstr "" #: ../src/qalc.cc:952 msgid "do not load any functions, units, or variables from file" msgstr "不载入文件中的函数、单位和变量定义" #: ../src/qalc.cc:954 msgid "do not load any global currencies from file" msgstr "不载入文件中的全局货币定义" #: ../src/qalc.cc:956 msgid "do not load any global data sets from file" msgstr "不载入文件中的全局数据集" #: ../src/qalc.cc:958 msgid "do not load any global functions from file" msgstr "不载入文件中的全局函数定义" #: ../src/qalc.cc:960 msgid "do not load any global units from file" msgstr "不载入文件中的全局单位定义" #: ../src/qalc.cc:962 msgid "do not load any global variables from file" msgstr "不载入文件中的全局变量定义" #: ../src/qalc.cc:964 msgid "reduces output to just the result of the input expression" msgstr "限制输出,仅输出输入表达式的结果" #: ../src/qalc.cc:965 ../src/qalc.cc:1713 msgid "OPTION" msgstr "选项" #: ../src/qalc.cc:965 ../src/qalc.cc:1713 msgid "VALUE" msgstr "值" #: ../src/qalc.cc:966 msgid "as set command in interactive program session (ex. -set \"base 16\")" msgstr "与在交互编程环境下使用set命令的作用一致 (例如, -set \"base 16\")" #: ../src/qalc.cc:968 msgid "turn on/off unicode support" msgstr "打开/关闭unicode支持" #: ../src/qalc.cc:970 #, fuzzy msgid "" "The program will start in interactive mode if no expression and no file is " "specified (or interactive mode is explicitly selected)." msgstr "如果未指定表达式,程序将以交互模式启动。" #: ../src/qalc.cc:1015 msgid "No option and value specified for set command." msgstr "在set命令中未指定选项或数值。" #: ../src/qalc.cc:1023 msgid "No file specified." msgstr "未指定文件。" #: ../src/qalc.cc:1074 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:1082 msgid "ans" msgstr "ans" #: ../src/qalc.cc:1083 ../src/qalc.cc:1086 ../src/qalc.cc:1087 #: ../src/qalc.cc:1088 ../src/qalc.cc:1089 ../src/qalc.cc:1310 #: ../libqalculate/Calculator.cc:7713 ../libqalculate/Calculator.cc:7729 msgid "Temporary" msgstr "临时" #: ../src/qalc.cc:1083 msgid "Last Answer" msgstr "最后一个答案" #: ../src/qalc.cc:1084 msgid "answer" msgstr "answer" #: ../src/qalc.cc:1086 msgid "Answer 2" msgstr "答案2" #: ../src/qalc.cc:1087 msgid "Answer 3" msgstr "答案3" #: ../src/qalc.cc:1088 msgid "Answer 4" msgstr "答案4" #: ../src/qalc.cc:1089 msgid "Answer 5" msgstr "答案5" #: ../src/qalc.cc:1100 msgid "Failed to load global definitions!" msgstr "载入全局定义失败!" #: ../src/qalc.cc:1139 #, c-format msgid "Could not open \"%s\".\n" msgstr "无法打开\"%s\".\n" #: ../src/qalc.cc:1162 ../src/qalc.cc:1212 ../src/qalc.cc:2345 #, 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:1272 ../src/qalc.cc:1713 ../src/qalc.cc:2047 msgid "set" msgstr "set" #. qalc command #: ../src/qalc.cc:1276 ../src/qalc.cc:1710 ../src/qalc.cc:2231 msgid "save" msgstr "save" #: ../src/qalc.cc:1276 ../src/qalc.cc:1710 ../src/qalc.cc:2231 msgid "store" msgstr "store" #. qalc command #: ../src/qalc.cc:1279 ../src/qalc.cc:1508 ../src/qalc.cc:1708 #: ../src/qalc.cc:2244 msgid "mode" msgstr "mode" #: ../src/qalc.cc:1281 msgid "mode saved" msgstr "模式已保存" #: ../src/qalc.cc:1283 msgid "definitions" msgstr "definitions" #: ../src/qalc.cc:1285 msgid "definitions saved" msgstr "定义已保存" #: ../src/qalc.cc:1332 ../src/qalc.cc:1334 #, c-format msgid "Illegal name. Save as %s instead (default: no)?" msgstr "非法文件名。是否另存为%s?" #: ../src/qalc.cc:1341 msgid "" "An unit or variable with the same name already exists.\n" "Do you want to overwrite it (default: no)?" msgstr "" "同名的单位或变量已存在。\n" "您要覆盖它吗?" #. qalc command #: ../src/qalc.cc:1364 ../src/qalc.cc:1698 ../src/qalc.cc:2238 msgid "delete" msgstr "" #: ../src/qalc.cc:1371 #, fuzzy msgid "No user-defined variable with the specified name exist." msgstr "找不到指定名称的函数、变量或单位。" #. qalc command #: ../src/qalc.cc:1374 ../src/qalc.cc:1695 ../src/qalc.cc:2198 msgid "assume" msgstr "assume" #. qalc command #: ../src/qalc.cc:1384 ../src/qalc.cc:1390 ../src/qalc.cc:1700 #: ../src/qalc.cc:2261 msgid "exrates" msgstr "exrates" #. qalc command #: ../src/qalc.cc:1394 ../src/qalc.cc:1715 ../src/qalc.cc:2273 msgid "stack" msgstr "stack" #: ../src/qalc.cc:1396 msgid "The RPN stack is empty." msgstr "逆波兰范式栈为空。" #. qalc command #: ../src/qalc.cc:1408 ../src/qalc.cc:1697 ../src/qalc.cc:2269 msgid "clear stack" msgstr "clear stack" #. qalc command #: ../src/qalc.cc:1423 ../src/qalc.cc:1716 ../src/qalc.cc:2289 msgid "convert" msgstr "convert" #: ../src/qalc.cc:1423 ../src/qalc.cc:1716 ../src/qalc.cc:2289 #: ../src/qalc.cc:2310 msgid "to" msgstr "to" #: ../src/qalc.cc:1441 ../src/qalc.cc:2805 #, fuzzy msgid "bases" msgstr "base" #: ../src/qalc.cc:1474 ../src/qalc.cc:2799 #, fuzzy msgid "fraction" msgstr "fractions" #: ../src/qalc.cc:1480 ../src/qalc.cc:2802 #, fuzzy msgid "factors" msgstr "factor" #. qalc command #: ../src/qalc.cc:1502 ../src/qalc.cc:1705 ../src/qalc.cc:2039 msgid "factor" msgstr "factor" #. qalc command #: ../src/qalc.cc:1686 ../src/qalc.cc:2036 msgid "help" msgstr "help" #: ../src/qalc.cc:1689 #, fuzzy msgid "Enter a mathematical expression or a command and press enter." msgstr "请输入一个数学表达式或命令。" #: ../src/qalc.cc:1690 msgid "Complete functions, units and variables with the tabulator key." msgstr "使用tab键补全函数、命令和单位。" #: ../src/qalc.cc:1692 msgid "Available commands are:" msgstr "候选命令有:" #: ../src/qalc.cc:1695 msgid "ASSUMPTIONS" msgstr "假设" #: ../src/qalc.cc:1698 ../src/qalc.cc:1710 msgid "NAME" msgstr "名称" #: ../src/qalc.cc:1702 msgid "WGET ARGUMENTS" msgstr "WGET ARGUMENTS" #. qalc command #: ../src/qalc.cc:1706 ../src/qalc.cc:1734 ../src/qalc.cc:2255 #: ../libqalculate/Calculator.cc:8360 ../libqalculate/DataSet.cc:355 #: ../libqalculate/DataSet.cc:382 ../libqalculate/DataSet.cc:1032 msgid "info" msgstr "info" #. qalc command #: ../src/qalc.cc:1707 ../src/qalc.cc:1723 ../src/qalc.cc:1725 #: ../src/qalc.cc:2248 msgid "list" msgstr "" #: ../src/qalc.cc:1709 msgid "ON/OFF" msgstr "ON/OFF" #: ../src/qalc.cc:1710 msgid "CATEGORY" msgstr "类别" #: ../src/qalc.cc:1710 msgid "TITLE" msgstr "标题" #: ../src/qalc.cc:1716 msgid "UNIT or \"TO\" COMMAND" msgstr "" #. qalc command #: ../src/qalc.cc:1717 ../src/qalc.cc:2314 ../src/qalc.cc:2335 msgid "quit" msgstr "quit" #: ../src/qalc.cc:1717 ../src/qalc.cc:2314 ../src/qalc.cc:2335 msgid "exit" msgstr "exit" #: ../src/qalc.cc:1718 #, fuzzy msgid "Type help COMMAND for more information (example: help save)." msgstr "输入help 命令 以获取更多帮助(例如:help save)" #: ../src/qalc.cc:1719 #, fuzzy msgid "" "Type info NAME for information about a function, variable or unit (example: " "info sin)." msgstr "输入info 名称 以获取关于函数,变量或单位的信息。(例:info sin)" #: ../src/qalc.cc:1720 msgid "" "For more information about mathematical expression, different options, and a " "complete list of functions, variables and units, see the relevant sections " "in the manual of the graphical user interface (available at http://qalculate." "github.io/manual/index.html)." msgstr "" #: ../src/qalc.cc:1742 msgid "No function, variable or unit with specified name exist." msgstr "找不到指定名称的函数、变量或单位。" #: ../src/qalc.cc:1752 msgid "Function" msgstr "函数" #: ../src/qalc.cc:1779 ../libqalculate/Function.cc:189 msgid "argument" msgstr "argument" #: ../src/qalc.cc:1803 #, 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:1816 msgid "Arguments" msgstr "自变量" #. optional argument, in description #: ../src/qalc.cc:1833 msgid "optional" msgstr "可选的" #. argument default, in description #: ../src/qalc.cc:1837 msgid "default: " msgstr "缺省:" #: ../src/qalc.cc:1848 msgid "Requirement" msgstr "要求" #: ../src/qalc.cc:1856 msgid "Properties" msgstr "属性" #: ../src/qalc.cc:1871 msgid "key" msgstr "key" #: ../src/qalc.cc:1889 ../src/qalc.cc:1892 msgid "Unit" msgstr "单位" #: ../src/qalc.cc:1895 ../src/qalc.cc:1963 msgid "Names" msgstr "名称" #: ../src/qalc.cc:1913 msgid "Base Unit" msgstr "基准单位" #: ../src/qalc.cc:1920 msgid "Relation" msgstr "关系" #: ../src/qalc.cc:1930 msgid "Inverse Relation" msgstr "反向关系" #: ../src/qalc.cc:1942 msgid "Base Units" msgstr "基准单位" #: ../src/qalc.cc:1957 ../src/qalc.cc:1960 msgid "Variable" msgstr "变量" #: ../src/qalc.cc:1975 msgid "a previous result" msgstr "之前的结果" #: ../src/qalc.cc:2041 msgid "Factorizes the current result." msgstr "因式分解当前结果。" #: ../src/qalc.cc:2045 msgid "Simplifies the current result." msgstr "化简当前结果。" #: ../src/qalc.cc:2055 msgid "Sets the value of an option." msgstr "设置选项的值。" #: ../src/qalc.cc:2057 msgid "Available options and accepted values are:" msgstr "可用的选项以及相应的值有:" #: ../src/qalc.cc:2188 msgid "days" msgstr "" #: ../src/qalc.cc:2192 msgid "The current value is marked with '*'." msgstr "" #: ../src/qalc.cc:2194 msgid "Example: set base 16." msgstr "例: set base 16." #: ../src/qalc.cc:2196 msgid "Some options have additional help text (e.g. help parsing mode)." msgstr "" #: ../src/qalc.cc:2200 msgid "Set default assumptions for unknown variables." msgstr "设置关于未知数的缺省假设。" #: ../src/qalc.cc:2233 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:2234 msgid "" "If name equals \"mode\" or \"definitions\", the current mode and " "definitions, respectively, will be saved." msgstr "如果名称等于\"mode\"或\"definitions\",将保存当前模式或定义。" #: ../src/qalc.cc:2236 msgid "Example: store var1." msgstr "例如: store var1." #: ../src/qalc.cc:2240 #, fuzzy msgid "Removes the user-defined variable with the specified name." msgstr "找不到指定名称的函数、变量或单位。" #: ../src/qalc.cc:2242 #, fuzzy msgid "Example: delete var1." msgstr "例如: store var1." #: ../src/qalc.cc:2246 msgid "Displays the current mode." msgstr "显示当前模式。" #: ../src/qalc.cc:2250 #, fuzzy msgid "Displays a list of all user-defined variables, functions and units." msgstr "\"%s\"不是合法的变量/函数/单位。" #: ../src/qalc.cc:2251 msgid "" "Enter with argument 'functions', 'variables' or 'units' to show a list of " "all functions, variables or units." msgstr "" #: ../src/qalc.cc:2253 #, fuzzy msgid "Example: list functions." msgstr "例如: info sin." #: ../src/qalc.cc:2257 msgid "Displays information about a function, variable or unit." msgstr "显示关于函数,变量或单位的信息。" #: ../src/qalc.cc:2259 msgid "Example: info sin." msgstr "例如: info sin." #: ../src/qalc.cc:2263 msgid "Downloads current exchange rates from the Internet." msgstr "从因特网上下载最新汇率。" #: ../src/qalc.cc:2267 msgid "(De)activates the Reverse Polish Notation mode." msgstr "切换逆波兰范式模式。" #: ../src/qalc.cc:2271 msgid "Clears the RPN stack." msgstr "清空逆波兰范式(RPN)栈" #: ../src/qalc.cc:2275 msgid "Displays the RPN stack." msgstr "显示逆波兰范式(RPN)栈" #: ../src/qalc.cc:2279 #, fuzzy msgid "Sets the result number base (equivalent to set base)." msgstr "设置结果base(相当于set base)" #: ../src/qalc.cc:2283 msgid "Equivalent to set approximation exact." msgstr "相当于set approximation exact" #: ../src/qalc.cc:2287 msgid "Equivalent to set approximation try exact." msgstr "相当于set approximation try exact." #: ../src/qalc.cc:2291 #, fuzzy msgid "Converts units or changes number base in current result." msgstr "为当前结果换算单位" #: ../src/qalc.cc:2293 #, fuzzy msgid "Possible values:" msgstr "可用的单位值有:" #: ../src/qalc.cc:2295 msgid "a unit (e.g. meter, prepend with ? to request the optimal prefix)" msgstr "" #: ../src/qalc.cc:2296 #, fuzzy msgid "a unit expression (e.g. km/h)" msgstr "一个单位表达式 (例如 km/h)" #: ../src/qalc.cc:2297 msgid "base (convert to base units)" msgstr "base (转换为基准单位)" #: ../src/qalc.cc:2298 #, fuzzy msgid "optimal (convert to optimal unit)" msgstr "base (转换为基准单位)" #: ../src/qalc.cc:2300 msgid "bin / binary (show as binary number)" msgstr "" #: ../src/qalc.cc:2301 msgid "oct / octal (show as octal number)" msgstr "" #: ../src/qalc.cc:2302 msgid "hex / hexadecimal (show as hexadecimal number)" msgstr "" #: ../src/qalc.cc:2303 msgid "bases (show as binary, octal, decimal and hexadecimal number)" msgstr "" #: ../src/qalc.cc:2305 msgid "fraction (show result in combined fractional format)" msgstr "" #: ../src/qalc.cc:2306 #, fuzzy msgid "factors (factorize result)" msgstr "因式分解当前结果。" #: ../src/qalc.cc:2308 #, fuzzy msgid "Example: to ?g" msgstr "例如: store var1." #: ../src/qalc.cc:2311 msgid "" "This command can also be typed directly at the end of the mathematical " "expression." msgstr "" #: ../src/qalc.cc:2316 msgid "Terminates this program." msgstr "结束此程序。" #: ../src/qalc.cc:2321 msgid "" "Implicit multiplication does not differ from explicit multiplication " "(\"12/2(1+2) = 12/2*3 = 18\", \"5x/5y = 5*x/5*y = xy\")." msgstr "" #: ../src/qalc.cc:2324 msgid "" "Implicit multiplication is parsed before explicit multiplication " "(\"12/2(1+2) = 12/(2*3) = 2\", \"5x/5y = (5*x)/(5*y) = x/y\")." msgstr "" #: ../src/qalc.cc:2327 msgid "" "The default adaptive mode works as the \"implicit first\" mode, unless " "spaces are found (\"1/5x = 1/(5*x)\", but \"1/5 x = (1/5)*x\"). In the " "adaptive mode unit expressions are parsed separately (\"5 m/5 m/s = (5*m)/" "(5*(m/s)) = 1 s\")." msgstr "" #: ../src/qalc.cc:2329 msgid "" "Function arguments without parentheses are an exception, where implicit " "multiplication in front of variables and units is parsed first regardless of " "mode (\"sqrt 2x = sqrt(2x)\")." msgstr "" #: ../src/qalc.cc:2380 msgid "error" msgstr "错误" #: ../src/qalc.cc:2382 msgid "warning" msgstr "警告" #: ../src/qalc.cc:2437 ../libqalculate/Calculator.cc:8740 #: ../libqalculate/MathStructure.cc:483 ../libqalculate/MathStructure.cc:730 msgid "aborted" msgstr "已终止" #: ../src/qalc.cc:2468 msgid "RPN Register Moved" msgstr "逆波兰范式寄存器已被移动" #: ../src/qalc.cc:2508 msgid "Processing (press Enter to abort)" msgstr "正在处理(按回车键终止)" #: ../src/qalc.cc:2581 ../src/qalc.cc:3071 msgid "approx." msgstr "约" #: ../src/qalc.cc:2693 msgid "Factorizing (press Enter to abort)" msgstr "正在分解因式(按回车键终止)" #: ../src/qalc.cc:2697 msgid "Simplifying (press Enter to abort)" msgstr "正在化简(按回车键终止)" #: ../src/qalc.cc:2958 msgid "Calculating (press Enter to abort)" msgstr "正在计算(按回车键终止)" #: ../src/qalc.cc:3031 msgid "RPN Operation" msgstr "(RPN)逆波兰范式操作" #: ../src/qalc.cc:3414 #, c-format msgid "" "Couldn't write preferences to\n" "%s" msgstr "" "无法将偏好设置写入\n" "%s" #: ../src/qalc.cc:3492 msgid "Couldn't write definitions" msgstr "无法写定义" #: ../libqalculate/BuiltinFunctions.cc:59 #, c-format msgid "Too many elements (%s) for the dimensions (%sx%s) of the matrix." msgstr "%s个元素对于%s X %s的矩阵而言太多。" #: ../libqalculate/BuiltinFunctions.cc:121 #: ../libqalculate/BuiltinFunctions.cc:181 #, c-format msgid "Row %s does not exist in matrix." msgstr "在矩阵中不存在行%s。" #: ../libqalculate/BuiltinFunctions.cc:134 #: ../libqalculate/BuiltinFunctions.cc:177 #, c-format msgid "Column %s does not exist in matrix." msgstr "在矩阵中不存在列%s。" #: ../libqalculate/BuiltinFunctions.cc:192 #, c-format msgid "Argument 3, %s, is ignored for vectors." msgstr "已为向量忽略了参数3, %s。" #: ../libqalculate/BuiltinFunctions.cc:196 #: ../libqalculate/BuiltinFunctions.cc:217 #, c-format msgid "Element %s does not exist in vector." msgstr "在向量中不存在元素%s。" #: ../libqalculate/BuiltinFunctions.cc:405 #, c-format msgid "%s() does at the moment only support integers and fractions of two." msgstr "%s目前只支持整数和2的分数。" #: ../libqalculate/BuiltinFunctions.cc:1243 #, c-format msgid "Argument for %s() must be a real number greater than or equal to -1/e." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:2113 #: ../libqalculate/BuiltinFunctions.cc:2156 #, c-format msgid "Unsolvable comparison in %s()." msgstr "在%s()中无法进行比较。" #: ../libqalculate/BuiltinFunctions.cc:2274 ../libqalculate/util.cc:52 msgid "now" msgstr "now" #: ../libqalculate/BuiltinFunctions.cc:2286 #, c-format msgid "The timestamp value for the date %s is too large or small for %s()." msgstr "对于函数%s而言,时间戳%s的值太大或太小。" #: ../libqalculate/BuiltinFunctions.cc:2319 #: ../libqalculate/BuiltinFunctions.cc:2332 #: ../libqalculate/BuiltinFunctions.cc:2345 #: ../libqalculate/BuiltinFunctions.cc:2367 #: ../libqalculate/BuiltinFunctions.cc:2388 #, c-format msgid "Error in date format for function %s()." msgstr "函数%s()的日期格式错误。" #: ../libqalculate/BuiltinFunctions.cc:2642 msgid "" "The number of requested elements in generate vector function must be a " "positive integer." msgstr "在常规向量函数中,需求的元素个数必须为正整数。" #: ../libqalculate/BuiltinFunctions.cc:2937 #: ../libqalculate/BuiltinFunctions.cc:2954 msgid "Comparison failed." msgstr "比较失败。" #: ../libqalculate/BuiltinFunctions.cc:2942 #: ../libqalculate/BuiltinFunctions.cc:2972 msgid "No matching item found." msgstr "未能找到匹配项。" #: ../libqalculate/BuiltinFunctions.cc:3054 #, c-format msgid "Object %s does not exist." msgstr "对象%s不存在。" #: ../libqalculate/BuiltinFunctions.cc:3081 #, c-format msgid "Register %s does not exist. Returning zero." msgstr "寄存器%s不存在。返回零。" #: ../libqalculate/BuiltinFunctions.cc:3124 #, c-format msgid "" "The %s function is incomplete, unreliable and unstable. Use at your own risk " "and avoid complex expressions." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:3135 #: ../libqalculate/BuiltinFunctions.cc:3146 #, fuzzy msgid "Unable to integrate the expression." msgstr "无法分离%s。" #: ../libqalculate/BuiltinFunctions.cc:3141 msgid "" "Both the lower and upper limit must be set to get the definite integral." msgstr "必须同时设置积分上下限,才能获得定积分。" #: ../libqalculate/BuiltinFunctions.cc:3282 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:3329 #, c-format msgid "The comparison is true for all %s (with current assumptions)." msgstr "此比较对所有%s为真。 (按照目前的假设)" #: ../libqalculate/BuiltinFunctions.cc:3333 msgid "No possible solution was found (with current assumptions)." msgstr "未找到可行解。 (按照目前的假设)" #: ../libqalculate/BuiltinFunctions.cc:3337 #, c-format msgid "Was unable to completely isolate %s." msgstr "无法完成分离%s/" #: ../libqalculate/BuiltinFunctions.cc:3341 #: ../libqalculate/BuiltinFunctions.cc:3469 #: ../libqalculate/BuiltinFunctions.cc:3564 #, c-format msgid "The comparison is true for all %s if %s." msgstr "此比较对所有%s为真,如果%s。" #: ../libqalculate/BuiltinFunctions.cc:3345 #, c-format msgid "Was unable to isolate %s." msgstr "无法分离%s。" #: ../libqalculate/BuiltinFunctions.cc:3428 #: ../libqalculate/BuiltinFunctions.cc:3455 #: ../libqalculate/BuiltinFunctions.cc:3538 #, 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:3431 #: ../libqalculate/BuiltinFunctions.cc:3458 #: ../libqalculate/BuiltinFunctions.cc:3541 #, 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:3464 #: ../libqalculate/BuiltinFunctions.cc:3549 #, c-format msgid "The solution requires that %s." msgstr "解需要%s。" #: ../libqalculate/BuiltinFunctions.cc:3557 #, c-format msgid "Solution %s requires that %s." msgstr "解%s需要%s。" #: ../libqalculate/BuiltinFunctions.cc:3625 #, fuzzy, c-format msgid "" "Unable to isolate %s.\n" "\n" "You might need to place the equations and variables in an appropriate order " "so that each equation at least contains the corresponding variable (if " "automatic reordering failed)." msgstr "" "无法分离%s。\n" "\n" "您可能需要按照正确的顺序排列等式和变量,这样每个等式都至少包含一个对应变量。 " "(如果自动排序失败的话)。" #: ../libqalculate/BuiltinFunctions.cc:3627 #: ../libqalculate/BuiltinFunctions.cc:3641 #: ../libqalculate/BuiltinFunctions.cc:3650 #, c-format msgid "Unable to isolate %s." msgstr "无法分离%s。" #: ../libqalculate/BuiltinFunctions.cc:3634 #, c-format msgid "Inequalities is not allowed in %s()." msgstr "在%s中不允许不等式。" #: ../libqalculate/Calculator.cc:322 msgid "per" msgstr "per" #: ../libqalculate/Calculator.cc:324 msgid "times" msgstr "times" #: ../libqalculate/Calculator.cc:326 msgid "plus" msgstr "plus" #: ../libqalculate/Calculator.cc:328 msgid "minus" msgstr "minus" #: ../libqalculate/Calculator.cc:330 ../libqalculate/MathStructure.cc:11628 #: ../libqalculate/Function.cc:1146 ../libqalculate/Function.cc:1154 #: ../libqalculate/Function.cc:1563 ../libqalculate/Function.cc:1707 msgid "and" msgstr "and" #: ../libqalculate/Calculator.cc:334 ../libqalculate/DataSet.cc:1066 #: ../libqalculate/DataSet.cc:1129 ../libqalculate/MathStructure.cc:11642 #: ../libqalculate/Function.cc:2022 ../libqalculate/Function.cc:2038 msgid "or" msgstr "or" #: ../libqalculate/Calculator.cc:378 ../libqalculate/Calculator.cc:1092 #: ../libqalculate/Calculator.cc:2232 ../libqalculate/Calculator.cc:2237 #: ../libqalculate/Calculator.cc:2238 msgid " to " msgstr " to " #: ../libqalculate/Calculator.cc:445 msgid "Gradians unit is missing. Creating one for this session." msgstr "梯度单位丢失。自动为本会话创建了一个。" #: ../libqalculate/Calculator.cc:446 ../libqalculate/Calculator.cc:454 #: ../libqalculate/Calculator.cc:462 msgid "Angle/Plane Angle" msgstr "角/平面角" #: ../libqalculate/Calculator.cc:453 msgid "Radians unit is missing. Creating one for this session." msgstr "弧度单位丢失。自动为本会话创建了一个。" #: ../libqalculate/Calculator.cc:461 msgid "Degrees unit is missing. Creating one for this session." msgstr "角度单位丢失。自动为本会话创建了一个。" #: ../libqalculate/Calculator.cc:1439 ../libqalculate/Calculator.cc:8795 msgid "Currency" msgstr "货币" #: ../libqalculate/Calculator.cc:1440 ../libqalculate/Calculator.cc:1442 #: ../libqalculate/Calculator.cc:1443 #, fuzzy msgid "Temperature" msgstr "临时" #: ../libqalculate/Calculator.cc:2197 msgid "calculating..." msgstr "正在计算" #: ../libqalculate/Calculator.cc:2428 ../libqalculate/Calculator.cc:2436 msgid "" "Cannot convert to unit expression that includes degrees Celsius or " "Fahrenheit in addition to other units, prefixes or exponents." msgstr "" #: ../libqalculate/Calculator.cc:2445 ../libqalculate/Calculator.cc:2450 #: ../libqalculate/Calculator.cc:2455 msgid "Cannot convert the expression to degrees Celsius or Fahrenheit." msgstr "" #: ../libqalculate/Calculator.cc:3374 #, 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:3391 #, 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:3407 #, 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:4615 ../libqalculate/Calculator.cc:5378 #: ../libqalculate/Calculator.cc:5390 ../libqalculate/Calculator.cc:5415 #: ../libqalculate/Calculator.cc:5441 #, c-format msgid "Misplaced operator(s) \"%s\" ignored" msgstr "已忽略放错地方的运算符\"%s\"。" #: ../libqalculate/Calculator.cc:4639 ../libqalculate/Calculator.cc:5465 #, c-format msgid "Misplaced '%c' ignored" msgstr "已忽略放错地方的\"%c\"。" #: ../libqalculate/Calculator.cc:4666 ../libqalculate/Function.cc:1293 #: ../libqalculate/Function.cc:1324 #, c-format msgid "Internal id %s does not exist." msgstr "内部id %s不存在。" #: ../libqalculate/Calculator.cc:4684 #, c-format msgid "\"%s\" is not a valid variable/function/unit." msgstr "\"%s\"不是合法的变量/函数/单位。" #: ../libqalculate/Calculator.cc:4699 #, c-format msgid "" "Trailing characters \"%s\" (not a valid variable/function/unit) in number " "\"%s\" was ignored." msgstr "尾部字符\"%s\"(不是合法的变量/函数/单位) in 数字\"%s\"已被忽略。" #: ../libqalculate/Calculator.cc:5076 msgid "RPN syntax error. Values left at the end of the RPN expression." msgstr "RPN语法错误。在逆波兰表达式的最后剩下了数值。" #: ../libqalculate/Calculator.cc:5079 msgid "Unused stack values." msgstr "栈内还有值未被使用。" #: ../libqalculate/Calculator.cc:5118 ../libqalculate/Calculator.cc:5186 #, fuzzy, c-format msgid "RPN syntax error. Operator '%c' not supported." msgstr "RPN语法错误。栈内是空的。" #: ../libqalculate/Calculator.cc:5146 msgid "RPN syntax error. Stack is empty." msgstr "RPN语法错误。栈内是空的。" #: ../libqalculate/Calculator.cc:5148 msgid "RPN syntax error. Operator ignored as there where only one stack value." msgstr "RPN语法错误。栈内只有一个值,因此运算符已被忽略。" #: ../libqalculate/Calculator.cc:5664 #, c-format msgid "Name \"%s\" is in use. Replacing with \"%s\"." msgstr "名称\"%s\"已被使用。替换为\"%s\"。" #: ../libqalculate/Calculator.cc:6360 ../libqalculate/DataSet.cc:535 #, c-format msgid "File not identified as Qalculate! definitions file: %s." msgstr "指定的文件无法被Qalculate!识别! 定义文件:%s。" #: ../libqalculate/Calculator.cc:8343 ../libqalculate/DataSet.cc:353 msgid "Object" msgstr "对象" #: ../libqalculate/Calculator.cc:8352 ../libqalculate/DataSet.cc:354 msgid "Property" msgstr "属性" #: ../libqalculate/Calculator.cc:8645 msgid "column" msgstr "column" #: ../libqalculate/Calculator.cc:8648 msgid "Column " msgstr "列" #: ../libqalculate/Calculator.cc:8739 ../libqalculate/Calculator.cc:8743 msgid "timed out" msgstr "已超时" #: ../libqalculate/Calculator.cc:8901 msgid "Failed to download exchange rates from ECB." msgstr "从ECB下载汇率失败。" #: ../libqalculate/Calculator.cc:8961 ../libqalculate/Calculator.cc:8975 msgid "Unable to generate plot data with current min, max and sampling rate." msgstr "按照当前的最大、最小和采样率,无法生成绘图数据。" #: ../libqalculate/Calculator.cc:8991 ../libqalculate/Calculator.cc:9005 msgid "Unable to generate plot data with current min, max and step size." msgstr "按照当前的最大、最小和步长,无法生成绘图数据。" #: ../libqalculate/Calculator.cc:9051 msgid "No extension in file name. Saving as PNG image." msgstr "未指定文件扩展名。保存为PNG图像。" #: ../libqalculate/Calculator.cc:9068 msgid "Unknown extension in file name. Saving as PNG image." msgstr "未知的文件扩展名。保存为PNG图像。" #: ../libqalculate/Calculator.cc:9261 #, c-format msgid "Could not create temporary file %s" msgstr "无法创建临时文件%s" #: ../libqalculate/Calculator.cc:9302 msgid "It took too long to generate the plot data." msgstr "" #: ../libqalculate/Calculator.cc:9316 #, 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:9318 #, 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:9344 msgid "" "Failed to invoke gnuplot. Make sure that you have gnuplot installed in your " "path." msgstr "调用gnuplot失败。请确认在您的路径中包含gnuplot。" #: ../libqalculate/DataSet.cc:379 #, c-format msgid "Object %s not available in data set." msgstr "数据集中没有对象%s。" #: ../libqalculate/DataSet.cc:389 #, c-format msgid "Property %s not available in data set." msgstr "数据集中没有属性%s。" #: ../libqalculate/DataSet.cc:394 #, c-format msgid "Property %s not defined for object %s." msgstr "属性%s在对象%s中没有定义。" #: ../libqalculate/DataSet.cc:513 ../libqalculate/DataSet.cc:521 #, c-format msgid "Unable to load data objects in %s." msgstr "无法从%s中载入数据。" #: ../libqalculate/DataSet.cc:1036 msgid "data property" msgstr "data property" #: ../libqalculate/DataSet.cc:1038 msgid "name of a data property" msgstr "数据属性的名称" #: ../libqalculate/DataSet.cc:1046 ../libqalculate/DataSet.cc:1062 msgid "no properties available" msgstr "没有可用的属性" #: ../libqalculate/DataSet.cc:1096 #, c-format msgid "" "Data set \"%s\" has no object key that supports the provided argument type." msgstr "数据集\"%s\"中没有支持所提供的参数类型的对象关键字。" #: ../libqalculate/DataSet.cc:1101 msgid "data object" msgstr "data object" #: ../libqalculate/DataSet.cc:1103 msgid "an object from" msgstr "来自于...的对象" #: ../libqalculate/DataSet.cc:1132 msgid "use" msgstr "use" #: ../libqalculate/MathStructure.cc:94 ../libqalculate/MathStructure.cc:115 #: ../libqalculate/MathStructure.cc:145 #, c-format msgid "To avoid division by zero, the following must be true: %s." msgstr "为了避免被零,必须满足:%s。" #: ../libqalculate/MathStructure.cc:2614 #, 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:5241 ../libqalculate/MathStructure.cc:5282 #: ../libqalculate/MathStructure.cc:5315 ../libqalculate/MathStructure.cc:5371 #: ../libqalculate/MathStructure.cc:5391 ../libqalculate/MathStructure.cc:5410 #: ../libqalculate/MathStructure.cc:5429 ../libqalculate/MathStructure.cc:5448 #: ../libqalculate/MathStructure.cc:5539 ../libqalculate/MathStructure.cc:8792 #: ../libqalculate/MathStructure.cc:8803 ../libqalculate/MathStructure.cc:8880 msgid "This is a bug. Please report it." msgstr "这是个bug。请想我们报告它。" #: ../libqalculate/MathStructure.cc:11722 msgid "undefined" msgstr "undefined" #: ../libqalculate/MathStructure.cc:11772 #, c-format msgid "Unsolvable comparison at element %s when trying to rank vector." msgstr "" #: ../libqalculate/MathStructure.cc:11820 #, c-format msgid "Unsolvable comparison at element %s when trying to sort vector." msgstr "试图为向量排序,但无法比较元素%s。" #: ../libqalculate/MathStructure.cc:12245 msgid "The determinant can only be calculated for square matrices." msgstr "只能为方阵计算行列式" #: ../libqalculate/MathStructure.cc:12308 msgid "The permanent can only be calculated for square matrices." msgstr "只能为方阵计算不变积和式" #: ../libqalculate/MathStructure.cc:12397 msgid "Inverse of singular matrix." msgstr "奇异矩阵的逆。" #: ../libqalculate/Function.cc:153 #, c-format msgid "%s() requires that %s" msgstr "%s()需要%s。" #: ../libqalculate/Function.cc:306 ../libqalculate/Function.cc:363 #: ../libqalculate/Function.cc:422 #, c-format msgid "" "Additional arguments for function %s() was ignored. Function can only use %s " "argument(s)." msgstr "已忽略函数%s的多余参数。它只需要%s个参数。" #: ../libqalculate/Function.cc:443 #, c-format msgid "You need at least %s argument(s) (%s) in function %s()." msgstr "你需要至少%s个参数(%s)提供给函数%s()" #: ../libqalculate/Function.cc:445 #, c-format msgid "You need at least %s argument(s) in function %s()." msgstr "你需要至少%s个参数提供给函数%s()" #: ../libqalculate/Function.cc:1136 msgid "a free value" msgstr "一个自由量" #: ../libqalculate/Function.cc:1141 msgid "that is nonzero" msgstr "非零" #: ../libqalculate/Function.cc:1149 msgid "that is rational (polynomial)" msgstr "合理的(多项式的)" #: ../libqalculate/Function.cc:1157 msgid "that fulfills the condition:" msgstr "满足下列条件:" #: ../libqalculate/Function.cc:1160 msgid "Argument" msgstr "自变量" #: ../libqalculate/Function.cc:1215 #, c-format msgid "Argument %s in %s() must be %s." msgstr "参数%s, 在%s()中必须为%s。" #: ../libqalculate/Function.cc:1217 #, c-format msgid "Argument %s, %s, in %s() must be %s." msgstr "参数%s,%s, 在%s()中必须为%s。" #: ../libqalculate/Function.cc:1544 msgid "a rational number" msgstr "一个有理数" #: ../libqalculate/Function.cc:1546 msgid "a number" msgstr "一个数" #: ../libqalculate/Function.cc:1548 msgid "a real number" msgstr "一个实数" #: ../libqalculate/Function.cc:1553 ../libqalculate/Function.cc:1700 msgid ">=" msgstr ">=" #: ../libqalculate/Function.cc:1555 msgid ">" msgstr ">" #: ../libqalculate/Function.cc:1567 ../libqalculate/Function.cc:1710 msgid "<=" msgstr "<=" #: ../libqalculate/Function.cc:1569 msgid "<" msgstr "<" #: ../libqalculate/Function.cc:1697 msgid "an integer" msgstr "一个整数" #: ../libqalculate/Function.cc:1728 msgid "symbol" msgstr "symbol" #: ../libqalculate/Function.cc:1729 msgid "an unknown variable/symbol" msgstr "一个未知变量或符号" #: ../libqalculate/Function.cc:1742 msgid "text" msgstr "text" #: ../libqalculate/Function.cc:1743 msgid "a text string" msgstr "一段文字" #: ../libqalculate/Function.cc:1758 msgid "date" msgstr "date" #: ../libqalculate/Function.cc:1759 msgid "a date" msgstr "一个日期" #: ../libqalculate/Function.cc:1805 msgid "a vector with " msgstr "一个向量with" #: ../libqalculate/Function.cc:1817 msgid "a vector" msgstr "一个向量" #: ../libqalculate/Function.cc:1866 msgid "a square matrix" msgstr "一个方阵" #: ../libqalculate/Function.cc:1868 msgid "a matrix" msgstr "一个矩阵" #: ../libqalculate/Function.cc:1883 msgid "object" msgstr "object" #: ../libqalculate/Function.cc:1884 msgid "a valid function, unit or variable name" msgstr "一个合法的函数、单位或函数名" #: ../libqalculate/Function.cc:1897 msgid "function" msgstr "function" #: ../libqalculate/Function.cc:1898 msgid "a valid function name" msgstr "一个合法的函数名" #: ../libqalculate/Function.cc:1911 msgid "unit" msgstr "unit" #: ../libqalculate/Function.cc:1912 msgid "a valid unit name" msgstr "一个合法的单位名" #: ../libqalculate/Function.cc:1925 msgid "variable" msgstr "variable" #: ../libqalculate/Function.cc:1926 msgid "a valid variable name" msgstr "一个合法的变量名" #: ../libqalculate/Function.cc:1939 msgid "file" msgstr "file" #: ../libqalculate/Function.cc:1940 msgid "a valid file name" msgstr "一个合法的文件名" #: ../libqalculate/Function.cc:1953 msgid "boolean" msgstr "boolean" #: ../libqalculate/Function.cc:1954 msgid "a boolean (0 or 1)" msgstr "一个逻辑量(0或者1)" #: ../libqalculate/Function.cc:1964 msgid "angle" msgstr "angle" #: ../libqalculate/Function.cc:1965 msgid "an angle or a number (using the default angle unit)" msgstr "一个角度或者数字(使用缺省角度单位)" #: ../libqalculate/Number.cc:91 ../libqalculate/Number.cc:197 #: ../libqalculate/Number.cc:219 ../libqalculate/Number.cc:521 #: ../libqalculate/Number.cc:689 ../libqalculate/Number.cc:808 #: ../libqalculate/Number.cc:818 ../libqalculate/Number.cc:828 #: ../libqalculate/Number.cc:838 ../libqalculate/Number.cc:847 #: ../libqalculate/Number.cc:860 ../libqalculate/Number.cc:873 #: ../libqalculate/Number.cc:883 ../libqalculate/Number.cc:895 #: ../libqalculate/Number.cc:905 ../libqalculate/Number.cc:944 #: ../libqalculate/Number.cc:951 ../libqalculate/Number.cc:997 #: ../libqalculate/Number.cc:1015 ../libqalculate/Number.cc:1029 #: ../libqalculate/Number.cc:1076 ../libqalculate/Number.cc:1261 #: ../libqalculate/Number.cc:1417 ../libqalculate/Number.cc:1463 #: ../libqalculate/Number.cc:1515 ../libqalculate/Number.cc:1560 #: ../libqalculate/Number.cc:1583 ../libqalculate/Number.cc:1661 #: ../libqalculate/Number.cc:1668 ../libqalculate/Number.cc:1676 #: ../libqalculate/Number.cc:1746 ../libqalculate/Number.cc:1763 #: ../libqalculate/Number.cc:1775 ../libqalculate/Number.cc:1798 #: ../libqalculate/Number.cc:1808 ../libqalculate/Number.cc:1828 #: ../libqalculate/Number.cc:1841 ../libqalculate/Number.cc:1854 #: ../libqalculate/Number.cc:1870 ../libqalculate/Number.cc:1887 #: ../libqalculate/Number.cc:1904 ../libqalculate/Number.cc:1921 #: ../libqalculate/Number.cc:1935 ../libqalculate/Number.cc:1949 #: ../libqalculate/Number.cc:1962 ../libqalculate/Number.cc:1977 #: ../libqalculate/Number.cc:1991 ../libqalculate/Number.cc:2005 #: ../libqalculate/Number.cc:2016 ../libqalculate/Number.cc:2030 #: ../libqalculate/Number.cc:2042 ../libqalculate/Number.cc:2107 #: ../libqalculate/Number.cc:2121 ../libqalculate/Number.cc:2137 #: ../libqalculate/Number.cc:2153 ../libqalculate/Number.cc:2169 #: ../libqalculate/Number.cc:2188 ../libqalculate/Number.cc:2207 #: ../libqalculate/Number.cc:2230 ../libqalculate/Number.cc:2246 #: ../libqalculate/Number.cc:2262 ../libqalculate/Number.cc:2284 #: ../libqalculate/Number.cc:2302 ../libqalculate/Number.cc:2326 #: ../libqalculate/Number.cc:2350 ../libqalculate/Number.cc:2389 #: ../libqalculate/Number.cc:2396 ../libqalculate/Number.cc:2418 #: ../libqalculate/Number.cc:2445 ../libqalculate/Number.cc:2453 #: ../libqalculate/Number.cc:2467 ../libqalculate/Number.cc:2493 #: ../libqalculate/Number.cc:2506 ../libqalculate/Number.cc:2539 #: ../libqalculate/Number.cc:2568 ../libqalculate/Number.cc:2595 #: ../libqalculate/Number.cc:2623 ../libqalculate/Number.cc:2638 #: ../libqalculate/Number.cc:2648 ../libqalculate/Number.cc:2666 #: ../libqalculate/Number.cc:2684 ../libqalculate/Number.cc:2690 #: ../libqalculate/Number.cc:2709 ../libqalculate/Number.cc:2716 #: ../libqalculate/Number.cc:3077 ../libqalculate/Number.cc:3113 #: ../libqalculate/Number.cc:3149 ../libqalculate/Number.cc:3258 #: ../libqalculate/Number.cc:3268 ../libqalculate/Number.cc:3274 #: ../libqalculate/Number.cc:3280 ../libqalculate/Number.cc:3286 #: ../libqalculate/Number.cc:3362 ../libqalculate/Number.cc:3386 #: ../libqalculate/Number.cc:3422 #, c-format msgid "CLN Exception: %s" msgstr "" #: ../libqalculate/Number.cc:174 msgid "" "Cannot display numbers greater than 9999 or less than -9999 as roman " "numerals." msgstr "无法显示大于9999或小于-9999的罗马数字。" #: ../libqalculate/Number.cc:268 msgid "" "Assuming the unusual practice of letting a last capital I mean 2 in a roman " "numeral." msgstr "假设一种不常见的情况:在罗马数字中,最后一个大写的\"I\"表示2。" #: ../libqalculate/Number.cc:346 #, c-format msgid "Error in roman numerals: %s." msgstr "在罗马数字中有错:\"%s\"" #: ../libqalculate/Number.cc:381 #, c-format msgid "Unknown roman numeral: %c." msgstr "不认识的罗马数字:\"%c\"" #: ../libqalculate/Number.cc:439 #, c-format msgid "" "Errors in roman numerals: \"%s\". Interpreted as %s, which should be written " "as %s." msgstr "罗马数字中有错误:\"%s\"。已被翻译成\"%s\",它正确的写法是\"%s\"。" #: ../libqalculate/Number.cc:528 msgid "':' in decimal number ignored (decimal point detected)." msgstr "十进制数中的\":\"被忽略。(已发现小数点)" #: ../libqalculate/Number.cc:584 #, c-format msgid "Character '%c' was ignored in the number \"%s\" with base %s." msgstr "字符\"%c\"被忽略,在数字\"%s\"中,其base为\"%s\"。" #: ../libqalculate/Number.cc:1633 msgid "Division by zero." msgstr "被零除。" #. 0^0 #: ../libqalculate/Number.cc:1639 msgid "0^0 might be considered undefined" msgstr "0^0将被当成未定义量处理" #: ../libqalculate/Number.cc:1644 msgid "The result of 0^i is possibly undefined" msgstr "" #: ../libqalculate/Number.cc:2094 msgid "Can only handle Riemann Zeta with an integer argument (s) >= 1" msgstr "只能处理参数为大于等于1的正整数的黎曼Zeta函数" #: ../libqalculate/Number.cc:2100 msgid "Cannot handle an argument (s) that large for Riemann Zeta." msgstr "无法处理对于黎曼Zeta函数来说太大的参数" #: ../libqalculate/Number.cc:3231 ../libqalculate/Number.cc:3239 #: ../libqalculate/Number.cc:3248 msgid "infinity" msgstr "infinity" #: ../libqalculate/Unit.cc:850 msgid "Error(s) in unitexpression." msgstr "单位表达式里有错。" #. 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); #: ../libqalculate/util.cc:52 msgid "today" msgstr "today" #: ../libqalculate/util.cc:55 msgid "tomorrow" msgstr "" #: ../libqalculate/util.cc:59 msgid "yesterday" msgstr "" #: ../libqalculate/util.cc:535 msgid "Yes" msgstr "Yes" #: ../libqalculate/util.cc:536 msgid "No" msgstr "No" #: ../libqalculate/util.cc:543 msgid "True" msgstr "True" #: ../libqalculate/util.cc:544 msgid "False" msgstr "False" #: ../libqalculate/util.cc:551 msgid "On" msgstr "On" #: ../libqalculate/util.cc:552 msgid "Off" msgstr "Off" #~ msgid "UNIT" #~ msgstr "单位" #~ msgid "a unit (example meter)" #~ msgstr "一个单位(例如: 米)" #~ msgid "best (convert best unit)" #~ msgstr "best (转换为最佳单位)" #~ msgid "Example: convert best." #~ msgstr "例:convert best" #~ msgid "Decimal point in sexagesimal number treated as ':'." #~ msgstr "六十进制数中的小数点被处理为\":\"" libqalculate-0.9.10/po/nl.po0000644000175000017500000020106112744163153012561 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. # # Hanna 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: 2016-07-21 17:12+0200\n" "PO-Revision-Date: 2007-05-18 16:19+0200\n" "Last-Translator: Jaap Woldringh \n" "Language-Team: \n" "Language: \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:102 ../src/qalc.cc:152 ../src/qalc.cc:2051 #: ../libqalculate/util.cc:538 msgid "yes" msgstr "ja" #: ../src/qalc.cc:103 ../src/qalc.cc:154 ../src/qalc.cc:2051 #: ../libqalculate/util.cc:539 msgid "no" msgstr "nee" #: ../src/qalc.cc:104 ../libqalculate/util.cc:546 msgid "true" msgstr "waar" #: ../src/qalc.cc:105 ../libqalculate/util.cc:547 msgid "false" msgstr "onwaar" #: ../src/qalc.cc:106 ../src/qalc.cc:671 ../src/qalc.cc:686 ../src/qalc.cc:1608 #: ../src/qalc.cc:2050 ../src/qalc.cc:2135 ../libqalculate/util.cc:554 msgid "on" msgstr "aan" #: ../src/qalc.cc:107 ../src/qalc.cc:618 ../src/qalc.cc:644 ../src/qalc.cc:656 #: ../src/qalc.cc:669 ../src/qalc.cc:684 ../src/qalc.cc:1596 #: ../src/qalc.cc:1606 ../src/qalc.cc:1628 ../src/qalc.cc:1635 #: ../src/qalc.cc:1657 ../src/qalc.cc:2050 ../src/qalc.cc:2122 #: ../src/qalc.cc:2135 ../src/qalc.cc:2155 ../src/qalc.cc:2160 #: ../src/qalc.cc:2170 ../libqalculate/util.cc:555 msgid "off" msgstr "uit" #: ../src/qalc.cc:159 msgid "Please answer yes or no" msgstr "Antwoord alstublieft met ja of nee" #: ../src/qalc.cc:166 ../src/qalc.cc:788 ../src/qalc.cc:1557 #: ../src/qalc.cc:2012 ../src/qalc.cc:2068 ../src/qalc.cc:2080 #: ../src/qalc.cc:2202 ../src/qalc.cc:2214 msgid "unknown" msgstr "onbekend" #: ../src/qalc.cc:172 ../src/qalc.cc:450 ../src/qalc.cc:481 ../src/qalc.cc:559 #: ../src/qalc.cc:574 ../src/qalc.cc:1515 ../src/qalc.cc:1526 #: ../src/qalc.cc:1561 ../src/qalc.cc:1576 ../src/qalc.cc:2060 #: ../src/qalc.cc:2062 ../src/qalc.cc:2095 ../src/qalc.cc:2113 msgid "none" msgstr "geen" #: ../src/qalc.cc:174 ../src/qalc.cc:785 ../src/qalc.cc:1554 #: ../src/qalc.cc:2009 ../src/qalc.cc:2082 ../src/qalc.cc:2216 msgid "non-matrix" msgstr "niet-matrix" #: ../src/qalc.cc:176 ../src/qalc.cc:783 ../src/qalc.cc:1552 #: ../src/qalc.cc:2007 ../src/qalc.cc:2086 ../src/qalc.cc:2220 msgid "complex" msgstr "complex" #: ../src/qalc.cc:178 ../src/qalc.cc:782 ../src/qalc.cc:1551 #: ../src/qalc.cc:2006 ../src/qalc.cc:2088 ../src/qalc.cc:2222 msgid "real" msgstr "reëel" #: ../src/qalc.cc:180 ../src/qalc.cc:784 ../src/qalc.cc:1553 #: ../src/qalc.cc:2008 ../src/qalc.cc:2084 ../src/qalc.cc:2218 #: ../libqalculate/Function.cc:1539 msgid "number" msgstr "getal" #: ../src/qalc.cc:182 ../src/qalc.cc:781 ../src/qalc.cc:1550 #: ../src/qalc.cc:2005 ../src/qalc.cc:2090 ../src/qalc.cc:2224 msgid "rational" msgstr "rationaal" #: ../src/qalc.cc:184 ../src/qalc.cc:780 ../src/qalc.cc:1549 #: ../src/qalc.cc:2004 ../src/qalc.cc:2092 ../src/qalc.cc:2226 #: ../libqalculate/Function.cc:1694 msgid "integer" msgstr "geheel" #: ../src/qalc.cc:186 ../src/qalc.cc:775 ../src/qalc.cc:1544 #: ../src/qalc.cc:1999 ../src/qalc.cc:2070 ../src/qalc.cc:2204 msgid "non-zero" msgstr "ongelijk nul" #: ../src/qalc.cc:188 ../src/qalc.cc:771 ../src/qalc.cc:1540 #: ../src/qalc.cc:1995 ../src/qalc.cc:2072 ../src/qalc.cc:2206 msgid "positive" msgstr "positief" #: ../src/qalc.cc:190 ../src/qalc.cc:774 ../src/qalc.cc:1543 #: ../src/qalc.cc:1998 ../src/qalc.cc:2078 ../src/qalc.cc:2212 msgid "non-negative" msgstr "niet-negatief" #: ../src/qalc.cc:192 msgid "negatve" msgstr "negatief" #: ../src/qalc.cc:194 ../src/qalc.cc:772 ../src/qalc.cc:1541 #: ../src/qalc.cc:1996 ../src/qalc.cc:2076 ../src/qalc.cc:2210 msgid "non-positive" msgstr "niet-positief" #: ../src/qalc.cc:197 msgid "Unrecognized assumption." msgstr "Onbekende aanname." #: ../src/qalc.cc:336 ../libqalculate/Calculator.cc:8910 #, fuzzy, c-format msgid "It has been %s day(s) since the exchange rates last were updated." msgstr "" "Het is al meer dan een week geleden dat de wisselkoersen werden ververst." #: ../src/qalc.cc:341 msgid "Do you wish to update the exchange rates now?" msgstr "" #: ../src/qalc.cc:354 ../src/qalc.cc:355 msgid "" "\n" "Press Enter to continue." msgstr "" "\n" "Druk op Enter om verder te gaan." #: ../src/qalc.cc:363 ../src/qalc.cc:364 ../src/qalc.cc:365 ../src/qalc.cc:465 #: ../src/qalc.cc:468 ../src/qalc.cc:590 ../src/qalc.cc:601 ../src/qalc.cc:610 msgid "Illegal value" msgstr "waarde niet toegestaan" #. qalc command #: ../src/qalc.cc:379 ../src/qalc.cc:562 ../src/qalc.cc:1378 #: ../src/qalc.cc:1488 ../src/qalc.cc:1563 ../src/qalc.cc:1566 #: ../src/qalc.cc:1696 ../src/qalc.cc:2095 ../src/qalc.cc:2096 #: ../src/qalc.cc:2277 ../src/qalc.cc:2817 msgid "base" msgstr "grondtal" #: ../src/qalc.cc:379 ../src/qalc.cc:381 ../src/qalc.cc:1613 #: ../src/qalc.cc:2137 msgid "input base" msgstr "Voer grondtal in" #: ../src/qalc.cc:379 msgid "output base" msgstr "Voer grondtal uit" #: ../src/qalc.cc:382 ../src/qalc.cc:1568 ../src/qalc.cc:1615 #: ../src/qalc.cc:2108 ../src/qalc.cc:2145 msgid "roman" msgstr "Romeins" #: ../src/qalc.cc:383 ../src/qalc.cc:1570 ../src/qalc.cc:2106 msgid "time" msgstr "tijd" #: ../src/qalc.cc:384 ../src/qalc.cc:2102 ../src/qalc.cc:2143 msgid "hex" msgstr "hex" #: ../src/qalc.cc:384 ../src/qalc.cc:1426 ../src/qalc.cc:2772 msgid "hexadecimal" msgstr "hexadecimaal" #: ../src/qalc.cc:385 ../src/qalc.cc:2096 ../src/qalc.cc:2137 msgid "bin" msgstr "bin" #: ../src/qalc.cc:385 ../src/qalc.cc:1431 ../src/qalc.cc:2781 msgid "binary" msgstr "binair" #: ../src/qalc.cc:386 ../src/qalc.cc:2098 ../src/qalc.cc:2139 msgid "oct" msgstr "oct" #: ../src/qalc.cc:386 ../src/qalc.cc:1436 ../src/qalc.cc:2790 msgid "octal" msgstr "octaal" #: ../src/qalc.cc:387 ../src/qalc.cc:2100 ../src/qalc.cc:2141 msgid "dec" msgstr "dec" #: ../src/qalc.cc:387 msgid "decimal" msgstr "decimaal" #: ../src/qalc.cc:388 ../src/qalc.cc:2104 msgid "sex" msgstr "sex" #: ../src/qalc.cc:388 ../src/qalc.cc:1569 msgid "sexagesimal" msgstr "sexagesimaal" #: ../src/qalc.cc:405 ../src/qalc.cc:448 ../src/qalc.cc:1574 #: ../src/qalc.cc:2113 msgid "base display" msgstr "tonen van grondtal" #: ../src/qalc.cc:410 msgid "Illegal base." msgstr "Grondtal niet toegestaan." #: ../src/qalc.cc:418 ../src/qalc.cc:1558 ../src/qalc.cc:2067 msgid "assumptions" msgstr "aannames" #: ../src/qalc.cc:428 ../src/qalc.cc:1520 ../src/qalc.cc:2061 msgid "all prefixes" msgstr "alle voorvoegsels" #: ../src/qalc.cc:429 ../src/qalc.cc:1583 ../src/qalc.cc:2116 msgid "complex numbers" msgstr "complexe getallen" #: ../src/qalc.cc:430 ../src/qalc.cc:1593 ../src/qalc.cc:2121 msgid "excessive parentheses" msgstr "te veel haakjes" #: ../src/qalc.cc:431 ../src/qalc.cc:1612 ../src/qalc.cc:1729 #: ../src/qalc.cc:2136 msgid "functions" msgstr "functies" #: ../src/qalc.cc:432 ../src/qalc.cc:1620 ../src/qalc.cc:2150 msgid "infinite numbers" msgstr "oneindige getallen" #: ../src/qalc.cc:433 ../src/qalc.cc:1668 ../src/qalc.cc:2177 msgid "show negative exponents" msgstr "toon negatieve exponenten" #: ../src/qalc.cc:434 ../src/qalc.cc:1536 ../src/qalc.cc:2064 msgid "assume nonzero denominators" msgstr "neem noemers aan ongelijk nul" #: ../src/qalc.cc:435 ../src/qalc.cc:1537 ../src/qalc.cc:2065 msgid "warn nonzero denominators" msgstr "waarschuwen noemers ongelijk nul" #: ../src/qalc.cc:436 ../src/qalc.cc:1654 ../src/qalc.cc:2169 msgid "prefixes" msgstr "voorvoegsels" #: ../src/qalc.cc:437 ../src/qalc.cc:1584 ../src/qalc.cc:2117 msgid "denominator prefixes" msgstr "voorvoegsels voor noemers" #: ../src/qalc.cc:438 ../src/qalc.cc:1652 ../src/qalc.cc:2167 msgid "place units separately" msgstr "eenheden apart plaatsen" #: ../src/qalc.cc:439 ../src/qalc.cc:1582 ../src/qalc.cc:2115 msgid "calculate variables" msgstr "variabelen berekenen" #: ../src/qalc.cc:440 ../src/qalc.cc:1581 ../src/qalc.cc:2114 msgid "calculate functions" msgstr "functies berekenen" #: ../src/qalc.cc:441 ../src/qalc.cc:1672 ../src/qalc.cc:2181 msgid "sync units" msgstr "sync eenheden" #: ../src/qalc.cc:442 ../src/qalc.cc:1662 ../src/qalc.cc:2171 msgid "round to even" msgstr "afronden naar even" #. qalc command #: ../src/qalc.cc:443 ../src/qalc.cc:1381 ../src/qalc.cc:1663 #: ../src/qalc.cc:1709 ../src/qalc.cc:2172 ../src/qalc.cc:2265 msgid "rpn" msgstr "rpn" #: ../src/qalc.cc:444 ../src/qalc.cc:1664 ../src/qalc.cc:2173 msgid "rpn syntax" msgstr "rpn-notatie" #: ../src/qalc.cc:445 ../src/qalc.cc:1669 ../src/qalc.cc:2178 msgid "short multiplication" msgstr "korte vermenigvuldiging" #: ../src/qalc.cc:446 ../src/qalc.cc:1622 ../src/qalc.cc:2153 msgid "lowercase e" msgstr "kleine letter e" #: ../src/qalc.cc:447 ../src/qalc.cc:1623 ../src/qalc.cc:2154 msgid "lowercase numbers" msgstr "onderkast getallen" #: ../src/qalc.cc:451 ../src/qalc.cc:1577 ../src/qalc.cc:2113 msgid "normal" msgstr "normaal" #: ../src/qalc.cc:452 ../src/qalc.cc:1578 ../src/qalc.cc:2113 msgid "alternative" msgstr "alternatief" #: ../src/qalc.cc:457 ../src/qalc.cc:486 ../src/qalc.cc:500 ../src/qalc.cc:524 #: ../src/qalc.cc:538 ../src/qalc.cc:552 ../src/qalc.cc:567 ../src/qalc.cc:581 #: ../src/qalc.cc:628 ../src/qalc.cc:637 ../src/qalc.cc:677 ../src/qalc.cc:691 msgid "Illegal value." msgstr "Waarde niet toegestaan." #: ../src/qalc.cc:462 ../src/qalc.cc:1671 ../src/qalc.cc:2180 msgid "spell out logical" msgstr "logische bewerking voluit spellen" #: ../src/qalc.cc:463 ../src/qalc.cc:1592 ../src/qalc.cc:2119 msgid "dot as separator" msgstr "punt als scheidingsteken" #: ../src/qalc.cc:464 ../src/qalc.cc:1621 ../src/qalc.cc:2152 msgid "limit implicit multiplication" msgstr "impliciet vermenigvuldigen beperken" #: ../src/qalc.cc:466 ../src/qalc.cc:1670 ../src/qalc.cc:2179 msgid "spacious" msgstr "ruimtelijk" #: ../src/qalc.cc:467 ../src/qalc.cc:1673 ../src/qalc.cc:2182 msgid "unicode" msgstr "unicode" #: ../src/qalc.cc:470 ../src/qalc.cc:1674 ../src/qalc.cc:1731 #: ../src/qalc.cc:2183 msgid "units" msgstr "eenheden" #: ../src/qalc.cc:471 ../src/qalc.cc:1675 ../src/qalc.cc:2184 msgid "unknowns" msgstr "onbekenden" #: ../src/qalc.cc:472 ../src/qalc.cc:1683 ../src/qalc.cc:1730 #: ../src/qalc.cc:2191 msgid "variables" msgstr "variabelen" #: ../src/qalc.cc:473 ../src/qalc.cc:1512 ../src/qalc.cc:2059 msgid "abbreviations" msgstr "afkortingen" #: ../src/qalc.cc:474 ../src/qalc.cc:1667 ../src/qalc.cc:2176 msgid "show ending zeroes" msgstr "afsluitende nullen tonen" #: ../src/qalc.cc:475 ../src/qalc.cc:1619 ../src/qalc.cc:2151 msgid "indicate infinite series" msgstr "oneindige reeksen aangeven" #: ../src/qalc.cc:476 ../src/qalc.cc:1521 ../src/qalc.cc:2062 msgid "angle unit" msgstr "hoekeenheid" #: ../src/qalc.cc:478 ../src/qalc.cc:1523 ../src/qalc.cc:1524 msgid "rad" msgstr "rad" #: ../src/qalc.cc:478 ../src/qalc.cc:2062 msgid "radians" msgstr "radialen" #: ../src/qalc.cc:479 msgid "deg" msgstr "deg" #: ../src/qalc.cc:479 ../src/qalc.cc:2062 msgid "degrees" msgstr "graden" #: ../src/qalc.cc:480 ../src/qalc.cc:1525 msgid "gra" msgstr "gra" #: ../src/qalc.cc:480 ../src/qalc.cc:2062 msgid "gradians" msgstr "grads (100 grads in rechte hoek)" #: ../src/qalc.cc:491 ../src/qalc.cc:1645 ../src/qalc.cc:2166 #: ../src/qalc.cc:2318 #, fuzzy msgid "parsing mode" msgstr "exp modus" #: ../src/qalc.cc:493 ../src/qalc.cc:1647 ../src/qalc.cc:2166 #: ../src/qalc.cc:2326 #, fuzzy msgid "adaptive" msgstr "alternatief" #: ../src/qalc.cc:494 ../src/qalc.cc:1648 ../src/qalc.cc:2166 #: ../src/qalc.cc:2323 msgid "implicit first" msgstr "" #: ../src/qalc.cc:495 ../src/qalc.cc:1649 ../src/qalc.cc:2166 #: ../src/qalc.cc:2320 #, fuzzy msgid "conventional" msgstr "optioneel" #: ../src/qalc.cc:505 ../src/qalc.cc:938 ../src/qalc.cc:1676 #: ../src/qalc.cc:2185 msgid "update exchange rates" msgstr "" #: ../src/qalc.cc:506 ../src/qalc.cc:1679 ../src/qalc.cc:2187 msgid "never" msgstr "" #: ../src/qalc.cc:508 ../src/qalc.cc:1678 ../src/qalc.cc:2186 #, fuzzy msgid "ask" msgstr "antw" #: ../src/qalc.cc:515 ../src/qalc.cc:1638 ../src/qalc.cc:2165 msgid "multiplication sign" msgstr "vermenigvuldigingsteken" #: ../src/qalc.cc:529 ../src/qalc.cc:1585 ../src/qalc.cc:2118 msgid "division sign" msgstr "teken voor delen" #: ../src/qalc.cc:543 ../src/qalc.cc:1529 ../src/qalc.cc:2063 msgid "approximation" msgstr "benadering" #. qalc command #: ../src/qalc.cc:545 ../src/qalc.cc:587 ../src/qalc.cc:670 ../src/qalc.cc:1411 #: ../src/qalc.cc:1531 ../src/qalc.cc:1607 ../src/qalc.cc:1699 #: ../src/qalc.cc:2063 ../src/qalc.cc:2120 ../src/qalc.cc:2135 #: ../src/qalc.cc:2281 msgid "exact" msgstr "exact" #: ../src/qalc.cc:546 ../src/qalc.cc:1532 ../src/qalc.cc:2063 msgid "try exact" msgstr "exact proberen" #. qalc command #: ../src/qalc.cc:547 ../src/qalc.cc:796 ../src/qalc.cc:1417 #: ../src/qalc.cc:1533 ../src/qalc.cc:1694 ../src/qalc.cc:1924 #: ../src/qalc.cc:1934 ../src/qalc.cc:2022 ../src/qalc.cc:2063 #: ../src/qalc.cc:2285 msgid "approximate" msgstr "benaderd" #: ../src/qalc.cc:557 ../src/qalc.cc:1559 ../src/qalc.cc:2095 msgid "autoconversion" msgstr "autoconversie" #: ../src/qalc.cc:560 ../src/qalc.cc:1482 msgid "best" msgstr "best" #: ../src/qalc.cc:561 ../src/qalc.cc:1482 ../src/qalc.cc:1562 #: ../src/qalc.cc:2095 ../src/qalc.cc:2808 #, fuzzy msgid "optimal" msgstr "optioneel" #: ../src/qalc.cc:572 ../src/qalc.cc:1513 ../src/qalc.cc:2060 msgid "algebra mode" msgstr "algebraïsche modus" #. qalc command #: ../src/qalc.cc:575 ../src/qalc.cc:1505 ../src/qalc.cc:1516 #: ../src/qalc.cc:1714 ../src/qalc.cc:2043 ../src/qalc.cc:2060 msgid "simplify" msgstr "vereenvoudigen" #: ../src/qalc.cc:576 ../src/qalc.cc:1517 ../src/qalc.cc:2060 msgid "factorize" msgstr "ontbinden in factoren" #: ../src/qalc.cc:598 ../src/qalc.cc:1666 ../src/qalc.cc:1712 #: ../src/qalc.cc:2175 msgid "save mode" msgstr "modus opslaan" #: ../src/qalc.cc:607 ../src/qalc.cc:1665 ../src/qalc.cc:1711 #: ../src/qalc.cc:2174 msgid "save definitions" msgstr "definities opslaan" #: ../src/qalc.cc:616 ../src/qalc.cc:1594 ../src/qalc.cc:2122 msgid "exp mode" msgstr "exp modus" #: ../src/qalc.cc:619 ../src/qalc.cc:1597 ../src/qalc.cc:2124 msgid "auto" msgstr "auto" #: ../src/qalc.cc:620 ../src/qalc.cc:1598 ../src/qalc.cc:2128 msgid "pure" msgstr "zuiver" #: ../src/qalc.cc:621 ../src/qalc.cc:1599 ../src/qalc.cc:2130 msgid "scientific" msgstr "wetenschappelijk" #: ../src/qalc.cc:622 ../src/qalc.cc:1600 ../src/qalc.cc:2126 msgid "engineering" msgstr "technisch" #: ../src/qalc.cc:633 ../src/qalc.cc:1653 ../src/qalc.cc:2168 msgid "precision" msgstr "nauwkeurigheid" #: ../src/qalc.cc:642 ../src/qalc.cc:1624 ../src/qalc.cc:2155 msgid "max decimals" msgstr "max decimalen" #: ../src/qalc.cc:654 ../src/qalc.cc:1631 ../src/qalc.cc:2160 msgid "min decimals" msgstr "min decimalen" #: ../src/qalc.cc:667 ../src/qalc.cc:1604 ../src/qalc.cc:2135 msgid "fractions" msgstr "breuken" #: ../src/qalc.cc:672 ../src/qalc.cc:1609 ../src/qalc.cc:2135 msgid "combined" msgstr "gecombineerd" #: ../src/qalc.cc:682 ../src/qalc.cc:1655 ../src/qalc.cc:2170 msgid "read precision" msgstr "nauwkeurigheid lezen" #: ../src/qalc.cc:685 ../src/qalc.cc:1658 ../src/qalc.cc:2170 msgid "always" msgstr "altijd" #: ../src/qalc.cc:686 ../src/qalc.cc:1659 ../src/qalc.cc:2170 msgid "when decimals" msgstr "wanneer decimalen" #: ../src/qalc.cc:710 msgid "Unrecognized option." msgstr "Onbekende optie." #: ../src/qalc.cc:742 #, fuzzy msgid "Variables:" msgstr "Variabele" #: ../src/qalc.cc:744 #, fuzzy msgid "Name" msgstr "Namen" #: ../src/qalc.cc:745 ../src/qalc.cc:2018 msgid "Value" msgstr "Waarde" #: ../src/qalc.cc:761 ../src/qalc.cc:1985 ../libqalculate/Function.cc:1863 msgid "matrix" msgstr "matrix" #: ../src/qalc.cc:763 ../src/qalc.cc:1987 ../libqalculate/Function.cc:1802 msgid "vector" msgstr "vector" #: ../src/qalc.cc:773 ../src/qalc.cc:1542 ../src/qalc.cc:1997 #: ../src/qalc.cc:2074 ../src/qalc.cc:2208 msgid "negative" msgstr "negatief" #: ../src/qalc.cc:790 ../src/qalc.cc:2014 msgid "default assumptions" msgstr "standaard aannames" #: ../src/qalc.cc:811 #, fuzzy msgid "Functions:" msgstr "Functie" #: ../src/qalc.cc:825 #, fuzzy msgid "Units:" msgstr "Eenheid" #: ../src/qalc.cc:832 msgid "No local variables, functions or units have been defined." msgstr "" #: ../src/qalc.cc:837 ../src/qalc.cc:897 #, fuzzy msgid "" "For more information about a specific function, variable or unit, please use " "the info command (in interactive mode)." msgstr "" "Type info NAAM voor info over een functie, variabele of eenheid (bv.: info " "sin)." #: ../src/qalc.cc:932 msgid "usage: qalc [options] [expression]" msgstr "gebruik: qalc [opties] [expressie]" #: ../src/qalc.cc:934 msgid "where options are:" msgstr "waarin opties zijn:" #: ../src/qalc.cc:935 ../src/qalc.cc:1696 msgid "BASE" msgstr "GRONDTAL" #: ../src/qalc.cc:936 msgid "set the result number base" msgstr "" #: ../src/qalc.cc:939 msgid "FILE" msgstr "BESTAND" #: ../src/qalc.cc:940 msgid "executes commands from a file first" msgstr "voert eerst opdrachten uit vanuit een bestand" #: ../src/qalc.cc:942 msgid "start in interactive mode" msgstr "" #: ../src/qalc.cc:944 #, fuzzy msgid "displays a list of all user-defined variables, functions and units." msgstr "\"%s\" is geen geldige variabele/functie/eenheid." #: ../src/qalc.cc:946 msgid "displays a list of all functions." msgstr "" #: ../src/qalc.cc:948 msgid "displays a list of all units." msgstr "" #: ../src/qalc.cc:950 msgid "displays a list of all variables." msgstr "" #: ../src/qalc.cc:952 msgid "do not load any functions, units, or variables from file" msgstr "lees geen functies, eenheden of variabelen in uit bestand" #: ../src/qalc.cc:954 msgid "do not load any global currencies from file" msgstr "lees geen globale munteenheden in uit bestand" #: ../src/qalc.cc:956 msgid "do not load any global data sets from file" msgstr "lees geen globale gegevensverzamelingen in uit bestand" #: ../src/qalc.cc:958 msgid "do not load any global functions from file" msgstr "lees geen globale functies in uit bestand" #: ../src/qalc.cc:960 msgid "do not load any global units from file" msgstr "lees geen globale eenheden in uit bestand" #: ../src/qalc.cc:962 msgid "do not load any global variables from file" msgstr "lees geen globale variabelen in uit bestand" #: ../src/qalc.cc:964 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:965 ../src/qalc.cc:1713 msgid "OPTION" msgstr "OPTIE" #: ../src/qalc.cc:965 ../src/qalc.cc:1713 msgid "VALUE" msgstr "WAARDE" #: ../src/qalc.cc:966 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:968 msgid "turn on/off unicode support" msgstr "ondersteuning unicode aan/uit" #: ../src/qalc.cc:970 #, fuzzy msgid "" "The program will start in interactive mode if no expression and no file is " "specified (or interactive mode is explicitly selected)." msgstr "" "Het programma start op in interactieve modus indien geen expressie is " "opgegeven." #: ../src/qalc.cc:1015 msgid "No option and value specified for set command." msgstr "Voor set-opdracht zijn geen optie en waarde opgegeven." #: ../src/qalc.cc:1023 msgid "No file specified." msgstr "Geen bestand opgegeven." #: ../src/qalc.cc:1074 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:1082 msgid "ans" msgstr "antw" #: ../src/qalc.cc:1083 ../src/qalc.cc:1086 ../src/qalc.cc:1087 #: ../src/qalc.cc:1088 ../src/qalc.cc:1089 ../src/qalc.cc:1310 #: ../libqalculate/Calculator.cc:7713 ../libqalculate/Calculator.cc:7729 msgid "Temporary" msgstr "Tijdelijk" #: ../src/qalc.cc:1083 msgid "Last Answer" msgstr "Laatste antwoord" #: ../src/qalc.cc:1084 msgid "answer" msgstr "antwoord" #: ../src/qalc.cc:1086 msgid "Answer 2" msgstr "Antwoord 2" #: ../src/qalc.cc:1087 msgid "Answer 3" msgstr "Antwoord 3" #: ../src/qalc.cc:1088 msgid "Answer 4" msgstr "Antwoord 4" #: ../src/qalc.cc:1089 msgid "Answer 5" msgstr "Antwoord 5" #: ../src/qalc.cc:1100 msgid "Failed to load global definitions!" msgstr "Inlezen van globale definities is mislukt!" #: ../src/qalc.cc:1139 #, c-format msgid "Could not open \"%s\".\n" msgstr "Kon \"%s\" niet openen.\n" #: ../src/qalc.cc:1162 ../src/qalc.cc:1212 ../src/qalc.cc:2345 #, 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:1272 ../src/qalc.cc:1713 ../src/qalc.cc:2047 msgid "set" msgstr "set" #. qalc command #: ../src/qalc.cc:1276 ../src/qalc.cc:1710 ../src/qalc.cc:2231 msgid "save" msgstr "opslaan" #: ../src/qalc.cc:1276 ../src/qalc.cc:1710 ../src/qalc.cc:2231 msgid "store" msgstr "bewaren" #. qalc command #: ../src/qalc.cc:1279 ../src/qalc.cc:1508 ../src/qalc.cc:1708 #: ../src/qalc.cc:2244 msgid "mode" msgstr "modus" #: ../src/qalc.cc:1281 msgid "mode saved" msgstr "modus opgeslagen" #: ../src/qalc.cc:1283 msgid "definitions" msgstr "definities" #: ../src/qalc.cc:1285 msgid "definitions saved" msgstr "definities opgeslagen" #: ../src/qalc.cc:1332 ../src/qalc.cc:1334 #, c-format msgid "Illegal name. Save as %s instead (default: no)?" msgstr "Ongeldige naam. In plaats daarvan als %s opslaan (standaard is nee)?" #: ../src/qalc.cc:1341 msgid "" "An unit or variable with the same name already exists.\n" "Do you want to overwrite it (default: no)?" msgstr "" "Er bestaat al een eenheid of variabele met deze naam.\n" "Wilt u die overschrijven (standaard is nee)?" #. qalc command #: ../src/qalc.cc:1364 ../src/qalc.cc:1698 ../src/qalc.cc:2238 msgid "delete" msgstr "" #: ../src/qalc.cc:1371 #, fuzzy msgid "No user-defined variable with the specified name exist." msgstr "Er bestaat geen functie, variabele of eenheid met de opgegeven naam." #. qalc command #: ../src/qalc.cc:1374 ../src/qalc.cc:1695 ../src/qalc.cc:2198 msgid "assume" msgstr "aannemen" #. qalc command #: ../src/qalc.cc:1384 ../src/qalc.cc:1390 ../src/qalc.cc:1700 #: ../src/qalc.cc:2261 msgid "exrates" msgstr "wisselkoersen" #. qalc command #: ../src/qalc.cc:1394 ../src/qalc.cc:1715 ../src/qalc.cc:2273 msgid "stack" msgstr "stapelgeheugen (stack)" #: ../src/qalc.cc:1396 msgid "The RPN stack is empty." msgstr "Het RPN-stapelgeheugen is leeg." #. qalc command #: ../src/qalc.cc:1408 ../src/qalc.cc:1697 ../src/qalc.cc:2269 msgid "clear stack" msgstr "stapelgeheugen leeg maken" #. qalc command #: ../src/qalc.cc:1423 ../src/qalc.cc:1716 ../src/qalc.cc:2289 msgid "convert" msgstr "converteren" #: ../src/qalc.cc:1423 ../src/qalc.cc:1716 ../src/qalc.cc:2289 #: ../src/qalc.cc:2310 msgid "to" msgstr "naar" #: ../src/qalc.cc:1441 ../src/qalc.cc:2805 #, fuzzy msgid "bases" msgstr "grondtal" #: ../src/qalc.cc:1474 ../src/qalc.cc:2799 #, fuzzy msgid "fraction" msgstr "breuken" #: ../src/qalc.cc:1480 ../src/qalc.cc:2802 #, fuzzy msgid "factors" msgstr "factor" #. qalc command #: ../src/qalc.cc:1502 ../src/qalc.cc:1705 ../src/qalc.cc:2039 msgid "factor" msgstr "factor" #. qalc command #: ../src/qalc.cc:1686 ../src/qalc.cc:2036 msgid "help" msgstr "help" #: ../src/qalc.cc:1689 #, fuzzy msgid "Enter a mathematical expression or a command and press enter." msgstr "Voer een wiskundige expressie of opdracht in." #: ../src/qalc.cc:1690 msgid "Complete functions, units and variables with the tabulator key." msgstr "" "Invoer namen functies, eenheden en variabelen met de tabtoets voltooien." #: ../src/qalc.cc:1692 msgid "Available commands are:" msgstr "Beschikbare opdrachten zijn:" #: ../src/qalc.cc:1695 msgid "ASSUMPTIONS" msgstr "AANNAMES" #: ../src/qalc.cc:1698 ../src/qalc.cc:1710 msgid "NAME" msgstr "NAAM" #: ../src/qalc.cc:1702 msgid "WGET ARGUMENTS" msgstr "ARGUMENTEN WGET" #. qalc command #: ../src/qalc.cc:1706 ../src/qalc.cc:1734 ../src/qalc.cc:2255 #: ../libqalculate/Calculator.cc:8360 ../libqalculate/DataSet.cc:355 #: ../libqalculate/DataSet.cc:382 ../libqalculate/DataSet.cc:1032 msgid "info" msgstr "info" #. qalc command #: ../src/qalc.cc:1707 ../src/qalc.cc:1723 ../src/qalc.cc:1725 #: ../src/qalc.cc:2248 msgid "list" msgstr "" #: ../src/qalc.cc:1709 msgid "ON/OFF" msgstr "AAN/UIT" #: ../src/qalc.cc:1710 msgid "CATEGORY" msgstr "CATEGORIE" #: ../src/qalc.cc:1710 msgid "TITLE" msgstr "TITEL" #: ../src/qalc.cc:1716 msgid "UNIT or \"TO\" COMMAND" msgstr "" #. qalc command #: ../src/qalc.cc:1717 ../src/qalc.cc:2314 ../src/qalc.cc:2335 msgid "quit" msgstr "afsluiten" #: ../src/qalc.cc:1717 ../src/qalc.cc:2314 ../src/qalc.cc:2335 msgid "exit" msgstr "verlaten" #: ../src/qalc.cc:1718 #, fuzzy msgid "Type help COMMAND for more information (example: help save)." msgstr "Type help OPDRACHT voor meer hulp (bv.: help save)." #: ../src/qalc.cc:1719 #, fuzzy msgid "" "Type info NAME for information 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:1720 msgid "" "For more information about mathematical expression, different options, and a " "complete list of functions, variables and units, see the relevant sections " "in the manual of the graphical user interface (available at http://qalculate." "github.io/manual/index.html)." msgstr "" #: ../src/qalc.cc:1742 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:1752 msgid "Function" msgstr "Functie" #: ../src/qalc.cc:1779 ../libqalculate/Function.cc:189 msgid "argument" msgstr "argument" #: ../src/qalc.cc:1803 #, 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:1816 msgid "Arguments" msgstr "Argumenten" #. optional argument, in description #: ../src/qalc.cc:1833 msgid "optional" msgstr "optioneel" #. argument default, in description #: ../src/qalc.cc:1837 msgid "default: " msgstr "standaard: " #: ../src/qalc.cc:1848 msgid "Requirement" msgstr "Vereiste" #: ../src/qalc.cc:1856 msgid "Properties" msgstr "Eigenschappen" #: ../src/qalc.cc:1871 msgid "key" msgstr "sleutelwaarde" #: ../src/qalc.cc:1889 ../src/qalc.cc:1892 msgid "Unit" msgstr "Eenheid" #: ../src/qalc.cc:1895 ../src/qalc.cc:1963 msgid "Names" msgstr "Namen" #: ../src/qalc.cc:1913 msgid "Base Unit" msgstr "Basiseenheid" #: ../src/qalc.cc:1920 msgid "Relation" msgstr "Relatie" #: ../src/qalc.cc:1930 msgid "Inverse Relation" msgstr "Inverse relatie" #: ../src/qalc.cc:1942 msgid "Base Units" msgstr "Basiseenheden" #: ../src/qalc.cc:1957 ../src/qalc.cc:1960 msgid "Variable" msgstr "Variabele" #: ../src/qalc.cc:1975 msgid "a previous result" msgstr "een vorig antwoord" #: ../src/qalc.cc:2041 msgid "Factorizes the current result." msgstr "Het huidige antwoord wordt in factoren ontbonden." #: ../src/qalc.cc:2045 msgid "Simplifies the current result." msgstr "Het huidige antwoord wordt vereenvoudigd." #: ../src/qalc.cc:2055 msgid "Sets the value of an option." msgstr "Stelt de waarde in van een optie." #: ../src/qalc.cc:2057 msgid "Available options and accepted values are:" msgstr "Beschikbare opties en geaccepteerde waarden zijn:" #: ../src/qalc.cc:2188 msgid "days" msgstr "" #: ../src/qalc.cc:2192 msgid "The current value is marked with '*'." msgstr "" #: ../src/qalc.cc:2194 msgid "Example: set base 16." msgstr "Voorbeeld: set base 16 (stel grondtal talstelsel in op 16)." #: ../src/qalc.cc:2196 msgid "Some options have additional help text (e.g. help parsing mode)." msgstr "" #: ../src/qalc.cc:2200 msgid "Set default assumptions for unknown variables." msgstr "Staandaard aannames instellen voor onbekende variabelen." #: ../src/qalc.cc:2233 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:2234 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:2236 msgid "Example: store var1." msgstr "Voorbeeld: store var1 (bewaar var1)." #: ../src/qalc.cc:2240 #, fuzzy msgid "Removes the user-defined variable with the specified name." msgstr "Er bestaat geen functie, variabele of eenheid met de opgegeven naam." #: ../src/qalc.cc:2242 #, fuzzy msgid "Example: delete var1." msgstr "Voorbeeld: store var1 (bewaar var1)." #: ../src/qalc.cc:2246 msgid "Displays the current mode." msgstr "Toont de huidige modus." #: ../src/qalc.cc:2250 #, fuzzy msgid "Displays a list of all user-defined variables, functions and units." msgstr "\"%s\" is geen geldige variabele/functie/eenheid." #: ../src/qalc.cc:2251 msgid "" "Enter with argument 'functions', 'variables' or 'units' to show a list of " "all functions, variables or units." msgstr "" #: ../src/qalc.cc:2253 #, fuzzy msgid "Example: list functions." msgstr "Voorbeeld: info sin." #: ../src/qalc.cc:2257 msgid "Displays information about a function, variable or unit." msgstr "Toont informatie over een functie, variabele of eenheid." #: ../src/qalc.cc:2259 msgid "Example: info sin." msgstr "Voorbeeld: info sin." #: ../src/qalc.cc:2263 msgid "Downloads current exchange rates from the Internet." msgstr "Haalt de huidige wisselkoersen op van het internet." #: ../src/qalc.cc:2267 msgid "(De)activates the Reverse Polish Notation mode." msgstr "(De)activeert de RPN-modus (omgekeerde Poolse notatie)." #: ../src/qalc.cc:2271 msgid "Clears the RPN stack." msgstr "Maakt het RPN-stapelgeheugen leeg." #: ../src/qalc.cc:2275 msgid "Displays the RPN stack." msgstr "Toont het RPN-stapelgeheugen." #: ../src/qalc.cc:2279 #, fuzzy msgid "Sets the result number base (equivalent to set base)." msgstr "" "Stelt het grondtal in voor het antwoord (gelijkwaardig aan instellen " "grondtal talstelsel)." #: ../src/qalc.cc:2283 msgid "Equivalent to set approximation exact." msgstr "Gelijkwaardig aan benadering instellen op exact." #: ../src/qalc.cc:2287 msgid "Equivalent to set approximation try exact." msgstr "Gelijkwaardig aan benadering instellen op exact proberen." #: ../src/qalc.cc:2291 #, fuzzy msgid "Converts units or changes number base in current result." msgstr "Converteert de eenheden in het huidige antwoord." #: ../src/qalc.cc:2293 #, fuzzy msgid "Possible values:" msgstr "Mogelijke eenheden zijn:" #: ../src/qalc.cc:2295 msgid "a unit (e.g. meter, prepend with ? to request the optimal prefix)" msgstr "" #: ../src/qalc.cc:2296 #, fuzzy msgid "a unit expression (e.g. km/h)" msgstr "een uitdrukking voor een eenheid (voorbeeld km/h)" #: ../src/qalc.cc:2297 msgid "base (convert to base units)" msgstr "basis (omzetten naar basiseenheden)" #: ../src/qalc.cc:2298 #, fuzzy msgid "optimal (convert to optimal unit)" msgstr "basis (omzetten naar basiseenheden)" #: ../src/qalc.cc:2300 msgid "bin / binary (show as binary number)" msgstr "" #: ../src/qalc.cc:2301 msgid "oct / octal (show as octal number)" msgstr "" #: ../src/qalc.cc:2302 msgid "hex / hexadecimal (show as hexadecimal number)" msgstr "" #: ../src/qalc.cc:2303 msgid "bases (show as binary, octal, decimal and hexadecimal number)" msgstr "" #: ../src/qalc.cc:2305 msgid "fraction (show result in combined fractional format)" msgstr "" #: ../src/qalc.cc:2306 #, fuzzy msgid "factors (factorize result)" msgstr "Het huidige antwoord wordt in factoren ontbonden." #: ../src/qalc.cc:2308 #, fuzzy msgid "Example: to ?g" msgstr "Voorbeeld: store var1 (bewaar var1)." #: ../src/qalc.cc:2311 msgid "" "This command can also be typed directly at the end of the mathematical " "expression." msgstr "" #: ../src/qalc.cc:2316 msgid "Terminates this program." msgstr "Sluit het programma af." #: ../src/qalc.cc:2321 msgid "" "Implicit multiplication does not differ from explicit multiplication " "(\"12/2(1+2) = 12/2*3 = 18\", \"5x/5y = 5*x/5*y = xy\")." msgstr "" #: ../src/qalc.cc:2324 msgid "" "Implicit multiplication is parsed before explicit multiplication " "(\"12/2(1+2) = 12/(2*3) = 2\", \"5x/5y = (5*x)/(5*y) = x/y\")." msgstr "" #: ../src/qalc.cc:2327 msgid "" "The default adaptive mode works as the \"implicit first\" mode, unless " "spaces are found (\"1/5x = 1/(5*x)\", but \"1/5 x = (1/5)*x\"). In the " "adaptive mode unit expressions are parsed separately (\"5 m/5 m/s = (5*m)/" "(5*(m/s)) = 1 s\")." msgstr "" #: ../src/qalc.cc:2329 msgid "" "Function arguments without parentheses are an exception, where implicit " "multiplication in front of variables and units is parsed first regardless of " "mode (\"sqrt 2x = sqrt(2x)\")." msgstr "" #: ../src/qalc.cc:2380 msgid "error" msgstr "fout" #: ../src/qalc.cc:2382 msgid "warning" msgstr "waarschuwing" #: ../src/qalc.cc:2437 ../libqalculate/Calculator.cc:8740 #: ../libqalculate/MathStructure.cc:483 ../libqalculate/MathStructure.cc:730 msgid "aborted" msgstr "afgebroken" #: ../src/qalc.cc:2468 msgid "RPN Register Moved" msgstr "RPN-register is verplaatst" #: ../src/qalc.cc:2508 msgid "Processing (press Enter to abort)" msgstr "Aan het verwerken (afbreken met Enter)" #: ../src/qalc.cc:2581 ../src/qalc.cc:3071 msgid "approx." msgstr "benad." #: ../src/qalc.cc:2693 msgid "Factorizing (press Enter to abort)" msgstr "Aan het ontbinden in factoren (afbreken met Enter)" #: ../src/qalc.cc:2697 msgid "Simplifying (press Enter to abort)" msgstr "Aan het vereenvoudigen (afbreken met Enter)" #: ../src/qalc.cc:2958 msgid "Calculating (press Enter to abort)" msgstr "Aan het berekenen (afbreken met Enter)" #: ../src/qalc.cc:3031 msgid "RPN Operation" msgstr "RPN-berwerking" #: ../src/qalc.cc:3414 #, c-format msgid "" "Couldn't write preferences to\n" "%s" msgstr "" "Kon de voorkeurinstellingen niet schrijven naar\n" "%s" #: ../src/qalc.cc:3492 msgid "Couldn't write definitions" msgstr "Kon definities niet schrijven" #: ../libqalculate/BuiltinFunctions.cc:59 #, 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:121 #: ../libqalculate/BuiltinFunctions.cc:181 #, c-format msgid "Row %s does not exist in matrix." msgstr "Rij %s bestaat niet in matrix." #: ../libqalculate/BuiltinFunctions.cc:134 #: ../libqalculate/BuiltinFunctions.cc:177 #, c-format msgid "Column %s does not exist in matrix." msgstr "Kolom %s bestaat niet in matrix." #: ../libqalculate/BuiltinFunctions.cc:192 #, c-format msgid "Argument 3, %s, is ignored for vectors." msgstr "Argument 3, %s, wordt genegeerd voor vectoren." #: ../libqalculate/BuiltinFunctions.cc:196 #: ../libqalculate/BuiltinFunctions.cc:217 #, c-format msgid "Element %s does not exist in vector." msgstr "Element %s bestaat niet in vector." #: ../libqalculate/BuiltinFunctions.cc:405 #, 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:1243 #, 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:2113 #: ../libqalculate/BuiltinFunctions.cc:2156 #, c-format msgid "Unsolvable comparison in %s()." msgstr "Vergelijken lukt niet in %s()." #: ../libqalculate/BuiltinFunctions.cc:2274 ../libqalculate/util.cc:52 msgid "now" msgstr "nu" #: ../libqalculate/BuiltinFunctions.cc:2286 #, 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:2319 #: ../libqalculate/BuiltinFunctions.cc:2332 #: ../libqalculate/BuiltinFunctions.cc:2345 #: ../libqalculate/BuiltinFunctions.cc:2367 #: ../libqalculate/BuiltinFunctions.cc:2388 #, c-format msgid "Error in date format for function %s()." msgstr "Fout in het datumformaat voor functie %s()." #: ../libqalculate/BuiltinFunctions.cc:2642 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:2937 #: ../libqalculate/BuiltinFunctions.cc:2954 msgid "Comparison failed." msgstr "Vergelijken is mislukt." #: ../libqalculate/BuiltinFunctions.cc:2942 #: ../libqalculate/BuiltinFunctions.cc:2972 msgid "No matching item found." msgstr "Geen overeenkomst gevonden." #: ../libqalculate/BuiltinFunctions.cc:3054 #, c-format msgid "Object %s does not exist." msgstr "Object %s bestaat niet." #: ../libqalculate/BuiltinFunctions.cc:3081 #, c-format msgid "Register %s does not exist. Returning zero." msgstr "Register %s bestaat niet. Nul wordt geretourneerd." #: ../libqalculate/BuiltinFunctions.cc:3124 #, c-format msgid "" "The %s function is incomplete, unreliable and unstable. Use at your own risk " "and avoid complex expressions." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:3135 #: ../libqalculate/BuiltinFunctions.cc:3146 #, fuzzy msgid "Unable to integrate the expression." msgstr "Kon %s niet isoleren." #: ../libqalculate/BuiltinFunctions.cc:3141 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:3282 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:3329 #, 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:3333 msgid "No possible solution was found (with current assumptions)." msgstr "Geen oplossing gevonden (met huidige aannames)." #: ../libqalculate/BuiltinFunctions.cc:3337 #, c-format msgid "Was unable to completely isolate %s." msgstr "Kon %s niet volledig isoleren." #: ../libqalculate/BuiltinFunctions.cc:3341 #: ../libqalculate/BuiltinFunctions.cc:3469 #: ../libqalculate/BuiltinFunctions.cc:3564 #, 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:3345 #, c-format msgid "Was unable to isolate %s." msgstr "Kon %s niet isoleren." #: ../libqalculate/BuiltinFunctions.cc:3428 #: ../libqalculate/BuiltinFunctions.cc:3455 #: ../libqalculate/BuiltinFunctions.cc:3538 #, 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:3431 #: ../libqalculate/BuiltinFunctions.cc:3458 #: ../libqalculate/BuiltinFunctions.cc:3541 #, 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:3464 #: ../libqalculate/BuiltinFunctions.cc:3549 #, c-format msgid "The solution requires that %s." msgstr "De oplossing vereist dat %s." #: ../libqalculate/BuiltinFunctions.cc:3557 #, c-format msgid "Solution %s requires that %s." msgstr "De oplossing %s vereist dat %s." #: ../libqalculate/BuiltinFunctions.cc:3625 #, c-format msgid "" "Unable to isolate %s.\n" "\n" "You might need to place the equations and variables in an appropriate order " "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:3627 #: ../libqalculate/BuiltinFunctions.cc:3641 #: ../libqalculate/BuiltinFunctions.cc:3650 #, c-format msgid "Unable to isolate %s." msgstr "Kon %s niet isoleren." #: ../libqalculate/BuiltinFunctions.cc:3634 #, c-format msgid "Inequalities is not allowed in %s()." msgstr "Ongelijkheden zijn niet toegestaan in %s()." #: ../libqalculate/Calculator.cc:322 msgid "per" msgstr "per" #: ../libqalculate/Calculator.cc:324 msgid "times" msgstr "keer" #: ../libqalculate/Calculator.cc:326 msgid "plus" msgstr "plus" #: ../libqalculate/Calculator.cc:328 msgid "minus" msgstr "minus" #: ../libqalculate/Calculator.cc:330 ../libqalculate/MathStructure.cc:11628 #: ../libqalculate/Function.cc:1146 ../libqalculate/Function.cc:1154 #: ../libqalculate/Function.cc:1563 ../libqalculate/Function.cc:1707 msgid "and" msgstr "and" #: ../libqalculate/Calculator.cc:334 ../libqalculate/DataSet.cc:1066 #: ../libqalculate/DataSet.cc:1129 ../libqalculate/MathStructure.cc:11642 #: ../libqalculate/Function.cc:2022 ../libqalculate/Function.cc:2038 msgid "or" msgstr "or" #: ../libqalculate/Calculator.cc:378 ../libqalculate/Calculator.cc:1092 #: ../libqalculate/Calculator.cc:2232 ../libqalculate/Calculator.cc:2237 #: ../libqalculate/Calculator.cc:2238 msgid " to " msgstr " naar " #: ../libqalculate/Calculator.cc:445 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:446 ../libqalculate/Calculator.cc:454 #: ../libqalculate/Calculator.cc:462 msgid "Angle/Plane Angle" msgstr "Hoek/hoek in het platte vlak" #: ../libqalculate/Calculator.cc:453 msgid "Radians unit is missing. Creating one for this session." msgstr "Eenheid radiaal ontbreekt. Voor deze sessie wordt er een aangemaakt." #: ../libqalculate/Calculator.cc:461 msgid "Degrees unit is missing. Creating one for this session." msgstr "Eenheid graad ontbreekt. Voor deze sessie wordt er een aangemaakt." #: ../libqalculate/Calculator.cc:1439 ../libqalculate/Calculator.cc:8795 msgid "Currency" msgstr "Valuta" #: ../libqalculate/Calculator.cc:1440 ../libqalculate/Calculator.cc:1442 #: ../libqalculate/Calculator.cc:1443 #, fuzzy msgid "Temperature" msgstr "Tijdelijk" #: ../libqalculate/Calculator.cc:2197 msgid "calculating..." msgstr "aan het rekenen..." #: ../libqalculate/Calculator.cc:2428 ../libqalculate/Calculator.cc:2436 msgid "" "Cannot convert to unit expression that includes degrees Celsius or " "Fahrenheit in addition to other units, prefixes or exponents." msgstr "" #: ../libqalculate/Calculator.cc:2445 ../libqalculate/Calculator.cc:2450 #: ../libqalculate/Calculator.cc:2455 msgid "Cannot convert the expression to degrees Celsius or Fahrenheit." msgstr "" #: ../libqalculate/Calculator.cc:3374 #, 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:3391 #, 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:3407 #, 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:4615 ../libqalculate/Calculator.cc:5378 #: ../libqalculate/Calculator.cc:5390 ../libqalculate/Calculator.cc:5415 #: ../libqalculate/Calculator.cc:5441 #, c-format msgid "Misplaced operator(s) \"%s\" ignored" msgstr "Verkeerd geplaatste bewerking(en) \"%s\" genegeerd" #: ../libqalculate/Calculator.cc:4639 ../libqalculate/Calculator.cc:5465 #, c-format msgid "Misplaced '%c' ignored" msgstr "Verkeerd geplaatste '%c' genegeerd" #: ../libqalculate/Calculator.cc:4666 ../libqalculate/Function.cc:1293 #: ../libqalculate/Function.cc:1324 #, c-format msgid "Internal id %s does not exist." msgstr "Interne id %s bestaat niet." #: ../libqalculate/Calculator.cc:4684 #, c-format msgid "\"%s\" is not a valid variable/function/unit." msgstr "\"%s\" is geen geldige variabele/functie/eenheid." #: ../libqalculate/Calculator.cc:4699 #, 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:5076 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:5079 msgid "Unused stack values." msgstr "Ongebruikte waarden op de stack (stapelregister)." #: ../libqalculate/Calculator.cc:5118 ../libqalculate/Calculator.cc:5186 #, fuzzy, c-format msgid "RPN syntax error. Operator '%c' not supported." msgstr "RPN-syntaxisfout. Stack (stapelregister) is leeg." #: ../libqalculate/Calculator.cc:5146 msgid "RPN syntax error. Stack is empty." msgstr "RPN-syntaxisfout. Stack (stapelregister) is leeg." #: ../libqalculate/Calculator.cc:5148 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:5664 #, c-format msgid "Name \"%s\" is in use. Replacing with \"%s\"." msgstr "Naam \"%s\" wordt al gebruikt.. Wordt vervangen door \"%s\"." #: ../libqalculate/Calculator.cc:6360 ../libqalculate/DataSet.cc:535 #, c-format msgid "File not identified as Qalculate! definitions file: %s." msgstr "Bestand niet gedefinieerd als definitiebestand voor Qalculate!: %s." #: ../libqalculate/Calculator.cc:8343 ../libqalculate/DataSet.cc:353 msgid "Object" msgstr "Object" #: ../libqalculate/Calculator.cc:8352 ../libqalculate/DataSet.cc:354 msgid "Property" msgstr "Eigenschap" #: ../libqalculate/Calculator.cc:8645 msgid "column" msgstr "kolom" #: ../libqalculate/Calculator.cc:8648 msgid "Column " msgstr "Kolom " #: ../libqalculate/Calculator.cc:8739 ../libqalculate/Calculator.cc:8743 msgid "timed out" msgstr "tijd is verlopen" #: ../libqalculate/Calculator.cc:8901 msgid "Failed to download exchange rates from ECB." msgstr "Het ophalen van wisselkoersen van ECB is niet gelukt." #: ../libqalculate/Calculator.cc:8961 ../libqalculate/Calculator.cc:8975 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:8991 ../libqalculate/Calculator.cc:9005 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:9051 msgid "No extension in file name. Saving as PNG image." msgstr "" "Geen extensie opgegeven voor bestandsnaam. Wordt opgeslagen als PNG-" "afbeelding." #: ../libqalculate/Calculator.cc:9068 msgid "Unknown extension in file name. Saving as PNG image." msgstr "" "Onbekende extensie in bestandsnaam. Wordt opgeslagen als PNG-afbeelding." #: ../libqalculate/Calculator.cc:9261 #, c-format msgid "Could not create temporary file %s" msgstr "Kon tijdelijk bestand %s niet aanmaken" #: ../libqalculate/Calculator.cc:9302 msgid "It took too long to generate the plot data." msgstr "" #: ../libqalculate/Calculator.cc:9316 #, 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:9318 #, 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:9344 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:379 #, c-format msgid "Object %s not available in data set." msgstr "Object %s niet beschikbaar in gegevensverzameling." #: ../libqalculate/DataSet.cc:389 #, c-format msgid "Property %s not available in data set." msgstr "Eigenschap %s niet beschikbaar in gegevensverzameling." #: ../libqalculate/DataSet.cc:394 #, c-format msgid "Property %s not defined for object %s." msgstr "Eigenschap %s niet gedefinieerd voor object %s." #: ../libqalculate/DataSet.cc:513 ../libqalculate/DataSet.cc:521 #, c-format msgid "Unable to load data objects in %s." msgstr "Kon gegevensobjecten in %s niet inlezen." #: ../libqalculate/DataSet.cc:1036 msgid "data property" msgstr "eigenschap gegevens" #: ../libqalculate/DataSet.cc:1038 msgid "name of a data property" msgstr "naam van een eigenschap van gegevens" #: ../libqalculate/DataSet.cc:1046 ../libqalculate/DataSet.cc:1062 msgid "no properties available" msgstr "geen eigenschappen beschikbaar" #: ../libqalculate/DataSet.cc:1096 #, 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:1101 msgid "data object" msgstr "gegevensobject" #: ../libqalculate/DataSet.cc:1103 msgid "an object from" msgstr "een object van" #: ../libqalculate/DataSet.cc:1132 msgid "use" msgstr "gebruik" #: ../libqalculate/MathStructure.cc:94 ../libqalculate/MathStructure.cc:115 #: ../libqalculate/MathStructure.cc:145 #, 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:2614 #, 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:5241 ../libqalculate/MathStructure.cc:5282 #: ../libqalculate/MathStructure.cc:5315 ../libqalculate/MathStructure.cc:5371 #: ../libqalculate/MathStructure.cc:5391 ../libqalculate/MathStructure.cc:5410 #: ../libqalculate/MathStructure.cc:5429 ../libqalculate/MathStructure.cc:5448 #: ../libqalculate/MathStructure.cc:5539 ../libqalculate/MathStructure.cc:8792 #: ../libqalculate/MathStructure.cc:8803 ../libqalculate/MathStructure.cc:8880 msgid "This is a bug. Please report it." msgstr "Dit is een bug (programmafout). Meld deze alstublieft." #: ../libqalculate/MathStructure.cc:11722 msgid "undefined" msgstr "ongedefinieerd" #: ../libqalculate/MathStructure.cc:11772 #, 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:11820 #, 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:12245 msgid "The determinant can only be calculated for square matrices." msgstr "De determinant kan alleen voor een vierkante matrix worden berekend." #: ../libqalculate/MathStructure.cc:12308 msgid "The permanent can only be calculated for square matrices." msgstr "De permanent kan alleen voor een vierkante matrix worden berekend." #: ../libqalculate/MathStructure.cc:12397 msgid "Inverse of singular matrix." msgstr "Inverse van singuliere matrix." #: ../libqalculate/Function.cc:153 #, c-format msgid "%s() requires that %s" msgstr "%s() vereist dat %s" #: ../libqalculate/Function.cc:306 ../libqalculate/Function.cc:363 #: ../libqalculate/Function.cc:422 #, 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:443 #, 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:445 #, 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:1136 msgid "a free value" msgstr "een vrije waarde" #: ../libqalculate/Function.cc:1141 msgid "that is nonzero" msgstr "die ongelijk nul is" #: ../libqalculate/Function.cc:1149 msgid "that is rational (polynomial)" msgstr "die rationaal is (polynoom)" #: ../libqalculate/Function.cc:1157 msgid "that fulfills the condition:" msgstr "die aan de conditie voldoet:" #: ../libqalculate/Function.cc:1160 msgid "Argument" msgstr "Argument" #: ../libqalculate/Function.cc:1215 #, c-format msgid "Argument %s in %s() must be %s." msgstr "Argument %s in %s() moet zijn: %s." #: ../libqalculate/Function.cc:1217 #, c-format msgid "Argument %s, %s, in %s() must be %s." msgstr "Argument %s, %s, in %s() moet zijn: %s." #: ../libqalculate/Function.cc:1544 msgid "a rational number" msgstr "een rationaal getal" #: ../libqalculate/Function.cc:1546 msgid "a number" msgstr "een getal" #: ../libqalculate/Function.cc:1548 msgid "a real number" msgstr "een reëel getal" #: ../libqalculate/Function.cc:1553 ../libqalculate/Function.cc:1700 msgid ">=" msgstr ">=" #: ../libqalculate/Function.cc:1555 msgid ">" msgstr ">" #: ../libqalculate/Function.cc:1567 ../libqalculate/Function.cc:1710 msgid "<=" msgstr "<=" #: ../libqalculate/Function.cc:1569 msgid "<" msgstr "<" #: ../libqalculate/Function.cc:1697 msgid "an integer" msgstr "een geheel getal" #: ../libqalculate/Function.cc:1728 msgid "symbol" msgstr "symbool" #: ../libqalculate/Function.cc:1729 msgid "an unknown variable/symbol" msgstr "een onbekend(e) variabele/symbool" #: ../libqalculate/Function.cc:1742 msgid "text" msgstr "tekst" #: ../libqalculate/Function.cc:1743 msgid "a text string" msgstr "een tekenrij" #: ../libqalculate/Function.cc:1758 msgid "date" msgstr "datum" #: ../libqalculate/Function.cc:1759 msgid "a date" msgstr "een datum" #: ../libqalculate/Function.cc:1805 msgid "a vector with " msgstr "een vector met " #: ../libqalculate/Function.cc:1817 msgid "a vector" msgstr "een vector" #: ../libqalculate/Function.cc:1866 msgid "a square matrix" msgstr "een vierkante matrix" #: ../libqalculate/Function.cc:1868 msgid "a matrix" msgstr "een matrix" #: ../libqalculate/Function.cc:1883 msgid "object" msgstr "object" #: ../libqalculate/Function.cc:1884 msgid "a valid function, unit or variable name" msgstr "een geldige naam voor een functie, eenheid of variabele" #: ../libqalculate/Function.cc:1897 msgid "function" msgstr "functie" #: ../libqalculate/Function.cc:1898 msgid "a valid function name" msgstr "een geldige functienaam" #: ../libqalculate/Function.cc:1911 msgid "unit" msgstr "eenheid" #: ../libqalculate/Function.cc:1912 msgid "a valid unit name" msgstr "een geldige naam voor een eenheid" #: ../libqalculate/Function.cc:1925 msgid "variable" msgstr "variabele" #: ../libqalculate/Function.cc:1926 msgid "a valid variable name" msgstr "een geldige naam voor een variabele" #: ../libqalculate/Function.cc:1939 msgid "file" msgstr "bestand" #: ../libqalculate/Function.cc:1940 msgid "a valid file name" msgstr "een geldige bestandsnaam" #: ../libqalculate/Function.cc:1953 msgid "boolean" msgstr "Booleaanse waarde" #: ../libqalculate/Function.cc:1954 msgid "a boolean (0 or 1)" msgstr "een Booleaanse waarde (0 of 1)" #: ../libqalculate/Function.cc:1964 msgid "angle" msgstr "hoek" #: ../libqalculate/Function.cc:1965 msgid "an angle or a number (using the default angle unit)" msgstr "een hoek of een getal (in standaard hoekeenheid)" #: ../libqalculate/Number.cc:91 ../libqalculate/Number.cc:197 #: ../libqalculate/Number.cc:219 ../libqalculate/Number.cc:521 #: ../libqalculate/Number.cc:689 ../libqalculate/Number.cc:808 #: ../libqalculate/Number.cc:818 ../libqalculate/Number.cc:828 #: ../libqalculate/Number.cc:838 ../libqalculate/Number.cc:847 #: ../libqalculate/Number.cc:860 ../libqalculate/Number.cc:873 #: ../libqalculate/Number.cc:883 ../libqalculate/Number.cc:895 #: ../libqalculate/Number.cc:905 ../libqalculate/Number.cc:944 #: ../libqalculate/Number.cc:951 ../libqalculate/Number.cc:997 #: ../libqalculate/Number.cc:1015 ../libqalculate/Number.cc:1029 #: ../libqalculate/Number.cc:1076 ../libqalculate/Number.cc:1261 #: ../libqalculate/Number.cc:1417 ../libqalculate/Number.cc:1463 #: ../libqalculate/Number.cc:1515 ../libqalculate/Number.cc:1560 #: ../libqalculate/Number.cc:1583 ../libqalculate/Number.cc:1661 #: ../libqalculate/Number.cc:1668 ../libqalculate/Number.cc:1676 #: ../libqalculate/Number.cc:1746 ../libqalculate/Number.cc:1763 #: ../libqalculate/Number.cc:1775 ../libqalculate/Number.cc:1798 #: ../libqalculate/Number.cc:1808 ../libqalculate/Number.cc:1828 #: ../libqalculate/Number.cc:1841 ../libqalculate/Number.cc:1854 #: ../libqalculate/Number.cc:1870 ../libqalculate/Number.cc:1887 #: ../libqalculate/Number.cc:1904 ../libqalculate/Number.cc:1921 #: ../libqalculate/Number.cc:1935 ../libqalculate/Number.cc:1949 #: ../libqalculate/Number.cc:1962 ../libqalculate/Number.cc:1977 #: ../libqalculate/Number.cc:1991 ../libqalculate/Number.cc:2005 #: ../libqalculate/Number.cc:2016 ../libqalculate/Number.cc:2030 #: ../libqalculate/Number.cc:2042 ../libqalculate/Number.cc:2107 #: ../libqalculate/Number.cc:2121 ../libqalculate/Number.cc:2137 #: ../libqalculate/Number.cc:2153 ../libqalculate/Number.cc:2169 #: ../libqalculate/Number.cc:2188 ../libqalculate/Number.cc:2207 #: ../libqalculate/Number.cc:2230 ../libqalculate/Number.cc:2246 #: ../libqalculate/Number.cc:2262 ../libqalculate/Number.cc:2284 #: ../libqalculate/Number.cc:2302 ../libqalculate/Number.cc:2326 #: ../libqalculate/Number.cc:2350 ../libqalculate/Number.cc:2389 #: ../libqalculate/Number.cc:2396 ../libqalculate/Number.cc:2418 #: ../libqalculate/Number.cc:2445 ../libqalculate/Number.cc:2453 #: ../libqalculate/Number.cc:2467 ../libqalculate/Number.cc:2493 #: ../libqalculate/Number.cc:2506 ../libqalculate/Number.cc:2539 #: ../libqalculate/Number.cc:2568 ../libqalculate/Number.cc:2595 #: ../libqalculate/Number.cc:2623 ../libqalculate/Number.cc:2638 #: ../libqalculate/Number.cc:2648 ../libqalculate/Number.cc:2666 #: ../libqalculate/Number.cc:2684 ../libqalculate/Number.cc:2690 #: ../libqalculate/Number.cc:2709 ../libqalculate/Number.cc:2716 #: ../libqalculate/Number.cc:3077 ../libqalculate/Number.cc:3113 #: ../libqalculate/Number.cc:3149 ../libqalculate/Number.cc:3258 #: ../libqalculate/Number.cc:3268 ../libqalculate/Number.cc:3274 #: ../libqalculate/Number.cc:3280 ../libqalculate/Number.cc:3286 #: ../libqalculate/Number.cc:3362 ../libqalculate/Number.cc:3386 #: ../libqalculate/Number.cc:3422 #, c-format msgid "CLN Exception: %s" msgstr "" #: ../libqalculate/Number.cc:174 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:268 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:346 #, c-format msgid "Error in roman numerals: %s." msgstr "Fout in Romeins cijfers: \"%s\"." #: ../libqalculate/Number.cc:381 #, c-format msgid "Unknown roman numeral: %c." msgstr "Onbekend Romeins cijfer: %c." #: ../libqalculate/Number.cc:439 #, 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:528 msgid "':' in decimal number ignored (decimal point detected)." msgstr "':' in decimaal getal genegeerd (decimale komma gevonden)." #: ../libqalculate/Number.cc:584 #, 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:1633 msgid "Division by zero." msgstr "Deling door nul." #. 0^0 #: ../libqalculate/Number.cc:1639 msgid "0^0 might be considered undefined" msgstr "0^0 kan als ongedefinieerd worden beschouwd" #: ../libqalculate/Number.cc:1644 msgid "The result of 0^i is possibly undefined" msgstr "" #: ../libqalculate/Number.cc:2094 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:2100 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:3231 ../libqalculate/Number.cc:3239 #: ../libqalculate/Number.cc:3248 msgid "infinity" msgstr "oneindigheid" #: ../libqalculate/Unit.cc:850 msgid "Error(s) in unitexpression." msgstr "Fout(en) in de eenheidexpressie." #. 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); #: ../libqalculate/util.cc:52 msgid "today" msgstr "vandaag" #: ../libqalculate/util.cc:55 msgid "tomorrow" msgstr "" #: ../libqalculate/util.cc:59 msgid "yesterday" msgstr "" #: ../libqalculate/util.cc:535 msgid "Yes" msgstr "Ja" #: ../libqalculate/util.cc:536 msgid "No" msgstr "Nee" #: ../libqalculate/util.cc:543 msgid "True" msgstr "Waar" #: ../libqalculate/util.cc:544 msgid "False" msgstr "Onwaar" #: ../libqalculate/util.cc:551 msgid "On" msgstr "Aan" #: ../libqalculate/util.cc:552 msgid "Off" msgstr "Uit" #~ msgid "UNIT" #~ msgstr "EENHEID" #~ msgid "a unit (example meter)" #~ msgstr "een eenheid (voorbeeld meter)" #~ msgid "best (convert best unit)" #~ msgstr "beste (omzetten naar beste eenheid)" #~ msgid "Example: convert best." #~ msgstr "Voorbeeld: convert best (converteer naar beste)." #~ msgid "Decimal point in sexagesimal number treated as ':'." #~ msgstr "Decimale komma in sexagesimaal getal behandeld als ':'." libqalculate-0.9.10/po/fr.po0000644000175000017500000017730512744163321012571 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: 2016-07-21 17:14+0200\n" "PO-Revision-Date: 2006-11-08 21:13-0500\n" "Last-Translator: Nicolas Laug \n" "Language-Team: Français \n" "Language: \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:102 ../src/qalc.cc:152 ../src/qalc.cc:2051 #: ../libqalculate/util.cc:538 msgid "yes" msgstr "oui" #: ../src/qalc.cc:103 ../src/qalc.cc:154 ../src/qalc.cc:2051 #: ../libqalculate/util.cc:539 msgid "no" msgstr "non" #: ../src/qalc.cc:104 ../libqalculate/util.cc:546 msgid "true" msgstr "vrai" #: ../src/qalc.cc:105 ../libqalculate/util.cc:547 msgid "false" msgstr "faux" #: ../src/qalc.cc:106 ../src/qalc.cc:671 ../src/qalc.cc:686 ../src/qalc.cc:1608 #: ../src/qalc.cc:2050 ../src/qalc.cc:2135 ../libqalculate/util.cc:554 msgid "on" msgstr "marche" #: ../src/qalc.cc:107 ../src/qalc.cc:618 ../src/qalc.cc:644 ../src/qalc.cc:656 #: ../src/qalc.cc:669 ../src/qalc.cc:684 ../src/qalc.cc:1596 #: ../src/qalc.cc:1606 ../src/qalc.cc:1628 ../src/qalc.cc:1635 #: ../src/qalc.cc:1657 ../src/qalc.cc:2050 ../src/qalc.cc:2122 #: ../src/qalc.cc:2135 ../src/qalc.cc:2155 ../src/qalc.cc:2160 #: ../src/qalc.cc:2170 ../libqalculate/util.cc:555 msgid "off" msgstr "arrêt" #: ../src/qalc.cc:159 msgid "Please answer yes or no" msgstr "Merci de répondre oui ou non" #: ../src/qalc.cc:166 ../src/qalc.cc:788 ../src/qalc.cc:1557 #: ../src/qalc.cc:2012 ../src/qalc.cc:2068 ../src/qalc.cc:2080 #: ../src/qalc.cc:2202 ../src/qalc.cc:2214 msgid "unknown" msgstr "inconnue" #: ../src/qalc.cc:172 ../src/qalc.cc:450 ../src/qalc.cc:481 ../src/qalc.cc:559 #: ../src/qalc.cc:574 ../src/qalc.cc:1515 ../src/qalc.cc:1526 #: ../src/qalc.cc:1561 ../src/qalc.cc:1576 ../src/qalc.cc:2060 #: ../src/qalc.cc:2062 ../src/qalc.cc:2095 ../src/qalc.cc:2113 msgid "none" msgstr "aucun" #: ../src/qalc.cc:174 ../src/qalc.cc:785 ../src/qalc.cc:1554 #: ../src/qalc.cc:2009 ../src/qalc.cc:2082 ../src/qalc.cc:2216 msgid "non-matrix" msgstr "non-matriciel" #: ../src/qalc.cc:176 ../src/qalc.cc:783 ../src/qalc.cc:1552 #: ../src/qalc.cc:2007 ../src/qalc.cc:2086 ../src/qalc.cc:2220 msgid "complex" msgstr "complexe" #: ../src/qalc.cc:178 ../src/qalc.cc:782 ../src/qalc.cc:1551 #: ../src/qalc.cc:2006 ../src/qalc.cc:2088 ../src/qalc.cc:2222 msgid "real" msgstr "réel" #: ../src/qalc.cc:180 ../src/qalc.cc:784 ../src/qalc.cc:1553 #: ../src/qalc.cc:2008 ../src/qalc.cc:2084 ../src/qalc.cc:2218 #: ../libqalculate/Function.cc:1539 msgid "number" msgstr "nombre" #: ../src/qalc.cc:182 ../src/qalc.cc:781 ../src/qalc.cc:1550 #: ../src/qalc.cc:2005 ../src/qalc.cc:2090 ../src/qalc.cc:2224 msgid "rational" msgstr "rationnel" #: ../src/qalc.cc:184 ../src/qalc.cc:780 ../src/qalc.cc:1549 #: ../src/qalc.cc:2004 ../src/qalc.cc:2092 ../src/qalc.cc:2226 #: ../libqalculate/Function.cc:1694 msgid "integer" msgstr "entier" #: ../src/qalc.cc:186 ../src/qalc.cc:775 ../src/qalc.cc:1544 #: ../src/qalc.cc:1999 ../src/qalc.cc:2070 ../src/qalc.cc:2204 msgid "non-zero" msgstr "non nul" #: ../src/qalc.cc:188 ../src/qalc.cc:771 ../src/qalc.cc:1540 #: ../src/qalc.cc:1995 ../src/qalc.cc:2072 ../src/qalc.cc:2206 msgid "positive" msgstr "strictement positif" #: ../src/qalc.cc:190 ../src/qalc.cc:774 ../src/qalc.cc:1543 #: ../src/qalc.cc:1998 ../src/qalc.cc:2078 ../src/qalc.cc:2212 msgid "non-negative" msgstr "positif" #: ../src/qalc.cc:192 msgid "negatve" msgstr "strictement négatif" #: ../src/qalc.cc:194 ../src/qalc.cc:772 ../src/qalc.cc:1541 #: ../src/qalc.cc:1996 ../src/qalc.cc:2076 ../src/qalc.cc:2210 msgid "non-positive" msgstr "négatif" #: ../src/qalc.cc:197 msgid "Unrecognized assumption." msgstr "Hypothèse non reconnue" #: ../src/qalc.cc:336 ../libqalculate/Calculator.cc:8910 #, fuzzy, c-format msgid "It has been %s day(s) since the exchange rates last were updated." msgstr "La dernière mise à jour des taux d'échange date de plus d'une semaine." #: ../src/qalc.cc:341 msgid "Do you wish to update the exchange rates now?" msgstr "" #: ../src/qalc.cc:354 ../src/qalc.cc:355 msgid "" "\n" "Press Enter to continue." msgstr "" "\n" "Appuyez sur Entrée pour continuer" #: ../src/qalc.cc:363 ../src/qalc.cc:364 ../src/qalc.cc:365 ../src/qalc.cc:465 #: ../src/qalc.cc:468 ../src/qalc.cc:590 ../src/qalc.cc:601 ../src/qalc.cc:610 msgid "Illegal value" msgstr "Valeur illégale" #. qalc command #: ../src/qalc.cc:379 ../src/qalc.cc:562 ../src/qalc.cc:1378 #: ../src/qalc.cc:1488 ../src/qalc.cc:1563 ../src/qalc.cc:1566 #: ../src/qalc.cc:1696 ../src/qalc.cc:2095 ../src/qalc.cc:2096 #: ../src/qalc.cc:2277 ../src/qalc.cc:2817 msgid "base" msgstr "" #: ../src/qalc.cc:379 ../src/qalc.cc:381 ../src/qalc.cc:1613 #: ../src/qalc.cc:2137 msgid "input base" msgstr "base de la saisie" #: ../src/qalc.cc:379 msgid "output base" msgstr "base de la sortie" #: ../src/qalc.cc:382 ../src/qalc.cc:1568 ../src/qalc.cc:1615 #: ../src/qalc.cc:2108 ../src/qalc.cc:2145 msgid "roman" msgstr "" #: ../src/qalc.cc:383 ../src/qalc.cc:1570 ../src/qalc.cc:2106 msgid "time" msgstr "temps" #: ../src/qalc.cc:384 ../src/qalc.cc:2102 ../src/qalc.cc:2143 msgid "hex" msgstr "" #: ../src/qalc.cc:384 ../src/qalc.cc:1426 ../src/qalc.cc:2772 msgid "hexadecimal" msgstr "hexadécimal" #: ../src/qalc.cc:385 ../src/qalc.cc:2096 ../src/qalc.cc:2137 msgid "bin" msgstr "" #: ../src/qalc.cc:385 ../src/qalc.cc:1431 ../src/qalc.cc:2781 msgid "binary" msgstr "binaire" #: ../src/qalc.cc:386 ../src/qalc.cc:2098 ../src/qalc.cc:2139 msgid "oct" msgstr "" #: ../src/qalc.cc:386 ../src/qalc.cc:1436 ../src/qalc.cc:2790 msgid "octal" msgstr "" #: ../src/qalc.cc:387 ../src/qalc.cc:2100 ../src/qalc.cc:2141 msgid "dec" msgstr "" #: ../src/qalc.cc:387 msgid "decimal" msgstr "décimal" #: ../src/qalc.cc:388 ../src/qalc.cc:2104 msgid "sex" msgstr "" #: ../src/qalc.cc:388 ../src/qalc.cc:1569 msgid "sexagesimal" msgstr "sexagésimal" #: ../src/qalc.cc:405 ../src/qalc.cc:448 ../src/qalc.cc:1574 #: ../src/qalc.cc:2113 msgid "base display" msgstr "affichage de la base" #: ../src/qalc.cc:410 msgid "Illegal base." msgstr "Base illégale." #: ../src/qalc.cc:418 ../src/qalc.cc:1558 ../src/qalc.cc:2067 msgid "assumptions" msgstr "hypothèses" #: ../src/qalc.cc:428 ../src/qalc.cc:1520 ../src/qalc.cc:2061 msgid "all prefixes" msgstr "tous les préfixes" #: ../src/qalc.cc:429 ../src/qalc.cc:1583 ../src/qalc.cc:2116 msgid "complex numbers" msgstr "nombres complexes" #: ../src/qalc.cc:430 ../src/qalc.cc:1593 ../src/qalc.cc:2121 msgid "excessive parentheses" msgstr "parenthèses en excès" #: ../src/qalc.cc:431 ../src/qalc.cc:1612 ../src/qalc.cc:1729 #: ../src/qalc.cc:2136 msgid "functions" msgstr "fonctions" #: ../src/qalc.cc:432 ../src/qalc.cc:1620 ../src/qalc.cc:2150 msgid "infinite numbers" msgstr "nombres infinis" #: ../src/qalc.cc:433 ../src/qalc.cc:1668 ../src/qalc.cc:2177 msgid "show negative exponents" msgstr "afficher les exposants négatifs" #: ../src/qalc.cc:434 ../src/qalc.cc:1536 ../src/qalc.cc:2064 msgid "assume nonzero denominators" msgstr "supposer que les dénominateurs sont non nuls" #: ../src/qalc.cc:435 ../src/qalc.cc:1537 ../src/qalc.cc:2065 msgid "warn nonzero denominators" msgstr "avertir des dénominateurs non nuls" #: ../src/qalc.cc:436 ../src/qalc.cc:1654 ../src/qalc.cc:2169 msgid "prefixes" msgstr "préfixes" #: ../src/qalc.cc:437 ../src/qalc.cc:1584 ../src/qalc.cc:2117 msgid "denominator prefixes" msgstr "préfixes des dénominateurs" #: ../src/qalc.cc:438 ../src/qalc.cc:1652 ../src/qalc.cc:2167 msgid "place units separately" msgstr "placer les unités séparément" #: ../src/qalc.cc:439 ../src/qalc.cc:1582 ../src/qalc.cc:2115 msgid "calculate variables" msgstr "calculer les variables" #: ../src/qalc.cc:440 ../src/qalc.cc:1581 ../src/qalc.cc:2114 msgid "calculate functions" msgstr "calculer les fonctions" #: ../src/qalc.cc:441 ../src/qalc.cc:1672 ../src/qalc.cc:2181 msgid "sync units" msgstr "synchroniser les unités" #: ../src/qalc.cc:442 ../src/qalc.cc:1662 ../src/qalc.cc:2171 msgid "round to even" msgstr "arrondir au nombre inférieur" #. qalc command #: ../src/qalc.cc:443 ../src/qalc.cc:1381 ../src/qalc.cc:1663 #: ../src/qalc.cc:1709 ../src/qalc.cc:2172 ../src/qalc.cc:2265 msgid "rpn" msgstr "npi" #: ../src/qalc.cc:444 ../src/qalc.cc:1664 ../src/qalc.cc:2173 msgid "rpn syntax" msgstr "syntaxe npi" #: ../src/qalc.cc:445 ../src/qalc.cc:1669 ../src/qalc.cc:2178 msgid "short multiplication" msgstr "multiplication courte" #: ../src/qalc.cc:446 ../src/qalc.cc:1622 ../src/qalc.cc:2153 msgid "lowercase e" msgstr "e minuscule" #: ../src/qalc.cc:447 ../src/qalc.cc:1623 ../src/qalc.cc:2154 msgid "lowercase numbers" msgstr "nombres en minuscules" #: ../src/qalc.cc:451 ../src/qalc.cc:1577 ../src/qalc.cc:2113 msgid "normal" msgstr "" #: ../src/qalc.cc:452 ../src/qalc.cc:1578 ../src/qalc.cc:2113 msgid "alternative" msgstr "" #: ../src/qalc.cc:457 ../src/qalc.cc:486 ../src/qalc.cc:500 ../src/qalc.cc:524 #: ../src/qalc.cc:538 ../src/qalc.cc:552 ../src/qalc.cc:567 ../src/qalc.cc:581 #: ../src/qalc.cc:628 ../src/qalc.cc:637 ../src/qalc.cc:677 ../src/qalc.cc:691 msgid "Illegal value." msgstr "Valeur illégale." #: ../src/qalc.cc:462 ../src/qalc.cc:1671 ../src/qalc.cc:2180 msgid "spell out logical" msgstr "déchiffrement logique" #: ../src/qalc.cc:463 ../src/qalc.cc:1592 ../src/qalc.cc:2119 msgid "dot as separator" msgstr "point comme séparateur" #: ../src/qalc.cc:464 ../src/qalc.cc:1621 ../src/qalc.cc:2152 msgid "limit implicit multiplication" msgstr "limiter les multiplications implicites" #: ../src/qalc.cc:466 ../src/qalc.cc:1670 ../src/qalc.cc:2179 msgid "spacious" msgstr "spacieux" #: ../src/qalc.cc:467 ../src/qalc.cc:1673 ../src/qalc.cc:2182 msgid "unicode" msgstr "" #: ../src/qalc.cc:470 ../src/qalc.cc:1674 ../src/qalc.cc:1731 #: ../src/qalc.cc:2183 msgid "units" msgstr "unités" #: ../src/qalc.cc:471 ../src/qalc.cc:1675 ../src/qalc.cc:2184 msgid "unknowns" msgstr "inconnues" #: ../src/qalc.cc:472 ../src/qalc.cc:1683 ../src/qalc.cc:1730 #: ../src/qalc.cc:2191 msgid "variables" msgstr "" #: ../src/qalc.cc:473 ../src/qalc.cc:1512 ../src/qalc.cc:2059 msgid "abbreviations" msgstr "abréviations" #: ../src/qalc.cc:474 ../src/qalc.cc:1667 ../src/qalc.cc:2176 msgid "show ending zeroes" msgstr "afficher les zéros de fin" #: ../src/qalc.cc:475 ../src/qalc.cc:1619 ../src/qalc.cc:2151 msgid "indicate infinite series" msgstr "indiquer les séries infinies" #: ../src/qalc.cc:476 ../src/qalc.cc:1521 ../src/qalc.cc:2062 msgid "angle unit" msgstr "unité d'angle" #: ../src/qalc.cc:478 ../src/qalc.cc:1523 ../src/qalc.cc:1524 msgid "rad" msgstr "" #: ../src/qalc.cc:478 ../src/qalc.cc:2062 msgid "radians" msgstr "" #: ../src/qalc.cc:479 msgid "deg" msgstr "" #: ../src/qalc.cc:479 ../src/qalc.cc:2062 msgid "degrees" msgstr "degrés" #: ../src/qalc.cc:480 ../src/qalc.cc:1525 msgid "gra" msgstr "gr" #: ../src/qalc.cc:480 ../src/qalc.cc:2062 msgid "gradians" msgstr "grades" #: ../src/qalc.cc:491 ../src/qalc.cc:1645 ../src/qalc.cc:2166 #: ../src/qalc.cc:2318 #, fuzzy msgid "parsing mode" msgstr "mode exp" #: ../src/qalc.cc:493 ../src/qalc.cc:1647 ../src/qalc.cc:2166 #: ../src/qalc.cc:2326 #, fuzzy msgid "adaptive" msgstr "strictement positif" #: ../src/qalc.cc:494 ../src/qalc.cc:1648 ../src/qalc.cc:2166 #: ../src/qalc.cc:2323 msgid "implicit first" msgstr "" #: ../src/qalc.cc:495 ../src/qalc.cc:1649 ../src/qalc.cc:2166 #: ../src/qalc.cc:2320 #, fuzzy msgid "conventional" msgstr "optionnel" #: ../src/qalc.cc:505 ../src/qalc.cc:938 ../src/qalc.cc:1676 #: ../src/qalc.cc:2185 msgid "update exchange rates" msgstr "" #: ../src/qalc.cc:506 ../src/qalc.cc:1679 ../src/qalc.cc:2187 msgid "never" msgstr "" #: ../src/qalc.cc:508 ../src/qalc.cc:1678 ../src/qalc.cc:2186 msgid "ask" msgstr "" #: ../src/qalc.cc:515 ../src/qalc.cc:1638 ../src/qalc.cc:2165 msgid "multiplication sign" msgstr "signe de multiplication" #: ../src/qalc.cc:529 ../src/qalc.cc:1585 ../src/qalc.cc:2118 msgid "division sign" msgstr "signe de division" #: ../src/qalc.cc:543 ../src/qalc.cc:1529 ../src/qalc.cc:2063 msgid "approximation" msgstr "approximation" #. qalc command #: ../src/qalc.cc:545 ../src/qalc.cc:587 ../src/qalc.cc:670 ../src/qalc.cc:1411 #: ../src/qalc.cc:1531 ../src/qalc.cc:1607 ../src/qalc.cc:1699 #: ../src/qalc.cc:2063 ../src/qalc.cc:2120 ../src/qalc.cc:2135 #: ../src/qalc.cc:2281 msgid "exact" msgstr "" #: ../src/qalc.cc:546 ../src/qalc.cc:1532 ../src/qalc.cc:2063 msgid "try exact" msgstr "essayer le calcul exact" #. qalc command #: ../src/qalc.cc:547 ../src/qalc.cc:796 ../src/qalc.cc:1417 #: ../src/qalc.cc:1533 ../src/qalc.cc:1694 ../src/qalc.cc:1924 #: ../src/qalc.cc:1934 ../src/qalc.cc:2022 ../src/qalc.cc:2063 #: ../src/qalc.cc:2285 msgid "approximate" msgstr "approximer" #: ../src/qalc.cc:557 ../src/qalc.cc:1559 ../src/qalc.cc:2095 msgid "autoconversion" msgstr "" #: ../src/qalc.cc:560 ../src/qalc.cc:1482 msgid "best" msgstr "meilleur" #: ../src/qalc.cc:561 ../src/qalc.cc:1482 ../src/qalc.cc:1562 #: ../src/qalc.cc:2095 ../src/qalc.cc:2808 #, fuzzy msgid "optimal" msgstr "optionnel" #: ../src/qalc.cc:572 ../src/qalc.cc:1513 ../src/qalc.cc:2060 msgid "algebra mode" msgstr "mode algébrique" #. qalc command #: ../src/qalc.cc:575 ../src/qalc.cc:1505 ../src/qalc.cc:1516 #: ../src/qalc.cc:1714 ../src/qalc.cc:2043 ../src/qalc.cc:2060 msgid "simplify" msgstr "simplifier" #: ../src/qalc.cc:576 ../src/qalc.cc:1517 ../src/qalc.cc:2060 msgid "factorize" msgstr "factoriser" #: ../src/qalc.cc:598 ../src/qalc.cc:1666 ../src/qalc.cc:1712 #: ../src/qalc.cc:2175 msgid "save mode" msgstr "enregistrer le mode" #: ../src/qalc.cc:607 ../src/qalc.cc:1665 ../src/qalc.cc:1711 #: ../src/qalc.cc:2174 msgid "save definitions" msgstr "enregistrer les définitions" #: ../src/qalc.cc:616 ../src/qalc.cc:1594 ../src/qalc.cc:2122 msgid "exp mode" msgstr "mode exp" #: ../src/qalc.cc:619 ../src/qalc.cc:1597 ../src/qalc.cc:2124 msgid "auto" msgstr "" #: ../src/qalc.cc:620 ../src/qalc.cc:1598 ../src/qalc.cc:2128 msgid "pure" msgstr "pur" #: ../src/qalc.cc:621 ../src/qalc.cc:1599 ../src/qalc.cc:2130 msgid "scientific" msgstr "scientifique" #: ../src/qalc.cc:622 ../src/qalc.cc:1600 ../src/qalc.cc:2126 msgid "engineering" msgstr "" #: ../src/qalc.cc:633 ../src/qalc.cc:1653 ../src/qalc.cc:2168 msgid "precision" msgstr "précision" #: ../src/qalc.cc:642 ../src/qalc.cc:1624 ../src/qalc.cc:2155 msgid "max decimals" msgstr "décimales max" #: ../src/qalc.cc:654 ../src/qalc.cc:1631 ../src/qalc.cc:2160 msgid "min decimals" msgstr "décimales min" #: ../src/qalc.cc:667 ../src/qalc.cc:1604 ../src/qalc.cc:2135 msgid "fractions" msgstr "" #: ../src/qalc.cc:672 ../src/qalc.cc:1609 ../src/qalc.cc:2135 msgid "combined" msgstr "combiné" #: ../src/qalc.cc:682 ../src/qalc.cc:1655 ../src/qalc.cc:2170 msgid "read precision" msgstr "précision de saisie" #: ../src/qalc.cc:685 ../src/qalc.cc:1658 ../src/qalc.cc:2170 msgid "always" msgstr "toujours" #: ../src/qalc.cc:686 ../src/qalc.cc:1659 ../src/qalc.cc:2170 msgid "when decimals" msgstr "si décimales" #: ../src/qalc.cc:710 msgid "Unrecognized option." msgstr "Option inconnue" #: ../src/qalc.cc:742 msgid "Variables:" msgstr "" #: ../src/qalc.cc:744 #, fuzzy msgid "Name" msgstr "Noms" #: ../src/qalc.cc:745 ../src/qalc.cc:2018 msgid "Value" msgstr "Valeur" #: ../src/qalc.cc:761 ../src/qalc.cc:1985 ../libqalculate/Function.cc:1863 msgid "matrix" msgstr "matrice" #: ../src/qalc.cc:763 ../src/qalc.cc:1987 ../libqalculate/Function.cc:1802 msgid "vector" msgstr "vecteur" #: ../src/qalc.cc:773 ../src/qalc.cc:1542 ../src/qalc.cc:1997 #: ../src/qalc.cc:2074 ../src/qalc.cc:2208 msgid "negative" msgstr "négatif" #: ../src/qalc.cc:790 ../src/qalc.cc:2014 msgid "default assumptions" msgstr "hypothèses par défaut" #: ../src/qalc.cc:811 #, fuzzy msgid "Functions:" msgstr "Fonction" #: ../src/qalc.cc:825 #, fuzzy msgid "Units:" msgstr "Unité" #: ../src/qalc.cc:832 msgid "No local variables, functions or units have been defined." msgstr "" #: ../src/qalc.cc:837 ../src/qalc.cc:897 #, fuzzy msgid "" "For more information about a specific function, variable or unit, please use " "the info command (in interactive mode)." msgstr "" "Tapez info NOM pour obtenir de l'information sur une fonction, variable ou " "unité (exemple : info sin)." #: ../src/qalc.cc:932 msgid "usage: qalc [options] [expression]" msgstr "" #: ../src/qalc.cc:934 msgid "where options are:" msgstr "où les options sont :" #: ../src/qalc.cc:935 ../src/qalc.cc:1696 msgid "BASE" msgstr "" #: ../src/qalc.cc:936 msgid "set the result number base" msgstr "" #: ../src/qalc.cc:939 msgid "FILE" msgstr "FICHIER" #: ../src/qalc.cc:940 msgid "executes commands from a file first" msgstr "commencer par exécuter les commandes dans un fichier" #: ../src/qalc.cc:942 msgid "start in interactive mode" msgstr "" #: ../src/qalc.cc:944 #, fuzzy msgid "displays a list of all user-defined variables, functions and units." msgstr "\"%s\" n'est pas une variable/fonction/unité valide." #: ../src/qalc.cc:946 msgid "displays a list of all functions." msgstr "" #: ../src/qalc.cc:948 msgid "displays a list of all units." msgstr "" #: ../src/qalc.cc:950 msgid "displays a list of all variables." msgstr "" #: ../src/qalc.cc:952 #, 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:954 msgid "do not load any global currencies from file" msgstr "" #: ../src/qalc.cc:956 msgid "do not load any global data sets from file" msgstr "" #: ../src/qalc.cc:958 #, fuzzy msgid "do not load any global functions from file" msgstr "Échec du chargement des définitions globales!" #: ../src/qalc.cc:960 msgid "do not load any global units from file" msgstr "" #: ../src/qalc.cc:962 msgid "do not load any global variables from file" msgstr "" #: ../src/qalc.cc:964 msgid "reduces output to just the result of the input expression" msgstr "" #: ../src/qalc.cc:965 ../src/qalc.cc:1713 msgid "OPTION" msgstr "" #: ../src/qalc.cc:965 ../src/qalc.cc:1713 msgid "VALUE" msgstr "VALEUR" #: ../src/qalc.cc:966 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:968 msgid "turn on/off unicode support" msgstr "activer/désactiver le support de l'unicode" #: ../src/qalc.cc:970 #, fuzzy msgid "" "The program will start in interactive mode if no expression and no file is " "specified (or interactive mode is explicitly selected)." msgstr "" "Le programme démarrera en mode interactif si aucune expression n'est " "indiquée." #: ../src/qalc.cc:1015 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:1023 msgid "No file specified." msgstr "Aucun fichier indiqué." #: ../src/qalc.cc:1074 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:1082 msgid "ans" msgstr "" #: ../src/qalc.cc:1083 ../src/qalc.cc:1086 ../src/qalc.cc:1087 #: ../src/qalc.cc:1088 ../src/qalc.cc:1089 ../src/qalc.cc:1310 #: ../libqalculate/Calculator.cc:7713 ../libqalculate/Calculator.cc:7729 msgid "Temporary" msgstr "Temporaire" #: ../src/qalc.cc:1083 msgid "Last Answer" msgstr "Dernière réponse" #: ../src/qalc.cc:1084 msgid "answer" msgstr "réponse" #: ../src/qalc.cc:1086 msgid "Answer 2" msgstr "Réponse 2" #: ../src/qalc.cc:1087 msgid "Answer 3" msgstr "Réponse 3" #: ../src/qalc.cc:1088 msgid "Answer 4" msgstr "Réponse 4" #: ../src/qalc.cc:1089 msgid "Answer 5" msgstr "Réponse 5" #: ../src/qalc.cc:1100 msgid "Failed to load global definitions!" msgstr "Échec du chargement des définitions globales!" #: ../src/qalc.cc:1139 #, c-format msgid "Could not open \"%s\".\n" msgstr "Impossible d'ouvrir \"%s\".\n" #: ../src/qalc.cc:1162 ../src/qalc.cc:1212 ../src/qalc.cc:2345 #, 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:1272 ../src/qalc.cc:1713 ../src/qalc.cc:2047 msgid "set" msgstr "définir" #. qalc command #: ../src/qalc.cc:1276 ../src/qalc.cc:1710 ../src/qalc.cc:2231 msgid "save" msgstr "enregistrer" #: ../src/qalc.cc:1276 ../src/qalc.cc:1710 ../src/qalc.cc:2231 msgid "store" msgstr "stocker" #. qalc command #: ../src/qalc.cc:1279 ../src/qalc.cc:1508 ../src/qalc.cc:1708 #: ../src/qalc.cc:2244 msgid "mode" msgstr "" #: ../src/qalc.cc:1281 msgid "mode saved" msgstr "mode enregistré" #: ../src/qalc.cc:1283 msgid "definitions" msgstr "définitions" #: ../src/qalc.cc:1285 msgid "definitions saved" msgstr "définitions enregistrées" #: ../src/qalc.cc:1332 ../src/qalc.cc:1334 #, c-format msgid "Illegal name. Save as %s instead (default: no)?" msgstr "Nom illégal. Enregistrer comme %s à la place (défaut : non)?" #: ../src/qalc.cc:1341 msgid "" "An unit or variable with the same name already exists.\n" "Do you want to overwrite it (default: no)?" msgstr "" "Une unité ou une variable du même nom existe déjà.\n" "Voulez-vous l'écraser? (défaut : non)" #. qalc command #: ../src/qalc.cc:1364 ../src/qalc.cc:1698 ../src/qalc.cc:2238 msgid "delete" msgstr "" #: ../src/qalc.cc:1371 #, fuzzy msgid "No user-defined variable with the specified name exist." msgstr "Aucune fonction, variable ou unité avec le nom indiqué n'existe." #. qalc command #: ../src/qalc.cc:1374 ../src/qalc.cc:1695 ../src/qalc.cc:2198 msgid "assume" msgstr "supposer" #. qalc command #: ../src/qalc.cc:1384 ../src/qalc.cc:1390 ../src/qalc.cc:1700 #: ../src/qalc.cc:2261 msgid "exrates" msgstr "taux d'échange" #. qalc command #: ../src/qalc.cc:1394 ../src/qalc.cc:1715 ../src/qalc.cc:2273 msgid "stack" msgstr "pile" #: ../src/qalc.cc:1396 msgid "The RPN stack is empty." msgstr "La pile NPI est vide." #. qalc command #: ../src/qalc.cc:1408 ../src/qalc.cc:1697 ../src/qalc.cc:2269 msgid "clear stack" msgstr "vider la pile" #. qalc command #: ../src/qalc.cc:1423 ../src/qalc.cc:1716 ../src/qalc.cc:2289 msgid "convert" msgstr "convertir" #: ../src/qalc.cc:1423 ../src/qalc.cc:1716 ../src/qalc.cc:2289 #: ../src/qalc.cc:2310 msgid "to" msgstr "vers" #: ../src/qalc.cc:1441 ../src/qalc.cc:2805 msgid "bases" msgstr "" #: ../src/qalc.cc:1474 ../src/qalc.cc:2799 #, fuzzy msgid "fraction" msgstr "fonction" #: ../src/qalc.cc:1480 ../src/qalc.cc:2802 #, fuzzy msgid "factors" msgstr "facteur" #. qalc command #: ../src/qalc.cc:1502 ../src/qalc.cc:1705 ../src/qalc.cc:2039 msgid "factor" msgstr "facteur" #. qalc command #: ../src/qalc.cc:1686 ../src/qalc.cc:2036 msgid "help" msgstr "aide" #: ../src/qalc.cc:1689 #, fuzzy msgid "Enter a mathematical expression or a command and press enter." msgstr "Entrez une expression mathématique ou une commande." #: ../src/qalc.cc:1690 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:1692 msgid "Available commands are:" msgstr "Les commandes disponibles sont :" #: ../src/qalc.cc:1695 msgid "ASSUMPTIONS" msgstr "HYPOTHÈSES" #: ../src/qalc.cc:1698 ../src/qalc.cc:1710 msgid "NAME" msgstr "NOM" #: ../src/qalc.cc:1702 msgid "WGET ARGUMENTS" msgstr "ARGUMENTS DE WGET" #. qalc command #: ../src/qalc.cc:1706 ../src/qalc.cc:1734 ../src/qalc.cc:2255 #: ../libqalculate/Calculator.cc:8360 ../libqalculate/DataSet.cc:355 #: ../libqalculate/DataSet.cc:382 ../libqalculate/DataSet.cc:1032 msgid "info" msgstr "" #. qalc command #: ../src/qalc.cc:1707 ../src/qalc.cc:1723 ../src/qalc.cc:1725 #: ../src/qalc.cc:2248 msgid "list" msgstr "" #: ../src/qalc.cc:1709 msgid "ON/OFF" msgstr "MARCHE/ARRÊT" #: ../src/qalc.cc:1710 msgid "CATEGORY" msgstr "CATÉGORIE" #: ../src/qalc.cc:1710 msgid "TITLE" msgstr "TITRE" #: ../src/qalc.cc:1716 msgid "UNIT or \"TO\" COMMAND" msgstr "" #. qalc command #: ../src/qalc.cc:1717 ../src/qalc.cc:2314 ../src/qalc.cc:2335 msgid "quit" msgstr "quitter" #: ../src/qalc.cc:1717 ../src/qalc.cc:2314 ../src/qalc.cc:2335 msgid "exit" msgstr "sortir" #: ../src/qalc.cc:1718 msgid "Type help COMMAND for more information (example: help save)." msgstr "Tapez help COMMANDE pour plus d'aide (exemple : help save)." #: ../src/qalc.cc:1719 msgid "" "Type info NAME for information 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:1720 msgid "" "For more information about mathematical expression, different options, and a " "complete list of functions, variables and units, see the relevant sections " "in the manual of the graphical user interface (available at http://qalculate." "github.io/manual/index.html)." msgstr "" #: ../src/qalc.cc:1742 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:1752 msgid "Function" msgstr "Fonction" #: ../src/qalc.cc:1779 ../libqalculate/Function.cc:189 msgid "argument" msgstr "" #: ../src/qalc.cc:1803 #, 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:1816 msgid "Arguments" msgstr "" #. optional argument, in description #: ../src/qalc.cc:1833 msgid "optional" msgstr "optionnel" #. argument default, in description #: ../src/qalc.cc:1837 msgid "default: " msgstr "défaut :" #: ../src/qalc.cc:1848 msgid "Requirement" msgstr "Exigences" #: ../src/qalc.cc:1856 msgid "Properties" msgstr "Propiétés" #: ../src/qalc.cc:1871 msgid "key" msgstr "touche" #: ../src/qalc.cc:1889 ../src/qalc.cc:1892 msgid "Unit" msgstr "Unité" #: ../src/qalc.cc:1895 ../src/qalc.cc:1963 msgid "Names" msgstr "Noms" #: ../src/qalc.cc:1913 msgid "Base Unit" msgstr "Unité de base" #: ../src/qalc.cc:1920 msgid "Relation" msgstr "" #: ../src/qalc.cc:1930 msgid "Inverse Relation" msgstr "Relation Inverse" #: ../src/qalc.cc:1942 msgid "Base Units" msgstr "Unités de base" #: ../src/qalc.cc:1957 ../src/qalc.cc:1960 msgid "Variable" msgstr "" #: ../src/qalc.cc:1975 msgid "a previous result" msgstr "un résultat précédent" #: ../src/qalc.cc:2041 msgid "Factorizes the current result." msgstr "Factorise le résultat courant." #: ../src/qalc.cc:2045 msgid "Simplifies the current result." msgstr "Simplifie le résultat courant." #: ../src/qalc.cc:2055 msgid "Sets the value of an option." msgstr "Définit la valeur d'une option." #: ../src/qalc.cc:2057 msgid "Available options and accepted values are:" msgstr "Les options disponibles et les valeurs acceptées sont :" #: ../src/qalc.cc:2188 msgid "days" msgstr "" #: ../src/qalc.cc:2192 msgid "The current value is marked with '*'." msgstr "" #: ../src/qalc.cc:2194 msgid "Example: set base 16." msgstr "Exemple : set base 16." #: ../src/qalc.cc:2196 msgid "Some options have additional help text (e.g. help parsing mode)." msgstr "" #: ../src/qalc.cc:2200 msgid "Set default assumptions for unknown variables." msgstr "Définit les hypothèses par défaut pour les variables inconnues." #: ../src/qalc.cc:2233 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:2234 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:2236 msgid "Example: store var1." msgstr "Exemple : store var1" #: ../src/qalc.cc:2240 #, fuzzy msgid "Removes the user-defined variable with the specified name." msgstr "Aucune fonction, variable ou unité avec le nom indiqué n'existe." #: ../src/qalc.cc:2242 #, fuzzy msgid "Example: delete var1." msgstr "Exemple : store var1" #: ../src/qalc.cc:2246 msgid "Displays the current mode." msgstr "Affiche le mode courant." #: ../src/qalc.cc:2250 #, fuzzy msgid "Displays a list of all user-defined variables, functions and units." msgstr "\"%s\" n'est pas une variable/fonction/unité valide." #: ../src/qalc.cc:2251 msgid "" "Enter with argument 'functions', 'variables' or 'units' to show a list of " "all functions, variables or units." msgstr "" #: ../src/qalc.cc:2253 #, fuzzy msgid "Example: list functions." msgstr "Exemple : info sin" #: ../src/qalc.cc:2257 msgid "Displays information about a function, variable or unit." msgstr "Affiche l'information sur une fonction, une variable ou une unité." #: ../src/qalc.cc:2259 msgid "Example: info sin." msgstr "Exemple : info sin" #: ../src/qalc.cc:2263 msgid "Downloads current exchange rates from the Internet." msgstr "Télécharge les taux d'échange courants sur Internet." #: ../src/qalc.cc:2267 msgid "(De)activates the Reverse Polish Notation mode." msgstr "(Dés)active le mode Notation Polonaise Inversée." #: ../src/qalc.cc:2271 msgid "Clears the RPN stack." msgstr "Vide la pile NPI." #: ../src/qalc.cc:2275 msgid "Displays the RPN stack." msgstr "Affiche la pile NPI." #: ../src/qalc.cc:2279 msgid "Sets the result number base (equivalent to set base)." msgstr "" #: ../src/qalc.cc:2283 msgid "Equivalent to set approximation exact." msgstr "" #: ../src/qalc.cc:2287 msgid "Equivalent to set approximation try exact." msgstr "" #: ../src/qalc.cc:2291 #, fuzzy msgid "Converts units or changes number base in current result." msgstr "Convertit les unités dans le résultat courant." #: ../src/qalc.cc:2293 #, fuzzy msgid "Possible values:" msgstr "Les valeurs d'unité possibles sont :" #: ../src/qalc.cc:2295 msgid "a unit (e.g. meter, prepend with ? to request the optimal prefix)" msgstr "" #: ../src/qalc.cc:2296 #, fuzzy msgid "a unit expression (e.g. km/h)" msgstr "une expression d'unités (exemple : km/h)" #: ../src/qalc.cc:2297 msgid "base (convert to base units)" msgstr "base (convertit en unités de base)" #: ../src/qalc.cc:2298 #, fuzzy msgid "optimal (convert to optimal unit)" msgstr "base (convertit en unités de base)" #: ../src/qalc.cc:2300 msgid "bin / binary (show as binary number)" msgstr "" #: ../src/qalc.cc:2301 msgid "oct / octal (show as octal number)" msgstr "" #: ../src/qalc.cc:2302 msgid "hex / hexadecimal (show as hexadecimal number)" msgstr "" #: ../src/qalc.cc:2303 msgid "bases (show as binary, octal, decimal and hexadecimal number)" msgstr "" #: ../src/qalc.cc:2305 msgid "fraction (show result in combined fractional format)" msgstr "" #: ../src/qalc.cc:2306 #, fuzzy msgid "factors (factorize result)" msgstr "Factorise le résultat courant." #: ../src/qalc.cc:2308 #, fuzzy msgid "Example: to ?g" msgstr "Exemple : store var1" #: ../src/qalc.cc:2311 msgid "" "This command can also be typed directly at the end of the mathematical " "expression." msgstr "" #: ../src/qalc.cc:2316 msgid "Terminates this program." msgstr "Termine ce programme." #: ../src/qalc.cc:2321 msgid "" "Implicit multiplication does not differ from explicit multiplication " "(\"12/2(1+2) = 12/2*3 = 18\", \"5x/5y = 5*x/5*y = xy\")." msgstr "" #: ../src/qalc.cc:2324 msgid "" "Implicit multiplication is parsed before explicit multiplication " "(\"12/2(1+2) = 12/(2*3) = 2\", \"5x/5y = (5*x)/(5*y) = x/y\")." msgstr "" #: ../src/qalc.cc:2327 msgid "" "The default adaptive mode works as the \"implicit first\" mode, unless " "spaces are found (\"1/5x = 1/(5*x)\", but \"1/5 x = (1/5)*x\"). In the " "adaptive mode unit expressions are parsed separately (\"5 m/5 m/s = (5*m)/" "(5*(m/s)) = 1 s\")." msgstr "" #: ../src/qalc.cc:2329 msgid "" "Function arguments without parentheses are an exception, where implicit " "multiplication in front of variables and units is parsed first regardless of " "mode (\"sqrt 2x = sqrt(2x)\")." msgstr "" #: ../src/qalc.cc:2380 msgid "error" msgstr "erreur" #: ../src/qalc.cc:2382 msgid "warning" msgstr "avertissement" #: ../src/qalc.cc:2437 ../libqalculate/Calculator.cc:8740 #: ../libqalculate/MathStructure.cc:483 ../libqalculate/MathStructure.cc:730 msgid "aborted" msgstr "interrompu" #: ../src/qalc.cc:2468 msgid "RPN Register Moved" msgstr "Registre NPI déplacé" #: ../src/qalc.cc:2508 msgid "Processing (press Enter to abort)" msgstr "Calcul en cours (appuyez sur Entrée pour interrompre)" #: ../src/qalc.cc:2581 ../src/qalc.cc:3071 msgid "approx." msgstr "" #: ../src/qalc.cc:2693 msgid "Factorizing (press Enter to abort)" msgstr "Factorisation en cours (appuyez sur Entrée pour interrompre)" #: ../src/qalc.cc:2697 msgid "Simplifying (press Enter to abort)" msgstr "Simplification en cours (appuyez sur Entrée pour interrompre)" #: ../src/qalc.cc:2958 msgid "Calculating (press Enter to abort)" msgstr "Calcul en cours (appuyez sur Entrée pour interrompre)" #: ../src/qalc.cc:3031 msgid "RPN Operation" msgstr "Opération NPI" #: ../src/qalc.cc:3414 #, c-format msgid "" "Couldn't write preferences to\n" "%s" msgstr "" "Impossible d'écrire les préférences pour\n" " %s" #: ../src/qalc.cc:3492 msgid "Couldn't write definitions" msgstr "Impossible d'écrire les définitions" #: ../libqalculate/BuiltinFunctions.cc:59 #, 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:121 #: ../libqalculate/BuiltinFunctions.cc:181 #, c-format msgid "Row %s does not exist in matrix." msgstr "La ligne %s n'existe pas dans la matrice." #: ../libqalculate/BuiltinFunctions.cc:134 #: ../libqalculate/BuiltinFunctions.cc:177 #, c-format msgid "Column %s does not exist in matrix." msgstr "La colonne %s n'existe pas dans la matrice." #: ../libqalculate/BuiltinFunctions.cc:192 #, c-format msgid "Argument 3, %s, is ignored for vectors." msgstr "Le troisième argument, %s, est ignoré pour les vecteurs." #: ../libqalculate/BuiltinFunctions.cc:196 #: ../libqalculate/BuiltinFunctions.cc:217 #, c-format msgid "Element %s does not exist in vector." msgstr "L'élément %s n'existe pas dans le vecteur." #: ../libqalculate/BuiltinFunctions.cc:405 #, 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:1243 #, c-format msgid "Argument for %s() must be a real number greater than or equal to -1/e." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:2113 #: ../libqalculate/BuiltinFunctions.cc:2156 #, c-format msgid "Unsolvable comparison in %s()." msgstr "Comparaison impossible à résoudre dans %s()." #: ../libqalculate/BuiltinFunctions.cc:2274 ../libqalculate/util.cc:52 msgid "now" msgstr "maintenant" #: ../libqalculate/BuiltinFunctions.cc:2286 #, 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:2319 #: ../libqalculate/BuiltinFunctions.cc:2332 #: ../libqalculate/BuiltinFunctions.cc:2345 #: ../libqalculate/BuiltinFunctions.cc:2367 #: ../libqalculate/BuiltinFunctions.cc:2388 #, c-format msgid "Error in date format for function %s()." msgstr "Erreur dans le format de date pour la fonction %s()." #: ../libqalculate/BuiltinFunctions.cc:2642 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:2937 #: ../libqalculate/BuiltinFunctions.cc:2954 msgid "Comparison failed." msgstr "La comparaison a échoué." #: ../libqalculate/BuiltinFunctions.cc:2942 #: ../libqalculate/BuiltinFunctions.cc:2972 msgid "No matching item found." msgstr "Aucun élément correspondant trouvé." #: ../libqalculate/BuiltinFunctions.cc:3054 #, c-format msgid "Object %s does not exist." msgstr "L'objet %s n'existe pas." #: ../libqalculate/BuiltinFunctions.cc:3081 #, 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:3124 #, c-format msgid "" "The %s function is incomplete, unreliable and unstable. Use at your own risk " "and avoid complex expressions." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:3135 #: ../libqalculate/BuiltinFunctions.cc:3146 #, fuzzy msgid "Unable to integrate the expression." msgstr "Impossible d'isoler %s." #: ../libqalculate/BuiltinFunctions.cc:3141 msgid "" "Both the lower and upper limit must be set to get the definite integral." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:3282 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:3329 #, 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:3333 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:3337 #, c-format msgid "Was unable to completely isolate %s." msgstr "Impossible d'isoler complètement %s." #: ../libqalculate/BuiltinFunctions.cc:3341 #: ../libqalculate/BuiltinFunctions.cc:3469 #: ../libqalculate/BuiltinFunctions.cc:3564 #, 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:3345 #, c-format msgid "Was unable to isolate %s." msgstr "Impossible d'isoler %s." #: ../libqalculate/BuiltinFunctions.cc:3428 #: ../libqalculate/BuiltinFunctions.cc:3455 #: ../libqalculate/BuiltinFunctions.cc:3538 #, 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:3431 #: ../libqalculate/BuiltinFunctions.cc:3458 #: ../libqalculate/BuiltinFunctions.cc:3541 #, 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:3464 #: ../libqalculate/BuiltinFunctions.cc:3549 #, c-format msgid "The solution requires that %s." msgstr "La solution exige que %s." #: ../libqalculate/BuiltinFunctions.cc:3557 #, c-format msgid "Solution %s requires that %s." msgstr "La solution %s exige que %s." #: ../libqalculate/BuiltinFunctions.cc:3625 #, c-format msgid "" "Unable to isolate %s.\n" "\n" "You might need to place the equations and variables in an appropriate order " "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:3627 #: ../libqalculate/BuiltinFunctions.cc:3641 #: ../libqalculate/BuiltinFunctions.cc:3650 #, c-format msgid "Unable to isolate %s." msgstr "Impossible d'isoler %s." #: ../libqalculate/BuiltinFunctions.cc:3634 #, c-format msgid "Inequalities is not allowed in %s()." msgstr "Les inégalités ne sont pas autorisées dans %s." #: ../libqalculate/Calculator.cc:322 msgid "per" msgstr "par" #: ../libqalculate/Calculator.cc:324 msgid "times" msgstr "fois" #: ../libqalculate/Calculator.cc:326 msgid "plus" msgstr "" #: ../libqalculate/Calculator.cc:328 msgid "minus" msgstr "moins" #: ../libqalculate/Calculator.cc:330 ../libqalculate/MathStructure.cc:11628 #: ../libqalculate/Function.cc:1146 ../libqalculate/Function.cc:1154 #: ../libqalculate/Function.cc:1563 ../libqalculate/Function.cc:1707 msgid "and" msgstr "et" #: ../libqalculate/Calculator.cc:334 ../libqalculate/DataSet.cc:1066 #: ../libqalculate/DataSet.cc:1129 ../libqalculate/MathStructure.cc:11642 #: ../libqalculate/Function.cc:2022 ../libqalculate/Function.cc:2038 msgid "or" msgstr "ou" #: ../libqalculate/Calculator.cc:378 ../libqalculate/Calculator.cc:1092 #: ../libqalculate/Calculator.cc:2232 ../libqalculate/Calculator.cc:2237 #: ../libqalculate/Calculator.cc:2238 msgid " to " msgstr " à " #: ../libqalculate/Calculator.cc:445 msgid "Gradians unit is missing. Creating one for this session." msgstr "L'unité grade manque. Création pour cette session." #: ../libqalculate/Calculator.cc:446 ../libqalculate/Calculator.cc:454 #: ../libqalculate/Calculator.cc:462 msgid "Angle/Plane Angle" msgstr "Angle Plan/Solide" #: ../libqalculate/Calculator.cc:453 msgid "Radians unit is missing. Creating one for this session." msgstr "L'unité radian manque. Création pour cette session." #: ../libqalculate/Calculator.cc:461 msgid "Degrees unit is missing. Creating one for this session." msgstr "L'unité degré manque. Création pour cette session." #: ../libqalculate/Calculator.cc:1439 ../libqalculate/Calculator.cc:8795 msgid "Currency" msgstr "Devise" #: ../libqalculate/Calculator.cc:1440 ../libqalculate/Calculator.cc:1442 #: ../libqalculate/Calculator.cc:1443 #, fuzzy msgid "Temperature" msgstr "Temporaire" #: ../libqalculate/Calculator.cc:2197 msgid "calculating..." msgstr "calculs en cours..." #: ../libqalculate/Calculator.cc:2428 ../libqalculate/Calculator.cc:2436 msgid "" "Cannot convert to unit expression that includes degrees Celsius or " "Fahrenheit in addition to other units, prefixes or exponents." msgstr "" #: ../libqalculate/Calculator.cc:2445 ../libqalculate/Calculator.cc:2450 #: ../libqalculate/Calculator.cc:2455 msgid "Cannot convert the expression to degrees Celsius or Fahrenheit." msgstr "" #: ../libqalculate/Calculator.cc:3374 #, 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:3391 #, 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:3407 #, 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:4615 ../libqalculate/Calculator.cc:5378 #: ../libqalculate/Calculator.cc:5390 ../libqalculate/Calculator.cc:5415 #: ../libqalculate/Calculator.cc:5441 #, c-format msgid "Misplaced operator(s) \"%s\" ignored" msgstr "Opérateur(s) mal placé(s), \"%s\" ignoré" #: ../libqalculate/Calculator.cc:4639 ../libqalculate/Calculator.cc:5465 #, c-format msgid "Misplaced '%c' ignored" msgstr "L'élément mal placé '%c' ignoré" #: ../libqalculate/Calculator.cc:4666 ../libqalculate/Function.cc:1293 #: ../libqalculate/Function.cc:1324 #, c-format msgid "Internal id %s does not exist." msgstr "L'identificateur interne %s n'existe pas." #: ../libqalculate/Calculator.cc:4684 #, c-format msgid "\"%s\" is not a valid variable/function/unit." msgstr "\"%s\" n'est pas une variable/fonction/unité valide." #: ../libqalculate/Calculator.cc:4699 #, 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:5076 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:5079 msgid "Unused stack values." msgstr "Valeurs de pile inutilisées." #: ../libqalculate/Calculator.cc:5118 ../libqalculate/Calculator.cc:5186 #, fuzzy, c-format msgid "RPN syntax error. Operator '%c' not supported." msgstr "Erreur de syntaxe NPI. La pile est vide." #: ../libqalculate/Calculator.cc:5146 msgid "RPN syntax error. Stack is empty." msgstr "Erreur de syntaxe NPI. La pile est vide." #: ../libqalculate/Calculator.cc:5148 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:5664 #, c-format msgid "Name \"%s\" is in use. Replacing with \"%s\"." msgstr "Le nom \"%s\" est utilisé. Remplacement par \"%s\"." #: ../libqalculate/Calculator.cc:6360 ../libqalculate/DataSet.cc:535 #, 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:8343 ../libqalculate/DataSet.cc:353 msgid "Object" msgstr "Objet" #: ../libqalculate/Calculator.cc:8352 ../libqalculate/DataSet.cc:354 msgid "Property" msgstr "Propriété" #: ../libqalculate/Calculator.cc:8645 msgid "column" msgstr "colonne" #: ../libqalculate/Calculator.cc:8648 msgid "Column " msgstr "Colonne" #: ../libqalculate/Calculator.cc:8739 ../libqalculate/Calculator.cc:8743 msgid "timed out" msgstr "délai expiré" #: ../libqalculate/Calculator.cc:8901 msgid "Failed to download exchange rates from ECB." msgstr "Échec du téléchargement des taux d'échange sur ECB." #: ../libqalculate/Calculator.cc:8961 ../libqalculate/Calculator.cc:8975 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:8991 ../libqalculate/Calculator.cc:9005 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:9051 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:9068 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:9261 #, c-format msgid "Could not create temporary file %s" msgstr "Impossible de créer le fichier temporaire %s" #: ../libqalculate/Calculator.cc:9302 msgid "It took too long to generate the plot data." msgstr "" #: ../libqalculate/Calculator.cc:9316 #, 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:9318 #, 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:9344 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:379 #, 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:389 #, 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:394 #, 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:513 ../libqalculate/DataSet.cc:521 #, c-format msgid "Unable to load data objects in %s." msgstr "Impossible de charger les objets de données dans %s." #: ../libqalculate/DataSet.cc:1036 msgid "data property" msgstr "propriété des données" #: ../libqalculate/DataSet.cc:1038 msgid "name of a data property" msgstr "nom d'une propriété de données" #: ../libqalculate/DataSet.cc:1046 ../libqalculate/DataSet.cc:1062 msgid "no properties available" msgstr "aucune propriété n'est disponible" #: ../libqalculate/DataSet.cc:1096 #, 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:1101 msgid "data object" msgstr "objet de données" #: ../libqalculate/DataSet.cc:1103 msgid "an object from" msgstr "un objet de" #: ../libqalculate/DataSet.cc:1132 msgid "use" msgstr "utilisation" #: ../libqalculate/MathStructure.cc:94 ../libqalculate/MathStructure.cc:115 #: ../libqalculate/MathStructure.cc:145 #, 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:2614 #, 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:5241 ../libqalculate/MathStructure.cc:5282 #: ../libqalculate/MathStructure.cc:5315 ../libqalculate/MathStructure.cc:5371 #: ../libqalculate/MathStructure.cc:5391 ../libqalculate/MathStructure.cc:5410 #: ../libqalculate/MathStructure.cc:5429 ../libqalculate/MathStructure.cc:5448 #: ../libqalculate/MathStructure.cc:5539 ../libqalculate/MathStructure.cc:8792 #: ../libqalculate/MathStructure.cc:8803 ../libqalculate/MathStructure.cc:8880 msgid "This is a bug. Please report it." msgstr "Ceci est un bogue. Merci de le reporter." #: ../libqalculate/MathStructure.cc:11722 msgid "undefined" msgstr "indéfini" #: ../libqalculate/MathStructure.cc:11772 #, 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:11820 #, 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:12245 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:12308 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:12397 msgid "Inverse of singular matrix." msgstr "Inverse d'une matrice singulière." #: ../libqalculate/Function.cc:153 #, c-format msgid "%s() requires that %s" msgstr "%s() exige que %s" #: ../libqalculate/Function.cc:306 ../libqalculate/Function.cc:363 #: ../libqalculate/Function.cc:422 #, 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:443 #, 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:445 #, 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:1136 msgid "a free value" msgstr "une valeur libre" #: ../libqalculate/Function.cc:1141 msgid "that is nonzero" msgstr "ceci est non nul" #: ../libqalculate/Function.cc:1149 msgid "that is rational (polynomial)" msgstr "ceci est rationnel (polynomial)" #: ../libqalculate/Function.cc:1157 msgid "that fulfills the condition:" msgstr "ceci remplit la condition :" #: ../libqalculate/Function.cc:1160 msgid "Argument" msgstr "" #: ../libqalculate/Function.cc:1215 #, c-format msgid "Argument %s in %s() must be %s." msgstr "L'argument %s de %s() doit être %s." #: ../libqalculate/Function.cc:1217 #, c-format msgid "Argument %s, %s, in %s() must be %s." msgstr "L'argument %s, %s, de %s() doit être %s." #: ../libqalculate/Function.cc:1544 msgid "a rational number" msgstr "un nombre rationnel" #: ../libqalculate/Function.cc:1546 msgid "a number" msgstr "un nombre" #: ../libqalculate/Function.cc:1548 msgid "a real number" msgstr "un nombre réel" #: ../libqalculate/Function.cc:1553 ../libqalculate/Function.cc:1700 msgid ">=" msgstr "" #: ../libqalculate/Function.cc:1555 msgid ">" msgstr "" #: ../libqalculate/Function.cc:1567 ../libqalculate/Function.cc:1710 msgid "<=" msgstr "" #: ../libqalculate/Function.cc:1569 msgid "<" msgstr "" #: ../libqalculate/Function.cc:1697 msgid "an integer" msgstr "un entier" #: ../libqalculate/Function.cc:1728 msgid "symbol" msgstr "symbole" #: ../libqalculate/Function.cc:1729 msgid "an unknown variable/symbol" msgstr "une variable / un symbole inconnu" #: ../libqalculate/Function.cc:1742 msgid "text" msgstr "texte" #: ../libqalculate/Function.cc:1743 msgid "a text string" msgstr "une chaîne de caractères" #: ../libqalculate/Function.cc:1758 msgid "date" msgstr "" #: ../libqalculate/Function.cc:1759 msgid "a date" msgstr "une date" #: ../libqalculate/Function.cc:1805 msgid "a vector with " msgstr "en vecteur avec" #: ../libqalculate/Function.cc:1817 msgid "a vector" msgstr "un vecteur" #: ../libqalculate/Function.cc:1866 msgid "a square matrix" msgstr "une matrice carrée" #: ../libqalculate/Function.cc:1868 msgid "a matrix" msgstr "une matrice" #: ../libqalculate/Function.cc:1883 msgid "object" msgstr "objet" #: ../libqalculate/Function.cc:1884 msgid "a valid function, unit or variable name" msgstr "une fonction, une unité ou un nom de variable valide" #: ../libqalculate/Function.cc:1897 msgid "function" msgstr "fonction" #: ../libqalculate/Function.cc:1898 msgid "a valid function name" msgstr "un nom de fonction valide" #: ../libqalculate/Function.cc:1911 msgid "unit" msgstr "unité" #: ../libqalculate/Function.cc:1912 msgid "a valid unit name" msgstr "un nom d'unité valide" #: ../libqalculate/Function.cc:1925 msgid "variable" msgstr "" #: ../libqalculate/Function.cc:1926 msgid "a valid variable name" msgstr "un nom de variable valide" #: ../libqalculate/Function.cc:1939 msgid "file" msgstr "fichier" #: ../libqalculate/Function.cc:1940 msgid "a valid file name" msgstr "un nom de fichier valide" #: ../libqalculate/Function.cc:1953 msgid "boolean" msgstr "booléen" #: ../libqalculate/Function.cc:1954 msgid "a boolean (0 or 1)" msgstr "un booléen (0 ou 1)" #: ../libqalculate/Function.cc:1964 msgid "angle" msgstr "" #: ../libqalculate/Function.cc:1965 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:91 ../libqalculate/Number.cc:197 #: ../libqalculate/Number.cc:219 ../libqalculate/Number.cc:521 #: ../libqalculate/Number.cc:689 ../libqalculate/Number.cc:808 #: ../libqalculate/Number.cc:818 ../libqalculate/Number.cc:828 #: ../libqalculate/Number.cc:838 ../libqalculate/Number.cc:847 #: ../libqalculate/Number.cc:860 ../libqalculate/Number.cc:873 #: ../libqalculate/Number.cc:883 ../libqalculate/Number.cc:895 #: ../libqalculate/Number.cc:905 ../libqalculate/Number.cc:944 #: ../libqalculate/Number.cc:951 ../libqalculate/Number.cc:997 #: ../libqalculate/Number.cc:1015 ../libqalculate/Number.cc:1029 #: ../libqalculate/Number.cc:1076 ../libqalculate/Number.cc:1261 #: ../libqalculate/Number.cc:1417 ../libqalculate/Number.cc:1463 #: ../libqalculate/Number.cc:1515 ../libqalculate/Number.cc:1560 #: ../libqalculate/Number.cc:1583 ../libqalculate/Number.cc:1661 #: ../libqalculate/Number.cc:1668 ../libqalculate/Number.cc:1676 #: ../libqalculate/Number.cc:1746 ../libqalculate/Number.cc:1763 #: ../libqalculate/Number.cc:1775 ../libqalculate/Number.cc:1798 #: ../libqalculate/Number.cc:1808 ../libqalculate/Number.cc:1828 #: ../libqalculate/Number.cc:1841 ../libqalculate/Number.cc:1854 #: ../libqalculate/Number.cc:1870 ../libqalculate/Number.cc:1887 #: ../libqalculate/Number.cc:1904 ../libqalculate/Number.cc:1921 #: ../libqalculate/Number.cc:1935 ../libqalculate/Number.cc:1949 #: ../libqalculate/Number.cc:1962 ../libqalculate/Number.cc:1977 #: ../libqalculate/Number.cc:1991 ../libqalculate/Number.cc:2005 #: ../libqalculate/Number.cc:2016 ../libqalculate/Number.cc:2030 #: ../libqalculate/Number.cc:2042 ../libqalculate/Number.cc:2107 #: ../libqalculate/Number.cc:2121 ../libqalculate/Number.cc:2137 #: ../libqalculate/Number.cc:2153 ../libqalculate/Number.cc:2169 #: ../libqalculate/Number.cc:2188 ../libqalculate/Number.cc:2207 #: ../libqalculate/Number.cc:2230 ../libqalculate/Number.cc:2246 #: ../libqalculate/Number.cc:2262 ../libqalculate/Number.cc:2284 #: ../libqalculate/Number.cc:2302 ../libqalculate/Number.cc:2326 #: ../libqalculate/Number.cc:2350 ../libqalculate/Number.cc:2389 #: ../libqalculate/Number.cc:2396 ../libqalculate/Number.cc:2418 #: ../libqalculate/Number.cc:2445 ../libqalculate/Number.cc:2453 #: ../libqalculate/Number.cc:2467 ../libqalculate/Number.cc:2493 #: ../libqalculate/Number.cc:2506 ../libqalculate/Number.cc:2539 #: ../libqalculate/Number.cc:2568 ../libqalculate/Number.cc:2595 #: ../libqalculate/Number.cc:2623 ../libqalculate/Number.cc:2638 #: ../libqalculate/Number.cc:2648 ../libqalculate/Number.cc:2666 #: ../libqalculate/Number.cc:2684 ../libqalculate/Number.cc:2690 #: ../libqalculate/Number.cc:2709 ../libqalculate/Number.cc:2716 #: ../libqalculate/Number.cc:3077 ../libqalculate/Number.cc:3113 #: ../libqalculate/Number.cc:3149 ../libqalculate/Number.cc:3258 #: ../libqalculate/Number.cc:3268 ../libqalculate/Number.cc:3274 #: ../libqalculate/Number.cc:3280 ../libqalculate/Number.cc:3286 #: ../libqalculate/Number.cc:3362 ../libqalculate/Number.cc:3386 #: ../libqalculate/Number.cc:3422 #, c-format msgid "CLN Exception: %s" msgstr "" #: ../libqalculate/Number.cc:174 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:268 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:346 #, c-format msgid "Error in roman numerals: %s." msgstr "Erreur dans les chiffres romains : %s." #: ../libqalculate/Number.cc:381 #, c-format msgid "Unknown roman numeral: %c." msgstr "Chiffre romain inconnu : %c." #: ../libqalculate/Number.cc:439 #, 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:528 msgid "':' in decimal number ignored (decimal point detected)." msgstr "':' dans les nombres décimaux ignoré (point décimal détecté)" #: ../libqalculate/Number.cc:584 #, 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:1633 msgid "Division by zero." msgstr "Division par zéro." #. 0^0 #: ../libqalculate/Number.cc:1639 msgid "0^0 might be considered undefined" msgstr "0^0 sera considéré comme indéfini" #: ../libqalculate/Number.cc:1644 msgid "The result of 0^i is possibly undefined" msgstr "" #: ../libqalculate/Number.cc:2094 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:2100 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:3231 ../libqalculate/Number.cc:3239 #: ../libqalculate/Number.cc:3248 msgid "infinity" msgstr "infini" #: ../libqalculate/Unit.cc:850 msgid "Error(s) in unitexpression." msgstr "Erreur(s) dans l'expression d'unités." #. 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); #: ../libqalculate/util.cc:52 msgid "today" msgstr "aujourd'hui" #: ../libqalculate/util.cc:55 msgid "tomorrow" msgstr "" #: ../libqalculate/util.cc:59 msgid "yesterday" msgstr "" #: ../libqalculate/util.cc:535 msgid "Yes" msgstr "Oui" #: ../libqalculate/util.cc:536 msgid "No" msgstr "Non" #: ../libqalculate/util.cc:543 msgid "True" msgstr "Vrai" #: ../libqalculate/util.cc:544 msgid "False" msgstr "Faux" #: ../libqalculate/util.cc:551 msgid "On" msgstr "Marche" #: ../libqalculate/util.cc:552 msgid "Off" msgstr "Arrêt" #~ msgid "UNIT" #~ msgstr "UNITÉ" #~ msgid "a unit (example meter)" #~ msgstr "une unité (exemple : mètre)" #~ msgid "best (convert best unit)" #~ msgstr "meilleur (convertit dans la meilleure unité)" #~ msgid "Example: convert best." #~ msgstr "Exemple : convert best" #~ msgid "Decimal point in sexagesimal number treated as ':'." #~ msgstr "Point décimal dans les nombres sexagésimaux traité comme ':'." libqalculate-0.9.10/po/sv.po0000644000175000017500000020575712744163150012615 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. # Hanna Knutsson , 2003. # msgid "" msgstr "" "Project-Id-Version: sv\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-07-21 17:12+0200\n" "PO-Revision-Date: 2006-05-04 12:29+0200\n" "Last-Translator: Hanna Knutsson \n" "Language-Team: Swedish\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/qalc.cc:102 ../src/qalc.cc:152 ../src/qalc.cc:2051 #: ../libqalculate/util.cc:538 msgid "yes" msgstr "ja" #: ../src/qalc.cc:103 ../src/qalc.cc:154 ../src/qalc.cc:2051 #: ../libqalculate/util.cc:539 msgid "no" msgstr "nej" #: ../src/qalc.cc:104 ../libqalculate/util.cc:546 msgid "true" msgstr "sant" #: ../src/qalc.cc:105 ../libqalculate/util.cc:547 msgid "false" msgstr "falskt" #: ../src/qalc.cc:106 ../src/qalc.cc:671 ../src/qalc.cc:686 ../src/qalc.cc:1608 #: ../src/qalc.cc:2050 ../src/qalc.cc:2135 ../libqalculate/util.cc:554 msgid "on" msgstr "på" #: ../src/qalc.cc:107 ../src/qalc.cc:618 ../src/qalc.cc:644 ../src/qalc.cc:656 #: ../src/qalc.cc:669 ../src/qalc.cc:684 ../src/qalc.cc:1596 #: ../src/qalc.cc:1606 ../src/qalc.cc:1628 ../src/qalc.cc:1635 #: ../src/qalc.cc:1657 ../src/qalc.cc:2050 ../src/qalc.cc:2122 #: ../src/qalc.cc:2135 ../src/qalc.cc:2155 ../src/qalc.cc:2160 #: ../src/qalc.cc:2170 ../libqalculate/util.cc:555 msgid "off" msgstr "av" #: ../src/qalc.cc:159 msgid "Please answer yes or no" msgstr "Vänligen svara ja eller nej" #: ../src/qalc.cc:166 ../src/qalc.cc:788 ../src/qalc.cc:1557 #: ../src/qalc.cc:2012 ../src/qalc.cc:2068 ../src/qalc.cc:2080 #: ../src/qalc.cc:2202 ../src/qalc.cc:2214 msgid "unknown" msgstr "okänd" #: ../src/qalc.cc:172 ../src/qalc.cc:450 ../src/qalc.cc:481 ../src/qalc.cc:559 #: ../src/qalc.cc:574 ../src/qalc.cc:1515 ../src/qalc.cc:1526 #: ../src/qalc.cc:1561 ../src/qalc.cc:1576 ../src/qalc.cc:2060 #: ../src/qalc.cc:2062 ../src/qalc.cc:2095 ../src/qalc.cc:2113 msgid "none" msgstr "ingen" #: ../src/qalc.cc:174 ../src/qalc.cc:785 ../src/qalc.cc:1554 #: ../src/qalc.cc:2009 ../src/qalc.cc:2082 ../src/qalc.cc:2216 msgid "non-matrix" msgstr "ej matris" #: ../src/qalc.cc:176 ../src/qalc.cc:783 ../src/qalc.cc:1552 #: ../src/qalc.cc:2007 ../src/qalc.cc:2086 ../src/qalc.cc:2220 msgid "complex" msgstr "komplex" #: ../src/qalc.cc:178 ../src/qalc.cc:782 ../src/qalc.cc:1551 #: ../src/qalc.cc:2006 ../src/qalc.cc:2088 ../src/qalc.cc:2222 msgid "real" msgstr "reell" #: ../src/qalc.cc:180 ../src/qalc.cc:784 ../src/qalc.cc:1553 #: ../src/qalc.cc:2008 ../src/qalc.cc:2084 ../src/qalc.cc:2218 #: ../libqalculate/Function.cc:1539 msgid "number" msgstr "nummer" #: ../src/qalc.cc:182 ../src/qalc.cc:781 ../src/qalc.cc:1550 #: ../src/qalc.cc:2005 ../src/qalc.cc:2090 ../src/qalc.cc:2224 msgid "rational" msgstr "rationell" #: ../src/qalc.cc:184 ../src/qalc.cc:780 ../src/qalc.cc:1549 #: ../src/qalc.cc:2004 ../src/qalc.cc:2092 ../src/qalc.cc:2226 #: ../libqalculate/Function.cc:1694 msgid "integer" msgstr "heltal" #: ../src/qalc.cc:186 ../src/qalc.cc:775 ../src/qalc.cc:1544 #: ../src/qalc.cc:1999 ../src/qalc.cc:2070 ../src/qalc.cc:2204 msgid "non-zero" msgstr "ej noll" #: ../src/qalc.cc:188 ../src/qalc.cc:771 ../src/qalc.cc:1540 #: ../src/qalc.cc:1995 ../src/qalc.cc:2072 ../src/qalc.cc:2206 msgid "positive" msgstr "positiv" #: ../src/qalc.cc:190 ../src/qalc.cc:774 ../src/qalc.cc:1543 #: ../src/qalc.cc:1998 ../src/qalc.cc:2078 ../src/qalc.cc:2212 msgid "non-negative" msgstr "ej negativ" #: ../src/qalc.cc:192 msgid "negatve" msgstr "negativ" #: ../src/qalc.cc:194 ../src/qalc.cc:772 ../src/qalc.cc:1541 #: ../src/qalc.cc:1996 ../src/qalc.cc:2076 ../src/qalc.cc:2210 msgid "non-positive" msgstr "ej positiv" #: ../src/qalc.cc:197 msgid "Unrecognized assumption." msgstr "Okänt antagande." #: ../src/qalc.cc:336 ../libqalculate/Calculator.cc:8910 #, c-format msgid "It has been %s day(s) since the exchange rates last were updated." msgstr "Det var %s dag(ar) sedan växelkurserna senast updaterades." #: ../src/qalc.cc:341 msgid "Do you wish to update the exchange rates now?" msgstr "Vill du uppdatera växelkurserna nu?" #: ../src/qalc.cc:354 ../src/qalc.cc:355 msgid "" "\n" "Press Enter to continue." msgstr "" "\n" "Tryck Enter för att fortsätta." #: ../src/qalc.cc:363 ../src/qalc.cc:364 ../src/qalc.cc:365 ../src/qalc.cc:465 #: ../src/qalc.cc:468 ../src/qalc.cc:590 ../src/qalc.cc:601 ../src/qalc.cc:610 msgid "Illegal value" msgstr "Otillåtet värde" #. qalc command #: ../src/qalc.cc:379 ../src/qalc.cc:562 ../src/qalc.cc:1378 #: ../src/qalc.cc:1488 ../src/qalc.cc:1563 ../src/qalc.cc:1566 #: ../src/qalc.cc:1696 ../src/qalc.cc:2095 ../src/qalc.cc:2096 #: ../src/qalc.cc:2277 ../src/qalc.cc:2817 msgid "base" msgstr "bas" #: ../src/qalc.cc:379 ../src/qalc.cc:381 ../src/qalc.cc:1613 #: ../src/qalc.cc:2137 msgid "input base" msgstr "indatabas" #: ../src/qalc.cc:379 msgid "output base" msgstr "utdatabas" #: ../src/qalc.cc:382 ../src/qalc.cc:1568 ../src/qalc.cc:1615 #: ../src/qalc.cc:2108 ../src/qalc.cc:2145 msgid "roman" msgstr "romersk" #: ../src/qalc.cc:383 ../src/qalc.cc:1570 ../src/qalc.cc:2106 msgid "time" msgstr "tid" #: ../src/qalc.cc:384 ../src/qalc.cc:2102 ../src/qalc.cc:2143 msgid "hex" msgstr "hex" #: ../src/qalc.cc:384 ../src/qalc.cc:1426 ../src/qalc.cc:2772 msgid "hexadecimal" msgstr "hexadecimal" #: ../src/qalc.cc:385 ../src/qalc.cc:2096 ../src/qalc.cc:2137 msgid "bin" msgstr "bin" #: ../src/qalc.cc:385 ../src/qalc.cc:1431 ../src/qalc.cc:2781 msgid "binary" msgstr "binär" #: ../src/qalc.cc:386 ../src/qalc.cc:2098 ../src/qalc.cc:2139 msgid "oct" msgstr "okt" #: ../src/qalc.cc:386 ../src/qalc.cc:1436 ../src/qalc.cc:2790 msgid "octal" msgstr "oktal" #: ../src/qalc.cc:387 ../src/qalc.cc:2100 ../src/qalc.cc:2141 msgid "dec" msgstr "dec" #: ../src/qalc.cc:387 msgid "decimal" msgstr "decimal" #: ../src/qalc.cc:388 ../src/qalc.cc:2104 msgid "sex" msgstr "sex" #: ../src/qalc.cc:388 ../src/qalc.cc:1569 msgid "sexagesimal" msgstr "sexagesimal" #: ../src/qalc.cc:405 ../src/qalc.cc:448 ../src/qalc.cc:1574 #: ../src/qalc.cc:2113 msgid "base display" msgstr "basvisning" #: ../src/qalc.cc:410 msgid "Illegal base." msgstr "Otillåten bas." #: ../src/qalc.cc:418 ../src/qalc.cc:1558 ../src/qalc.cc:2067 msgid "assumptions" msgstr "antaganden" #: ../src/qalc.cc:428 ../src/qalc.cc:1520 ../src/qalc.cc:2061 msgid "all prefixes" msgstr "alla prefix" #: ../src/qalc.cc:429 ../src/qalc.cc:1583 ../src/qalc.cc:2116 msgid "complex numbers" msgstr "komplexa tal" #: ../src/qalc.cc:430 ../src/qalc.cc:1593 ../src/qalc.cc:2121 msgid "excessive parentheses" msgstr "parenteser av mass" #: ../src/qalc.cc:431 ../src/qalc.cc:1612 ../src/qalc.cc:1729 #: ../src/qalc.cc:2136 msgid "functions" msgstr "funktioner" #: ../src/qalc.cc:432 ../src/qalc.cc:1620 ../src/qalc.cc:2150 msgid "infinite numbers" msgstr "oändliga tal" #: ../src/qalc.cc:433 ../src/qalc.cc:1668 ../src/qalc.cc:2177 msgid "show negative exponents" msgstr "visa negativa exponenter" #: ../src/qalc.cc:434 ../src/qalc.cc:1536 ../src/qalc.cc:2064 msgid "assume nonzero denominators" msgstr "antag nämnare ej noll" #: ../src/qalc.cc:435 ../src/qalc.cc:1537 ../src/qalc.cc:2065 msgid "warn nonzero denominators" msgstr "varna nämnare ej noll" #: ../src/qalc.cc:436 ../src/qalc.cc:1654 ../src/qalc.cc:2169 msgid "prefixes" msgstr "prefix" #: ../src/qalc.cc:437 ../src/qalc.cc:1584 ../src/qalc.cc:2117 msgid "denominator prefixes" msgstr "nämnarprefix" #: ../src/qalc.cc:438 ../src/qalc.cc:1652 ../src/qalc.cc:2167 msgid "place units separately" msgstr "placera enheter separat" #: ../src/qalc.cc:439 ../src/qalc.cc:1582 ../src/qalc.cc:2115 msgid "calculate variables" msgstr "beräkna variabler" #: ../src/qalc.cc:440 ../src/qalc.cc:1581 ../src/qalc.cc:2114 msgid "calculate functions" msgstr "beräkna funktioner" #: ../src/qalc.cc:441 ../src/qalc.cc:1672 ../src/qalc.cc:2181 msgid "sync units" msgstr "synkronisera enheter" #: ../src/qalc.cc:442 ../src/qalc.cc:1662 ../src/qalc.cc:2171 msgid "round to even" msgstr "avrunda till jämnt" #. qalc command #: ../src/qalc.cc:443 ../src/qalc.cc:1381 ../src/qalc.cc:1663 #: ../src/qalc.cc:1709 ../src/qalc.cc:2172 ../src/qalc.cc:2265 msgid "rpn" msgstr "rpn" #: ../src/qalc.cc:444 ../src/qalc.cc:1664 ../src/qalc.cc:2173 msgid "rpn syntax" msgstr "rpnsyntax" #: ../src/qalc.cc:445 ../src/qalc.cc:1669 ../src/qalc.cc:2178 msgid "short multiplication" msgstr "kort multiplikation" #: ../src/qalc.cc:446 ../src/qalc.cc:1622 ../src/qalc.cc:2153 msgid "lowercase e" msgstr "litet e" #: ../src/qalc.cc:447 ../src/qalc.cc:1623 ../src/qalc.cc:2154 msgid "lowercase numbers" msgstr "små nummer" #: ../src/qalc.cc:451 ../src/qalc.cc:1577 ../src/qalc.cc:2113 msgid "normal" msgstr "normal" #: ../src/qalc.cc:452 ../src/qalc.cc:1578 ../src/qalc.cc:2113 msgid "alternative" msgstr "alternativ" #: ../src/qalc.cc:457 ../src/qalc.cc:486 ../src/qalc.cc:500 ../src/qalc.cc:524 #: ../src/qalc.cc:538 ../src/qalc.cc:552 ../src/qalc.cc:567 ../src/qalc.cc:581 #: ../src/qalc.cc:628 ../src/qalc.cc:637 ../src/qalc.cc:677 ../src/qalc.cc:691 msgid "Illegal value." msgstr "Otillåtet värde." #: ../src/qalc.cc:462 ../src/qalc.cc:1671 ../src/qalc.cc:2180 msgid "spell out logical" msgstr "skriv ut logiska" #: ../src/qalc.cc:463 ../src/qalc.cc:1592 ../src/qalc.cc:2119 msgid "dot as separator" msgstr "punkt som avgränsare" #: ../src/qalc.cc:464 ../src/qalc.cc:1621 ../src/qalc.cc:2152 msgid "limit implicit multiplication" msgstr "begränsa implicit multiplikation" #: ../src/qalc.cc:466 ../src/qalc.cc:1670 ../src/qalc.cc:2179 msgid "spacious" msgstr "rymlig" #: ../src/qalc.cc:467 ../src/qalc.cc:1673 ../src/qalc.cc:2182 msgid "unicode" msgstr "unicode" #: ../src/qalc.cc:470 ../src/qalc.cc:1674 ../src/qalc.cc:1731 #: ../src/qalc.cc:2183 msgid "units" msgstr "enheter" #: ../src/qalc.cc:471 ../src/qalc.cc:1675 ../src/qalc.cc:2184 msgid "unknowns" msgstr "okända" #: ../src/qalc.cc:472 ../src/qalc.cc:1683 ../src/qalc.cc:1730 #: ../src/qalc.cc:2191 msgid "variables" msgstr "variabler" #: ../src/qalc.cc:473 ../src/qalc.cc:1512 ../src/qalc.cc:2059 msgid "abbreviations" msgstr "förkortningar" #: ../src/qalc.cc:474 ../src/qalc.cc:1667 ../src/qalc.cc:2176 msgid "show ending zeroes" msgstr "visa avslutande nollor" #: ../src/qalc.cc:475 ../src/qalc.cc:1619 ../src/qalc.cc:2151 msgid "indicate infinite series" msgstr "indikera oändliga talserier" #: ../src/qalc.cc:476 ../src/qalc.cc:1521 ../src/qalc.cc:2062 msgid "angle unit" msgstr "vinkelenhet" #: ../src/qalc.cc:478 ../src/qalc.cc:1523 ../src/qalc.cc:1524 msgid "rad" msgstr "rad" #: ../src/qalc.cc:478 ../src/qalc.cc:2062 msgid "radians" msgstr "radianer" #: ../src/qalc.cc:479 msgid "deg" msgstr "deg" #: ../src/qalc.cc:479 ../src/qalc.cc:2062 msgid "degrees" msgstr "grader" #: ../src/qalc.cc:480 ../src/qalc.cc:1525 msgid "gra" msgstr "gra" #: ../src/qalc.cc:480 ../src/qalc.cc:2062 msgid "gradians" msgstr "gradienter" #: ../src/qalc.cc:491 ../src/qalc.cc:1645 ../src/qalc.cc:2166 #: ../src/qalc.cc:2318 msgid "parsing mode" msgstr "tolkningsläge" #: ../src/qalc.cc:493 ../src/qalc.cc:1647 ../src/qalc.cc:2166 #: ../src/qalc.cc:2326 msgid "adaptive" msgstr "anpassad" #: ../src/qalc.cc:494 ../src/qalc.cc:1648 ../src/qalc.cc:2166 #: ../src/qalc.cc:2323 msgid "implicit first" msgstr "implicit först" #: ../src/qalc.cc:495 ../src/qalc.cc:1649 ../src/qalc.cc:2166 #: ../src/qalc.cc:2320 msgid "conventional" msgstr "konventionell" #: ../src/qalc.cc:505 ../src/qalc.cc:938 ../src/qalc.cc:1676 #: ../src/qalc.cc:2185 msgid "update exchange rates" msgstr "updatering av växelkurser" #: ../src/qalc.cc:506 ../src/qalc.cc:1679 ../src/qalc.cc:2187 msgid "never" msgstr "aldrig" #: ../src/qalc.cc:508 ../src/qalc.cc:1678 ../src/qalc.cc:2186 msgid "ask" msgstr "fråga" #: ../src/qalc.cc:515 ../src/qalc.cc:1638 ../src/qalc.cc:2165 msgid "multiplication sign" msgstr "multiplikationstecken" #: ../src/qalc.cc:529 ../src/qalc.cc:1585 ../src/qalc.cc:2118 msgid "division sign" msgstr "divisionstecken" #: ../src/qalc.cc:543 ../src/qalc.cc:1529 ../src/qalc.cc:2063 msgid "approximation" msgstr "approximering" #. qalc command #: ../src/qalc.cc:545 ../src/qalc.cc:587 ../src/qalc.cc:670 ../src/qalc.cc:1411 #: ../src/qalc.cc:1531 ../src/qalc.cc:1607 ../src/qalc.cc:1699 #: ../src/qalc.cc:2063 ../src/qalc.cc:2120 ../src/qalc.cc:2135 #: ../src/qalc.cc:2281 msgid "exact" msgstr "exakt" #: ../src/qalc.cc:546 ../src/qalc.cc:1532 ../src/qalc.cc:2063 msgid "try exact" msgstr "försök exakt" #. qalc command #: ../src/qalc.cc:547 ../src/qalc.cc:796 ../src/qalc.cc:1417 #: ../src/qalc.cc:1533 ../src/qalc.cc:1694 ../src/qalc.cc:1924 #: ../src/qalc.cc:1934 ../src/qalc.cc:2022 ../src/qalc.cc:2063 #: ../src/qalc.cc:2285 msgid "approximate" msgstr "approximerat" #: ../src/qalc.cc:557 ../src/qalc.cc:1559 ../src/qalc.cc:2095 msgid "autoconversion" msgstr "autoomvandling" #: ../src/qalc.cc:560 ../src/qalc.cc:1482 msgid "best" msgstr "bästa" #: ../src/qalc.cc:561 ../src/qalc.cc:1482 ../src/qalc.cc:1562 #: ../src/qalc.cc:2095 ../src/qalc.cc:2808 msgid "optimal" msgstr "optimal" #: ../src/qalc.cc:572 ../src/qalc.cc:1513 ../src/qalc.cc:2060 msgid "algebra mode" msgstr "algebraiskt läge" #. qalc command #: ../src/qalc.cc:575 ../src/qalc.cc:1505 ../src/qalc.cc:1516 #: ../src/qalc.cc:1714 ../src/qalc.cc:2043 ../src/qalc.cc:2060 msgid "simplify" msgstr "förenkla" #: ../src/qalc.cc:576 ../src/qalc.cc:1517 ../src/qalc.cc:2060 msgid "factorize" msgstr "faktorisera" #: ../src/qalc.cc:598 ../src/qalc.cc:1666 ../src/qalc.cc:1712 #: ../src/qalc.cc:2175 msgid "save mode" msgstr "spara läge" #: ../src/qalc.cc:607 ../src/qalc.cc:1665 ../src/qalc.cc:1711 #: ../src/qalc.cc:2174 msgid "save definitions" msgstr "spara definitioner" #: ../src/qalc.cc:616 ../src/qalc.cc:1594 ../src/qalc.cc:2122 msgid "exp mode" msgstr "exp-läge" #: ../src/qalc.cc:619 ../src/qalc.cc:1597 ../src/qalc.cc:2124 msgid "auto" msgstr "auto" #: ../src/qalc.cc:620 ../src/qalc.cc:1598 ../src/qalc.cc:2128 msgid "pure" msgstr "ren" #: ../src/qalc.cc:621 ../src/qalc.cc:1599 ../src/qalc.cc:2130 msgid "scientific" msgstr "vetenskaplig" #: ../src/qalc.cc:622 ../src/qalc.cc:1600 ../src/qalc.cc:2126 msgid "engineering" msgstr "teknisk" #: ../src/qalc.cc:633 ../src/qalc.cc:1653 ../src/qalc.cc:2168 msgid "precision" msgstr "precision" #: ../src/qalc.cc:642 ../src/qalc.cc:1624 ../src/qalc.cc:2155 msgid "max decimals" msgstr "max decimaler" #: ../src/qalc.cc:654 ../src/qalc.cc:1631 ../src/qalc.cc:2160 msgid "min decimals" msgstr "min decimaler" #: ../src/qalc.cc:667 ../src/qalc.cc:1604 ../src/qalc.cc:2135 msgid "fractions" msgstr "bråktal" #: ../src/qalc.cc:672 ../src/qalc.cc:1609 ../src/qalc.cc:2135 msgid "combined" msgstr "kombinerad" #: ../src/qalc.cc:682 ../src/qalc.cc:1655 ../src/qalc.cc:2170 msgid "read precision" msgstr "läs precision" #: ../src/qalc.cc:685 ../src/qalc.cc:1658 ../src/qalc.cc:2170 msgid "always" msgstr "alltid" #: ../src/qalc.cc:686 ../src/qalc.cc:1659 ../src/qalc.cc:2170 msgid "when decimals" msgstr "när decimaler" #: ../src/qalc.cc:710 msgid "Unrecognized option." msgstr "Okänd inställning." #: ../src/qalc.cc:742 msgid "Variables:" msgstr "Variabler:" #: ../src/qalc.cc:744 msgid "Name" msgstr "Namn" #: ../src/qalc.cc:745 ../src/qalc.cc:2018 msgid "Value" msgstr "Värde" #: ../src/qalc.cc:761 ../src/qalc.cc:1985 ../libqalculate/Function.cc:1863 msgid "matrix" msgstr "matris" #: ../src/qalc.cc:763 ../src/qalc.cc:1987 ../libqalculate/Function.cc:1802 msgid "vector" msgstr "vektor" #: ../src/qalc.cc:773 ../src/qalc.cc:1542 ../src/qalc.cc:1997 #: ../src/qalc.cc:2074 ../src/qalc.cc:2208 msgid "negative" msgstr "negativ" #: ../src/qalc.cc:790 ../src/qalc.cc:2014 msgid "default assumptions" msgstr "förvalda antaganden" #: ../src/qalc.cc:811 msgid "Functions:" msgstr "Funktioner:" #: ../src/qalc.cc:825 msgid "Units:" msgstr "Enheter:" #: ../src/qalc.cc:832 msgid "No local variables, functions or units have been defined." msgstr "Inga lokala variabler, funktioner eller enheter har definierats." #: ../src/qalc.cc:837 ../src/qalc.cc:897 msgid "" "For more information about a specific function, variable or unit, please use " "the info command (in interactive mode)." msgstr "" "För mer information om en specifik funktion, variabel eller enhet, vänligen " "använd info-kommandot (i interaktivt läge)." #: ../src/qalc.cc:932 msgid "usage: qalc [options] [expression]" msgstr "användning: qalc [alternative] [uttryck]" #: ../src/qalc.cc:934 msgid "where options are:" msgstr "där alternativen är:" #: ../src/qalc.cc:935 ../src/qalc.cc:1696 msgid "BASE" msgstr "BAS" #: ../src/qalc.cc:936 msgid "set the result number base" msgstr "ange nummerbas för resultat" #: ../src/qalc.cc:939 msgid "FILE" msgstr "FIL" #: ../src/qalc.cc:940 msgid "executes commands from a file first" msgstr "utför kommandon från en fil först" #: ../src/qalc.cc:942 msgid "start in interactive mode" msgstr "starta i interaktivt läge" #: ../src/qalc.cc:944 msgid "displays a list of all user-defined variables, functions and units." msgstr "" "visar en lista över alla användardefinierade variabler, funktioner och " "enheter." #: ../src/qalc.cc:946 msgid "displays a list of all functions." msgstr "visar en lista över alla funktioner." #: ../src/qalc.cc:948 msgid "displays a list of all units." msgstr "visar en lista över alla enheter." #: ../src/qalc.cc:950 msgid "displays a list of all variables." msgstr "visar en lista över alla variabler." #: ../src/qalc.cc:952 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:954 msgid "do not load any global currencies from file" msgstr "läs inte in några systemvida valutor" #: ../src/qalc.cc:956 msgid "do not load any global data sets from file" msgstr "läs inte in några systemvida dataset" #: ../src/qalc.cc:958 msgid "do not load any global functions from file" msgstr "läs inte in några systemvida funktioner" #: ../src/qalc.cc:960 msgid "do not load any global units from file" msgstr "läs inte in några systemvida enheter" #: ../src/qalc.cc:962 msgid "do not load any global variables from file" msgstr "läs inte in några systemvida variabler" #: ../src/qalc.cc:964 msgid "reduces output to just the result of the input expression" msgstr "begränsar utdata till enbart resultatet av angett uttryck" #: ../src/qalc.cc:965 ../src/qalc.cc:1713 msgid "OPTION" msgstr "INSTÄLLNING" #: ../src/qalc.cc:965 ../src/qalc.cc:1713 msgid "VALUE" msgstr "VÄRDE" #: ../src/qalc.cc:966 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:968 msgid "turn on/off unicode support" msgstr "aktivera/avaktivera unicode-stöd" #: ../src/qalc.cc:970 msgid "" "The program will start in interactive mode if no expression and no file is " "specified (or interactive mode is explicitly selected)." msgstr "" "Programmet startar i interaktivt läge om inget uttryck och ingen fil har " "angetts (eller om interaktivt läga explicit har valts)." #: ../src/qalc.cc:1015 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:1023 msgid "No file specified." msgstr "Ingen fil specificerad." #: ../src/qalc.cc:1074 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 (förvalt: ja)?" #: ../src/qalc.cc:1082 msgid "ans" msgstr "ans" #: ../src/qalc.cc:1083 ../src/qalc.cc:1086 ../src/qalc.cc:1087 #: ../src/qalc.cc:1088 ../src/qalc.cc:1089 ../src/qalc.cc:1310 #: ../libqalculate/Calculator.cc:7713 ../libqalculate/Calculator.cc:7729 msgid "Temporary" msgstr "Temporära" #: ../src/qalc.cc:1083 msgid "Last Answer" msgstr "Senaste svaret" #: ../src/qalc.cc:1084 msgid "answer" msgstr "svar" #: ../src/qalc.cc:1086 msgid "Answer 2" msgstr "Svar 2" #: ../src/qalc.cc:1087 msgid "Answer 3" msgstr "Svar 3" #: ../src/qalc.cc:1088 msgid "Answer 4" msgstr "Svar 4" #: ../src/qalc.cc:1089 msgid "Answer 5" msgstr "Svar 5" #: ../src/qalc.cc:1100 msgid "Failed to load global definitions!" msgstr "Kunde inte inhämta systemvida definitioner!" #: ../src/qalc.cc:1139 #, c-format msgid "Could not open \"%s\".\n" msgstr "Kunde inte öppna \"%s\".\n" #: ../src/qalc.cc:1162 ../src/qalc.cc:1212 ../src/qalc.cc:2345 #, 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:1272 ../src/qalc.cc:1713 ../src/qalc.cc:2047 msgid "set" msgstr "ange" #. qalc command #: ../src/qalc.cc:1276 ../src/qalc.cc:1710 ../src/qalc.cc:2231 msgid "save" msgstr "spara" #: ../src/qalc.cc:1276 ../src/qalc.cc:1710 ../src/qalc.cc:2231 msgid "store" msgstr "lagra" #. qalc command #: ../src/qalc.cc:1279 ../src/qalc.cc:1508 ../src/qalc.cc:1708 #: ../src/qalc.cc:2244 msgid "mode" msgstr "läge" #: ../src/qalc.cc:1281 msgid "mode saved" msgstr "läge sparades" #: ../src/qalc.cc:1283 msgid "definitions" msgstr "definitioner" #: ../src/qalc.cc:1285 msgid "definitions saved" msgstr "definitioner sparades" #: ../src/qalc.cc:1332 ../src/qalc.cc:1334 #, c-format msgid "Illegal name. Save as %s instead (default: no)?" msgstr "Otillåtet namn. Vill du spara som %s i stället (förvalt: nej)?" #: ../src/qalc.cc:1341 msgid "" "An unit or variable with the same name already exists.\n" "Do you want to overwrite it (default: no)?" msgstr "" "En enhet eller variabel med samma namn finns redan.\n" "Vill du ersätta den (förvalt: nej)?" #. qalc command #: ../src/qalc.cc:1364 ../src/qalc.cc:1698 ../src/qalc.cc:2238 msgid "delete" msgstr "frigör" #: ../src/qalc.cc:1371 msgid "No user-defined variable with the specified name exist." msgstr "Ingen användardefinierad variabel med det angivna namnet existerar." #. qalc command #: ../src/qalc.cc:1374 ../src/qalc.cc:1695 ../src/qalc.cc:2198 msgid "assume" msgstr "antag" #. qalc command #: ../src/qalc.cc:1384 ../src/qalc.cc:1390 ../src/qalc.cc:1700 #: ../src/qalc.cc:2261 msgid "exrates" msgstr "växelkurser" #. qalc command #: ../src/qalc.cc:1394 ../src/qalc.cc:1715 ../src/qalc.cc:2273 msgid "stack" msgstr "stack" #: ../src/qalc.cc:1396 msgid "The RPN stack is empty." msgstr "RPN-stacken är tom." #. qalc command #: ../src/qalc.cc:1408 ../src/qalc.cc:1697 ../src/qalc.cc:2269 msgid "clear stack" msgstr "töm stacken" #. qalc command #: ../src/qalc.cc:1423 ../src/qalc.cc:1716 ../src/qalc.cc:2289 msgid "convert" msgstr "omvandla" #: ../src/qalc.cc:1423 ../src/qalc.cc:1716 ../src/qalc.cc:2289 #: ../src/qalc.cc:2310 msgid "to" msgstr "till" #: ../src/qalc.cc:1441 ../src/qalc.cc:2805 msgid "bases" msgstr "baser" #: ../src/qalc.cc:1474 ../src/qalc.cc:2799 msgid "fraction" msgstr "bråktal" #: ../src/qalc.cc:1480 ../src/qalc.cc:2802 msgid "factors" msgstr "faktorer" #. qalc command #: ../src/qalc.cc:1502 ../src/qalc.cc:1705 ../src/qalc.cc:2039 msgid "factor" msgstr "faktor" #. qalc command #: ../src/qalc.cc:1686 ../src/qalc.cc:2036 msgid "help" msgstr "hjälp" #: ../src/qalc.cc:1689 msgid "Enter a mathematical expression or a command and press enter." msgstr "Skriv in ett matematiskt uttryck eller ett kommando och tryck enter." #: ../src/qalc.cc:1690 msgid "Complete functions, units and variables with the tabulator key." msgstr "Avsluta funktions-, enhets- och variabelnamn med tabulatortangenten." #: ../src/qalc.cc:1692 msgid "Available commands are:" msgstr "Tillgängliga kommandon:" #: ../src/qalc.cc:1695 msgid "ASSUMPTIONS" msgstr "ANTAGANDEN" #: ../src/qalc.cc:1698 ../src/qalc.cc:1710 msgid "NAME" msgstr "NAMN" #: ../src/qalc.cc:1702 msgid "WGET ARGUMENTS" msgstr "WGET ARGUMENT" #. qalc command #: ../src/qalc.cc:1706 ../src/qalc.cc:1734 ../src/qalc.cc:2255 #: ../libqalculate/Calculator.cc:8360 ../libqalculate/DataSet.cc:355 #: ../libqalculate/DataSet.cc:382 ../libqalculate/DataSet.cc:1032 msgid "info" msgstr "info" #. qalc command #: ../src/qalc.cc:1707 ../src/qalc.cc:1723 ../src/qalc.cc:1725 #: ../src/qalc.cc:2248 msgid "list" msgstr "lista" #: ../src/qalc.cc:1709 msgid "ON/OFF" msgstr "AV/PÅ" #: ../src/qalc.cc:1710 msgid "CATEGORY" msgstr "KATEGORI" #: ../src/qalc.cc:1710 msgid "TITLE" msgstr "TITEL" #: ../src/qalc.cc:1716 msgid "UNIT or \"TO\" COMMAND" msgstr "ENHET eller \"TILL\"-KOMMANDO" #. qalc command #: ../src/qalc.cc:1717 ../src/qalc.cc:2314 ../src/qalc.cc:2335 msgid "quit" msgstr "avsluta" #: ../src/qalc.cc:1717 ../src/qalc.cc:2314 ../src/qalc.cc:2335 msgid "exit" msgstr "exit" #: ../src/qalc.cc:1718 msgid "Type help COMMAND for more information (example: help save)." msgstr "Skriv in hjälp KOMMANDO för mer information (exemel: hjälp save)." #: ../src/qalc.cc:1719 msgid "" "Type info NAME for information about a function, variable or unit (example: " "info sin)." msgstr "" "Skriv info NAMN för information om en funktion, variabel eller enhet " "(exempel: info sin)." #: ../src/qalc.cc:1720 msgid "" "For more information about mathematical expression, different options, and a " "complete list of functions, variables and units, see the relevant sections " "in the manual of the graphical user interface (available at http://qalculate." "github.io/manual/index.html)." msgstr "" "För mer information om matematiska uttryck, olika alternativ, och en " "komplett förteckning över funktioner, variabler och enheter, se relavanta " "avsnitt i instruktionsboken för det grafiska användargränssnittet " "(tillgänglig på http://qalculate.github.io/manual/index.html)." #: ../src/qalc.cc:1742 msgid "No function, variable or unit with specified name exist." msgstr "Ingen funktion, variabel eller enhet med det angivna namnet existerar." #: ../src/qalc.cc:1752 msgid "Function" msgstr "Funktion" #: ../src/qalc.cc:1779 ../libqalculate/Function.cc:189 msgid "argument" msgstr "parameter" #: ../src/qalc.cc:1803 #, 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:1816 msgid "Arguments" msgstr "Parametrar" #. optional argument, in description #: ../src/qalc.cc:1833 msgid "optional" msgstr "frivillig" #. argument default, in description #: ../src/qalc.cc:1837 msgid "default: " msgstr "förval: " #: ../src/qalc.cc:1848 msgid "Requirement" msgstr "Krav" #: ../src/qalc.cc:1856 msgid "Properties" msgstr "Egenskaper" #: ../src/qalc.cc:1871 msgid "key" msgstr "nyckel" #: ../src/qalc.cc:1889 ../src/qalc.cc:1892 msgid "Unit" msgstr "Enhet" #: ../src/qalc.cc:1895 ../src/qalc.cc:1963 msgid "Names" msgstr "Namn" #: ../src/qalc.cc:1913 msgid "Base Unit" msgstr "Grundenhet" #: ../src/qalc.cc:1920 msgid "Relation" msgstr "Relation" #: ../src/qalc.cc:1930 msgid "Inverse Relation" msgstr "Omvänd relation" #: ../src/qalc.cc:1942 msgid "Base Units" msgstr "Grundenheter" #: ../src/qalc.cc:1957 ../src/qalc.cc:1960 msgid "Variable" msgstr "Variabel" #: ../src/qalc.cc:1975 msgid "a previous result" msgstr "ett föregående resultat" #: ../src/qalc.cc:2041 msgid "Factorizes the current result." msgstr "Faktoriserar nuvaranda resultat." #: ../src/qalc.cc:2045 msgid "Simplifies the current result." msgstr "Förenklar nuvaranda resultat." #: ../src/qalc.cc:2055 msgid "Sets the value of an option." msgstr "Anger värdet för en inställning." #: ../src/qalc.cc:2057 msgid "Available options and accepted values are:" msgstr "Tillgängliga inställningar och accepterade värden:" #: ../src/qalc.cc:2188 msgid "days" msgstr "dagar" #: ../src/qalc.cc:2192 msgid "The current value is marked with '*'." msgstr "Det nuvarande värdet är markerat med '*'." #: ../src/qalc.cc:2194 msgid "Example: set base 16." msgstr "Exempel: set bas 16." #: ../src/qalc.cc:2196 msgid "Some options have additional help text (e.g. help parsing mode)." msgstr "Visa alternativ har ytterliga hjälptext (t.ex. hjälp tolkningsläge)." #: ../src/qalc.cc:2200 msgid "Set default assumptions for unknown variables." msgstr "Ange färvalda antaganden för okända variabler." #: ../src/qalc.cc:2233 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:2234 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:2236 msgid "Example: store var1." msgstr "Exempel: store var1." #: ../src/qalc.cc:2240 msgid "Removes the user-defined variable with the specified name." msgstr "Tar bort användarvariabeln med det angivna namnet." #: ../src/qalc.cc:2242 msgid "Example: delete var1." msgstr "Exempel: frigör var1." #: ../src/qalc.cc:2246 msgid "Displays the current mode." msgstr "Visar nuvarande läge." #: ../src/qalc.cc:2250 msgid "Displays a list of all user-defined variables, functions and units." msgstr "" "Visar en lista över alla användardefinierade variabler, funktioner och " "enheter." #: ../src/qalc.cc:2251 msgid "" "Enter with argument 'functions', 'variables' or 'units' to show a list of " "all functions, variables or units." msgstr "" "Skriv med parameter 'funktioner', 'variabler' eller 'enheter' för att visa " "en list över alla funktioner, variabler eller enheter." #: ../src/qalc.cc:2253 msgid "Example: list functions." msgstr "Exempel: lista funktioner." #: ../src/qalc.cc:2257 msgid "Displays information about a function, variable or unit." msgstr "Visar information om en funktion, variabel eller enhet." #: ../src/qalc.cc:2259 msgid "Example: info sin." msgstr "Exempel: info sin." #: ../src/qalc.cc:2263 msgid "Downloads current exchange rates from the Internet." msgstr "Hämtar nuvarande växelkurser från internet." #: ../src/qalc.cc:2267 msgid "(De)activates the Reverse Polish Notation mode." msgstr "(Av)aktiverar RPN-läget." #: ../src/qalc.cc:2271 msgid "Clears the RPN stack." msgstr "Tömmer RPN-stacken." #: ../src/qalc.cc:2275 msgid "Displays the RPN stack." msgstr "Visar RPN-stacken." #: ../src/qalc.cc:2279 msgid "Sets the result number base (equivalent to set base)." msgstr "Anger nummerbas för resultat (liktydigt med ange bas)." #: ../src/qalc.cc:2283 msgid "Equivalent to set approximation exact." msgstr "Liktydigt med ange approximation exakt." #: ../src/qalc.cc:2287 msgid "Equivalent to set approximation try exact." msgstr "Liktydigt med ange approximation försök exakt." #: ../src/qalc.cc:2291 msgid "Converts units or changes number base in current result." msgstr "Omvandlar enheter eller ändrar nummerbas i nuvarande resultat." #: ../src/qalc.cc:2293 msgid "Possible values:" msgstr "Möjliga värden:" #: ../src/qalc.cc:2295 msgid "a unit (e.g. meter, prepend with ? to request the optimal prefix)" msgstr "en enhet (t.ex. meter, inled med ? för att eftefråga optimalt prefix)" #: ../src/qalc.cc:2296 msgid "a unit expression (e.g. km/h)" msgstr "ett enhetsuttryck (t.ex. km/h)" #: ../src/qalc.cc:2297 msgid "base (convert to base units)" msgstr "bas (omvandla till basenheter)" #: ../src/qalc.cc:2298 msgid "optimal (convert to optimal unit)" msgstr "optimal (omvandla till optimal enhet)" #: ../src/qalc.cc:2300 msgid "bin / binary (show as binary number)" msgstr "bin / binär (visa som binärt tal)" #: ../src/qalc.cc:2301 msgid "oct / octal (show as octal number)" msgstr "oct / oktal (visa som oktalt tal)" #: ../src/qalc.cc:2302 msgid "hex / hexadecimal (show as hexadecimal number)" msgstr "hex / hexadecimal (visa som hexadecimalt tal)" #: ../src/qalc.cc:2303 msgid "bases (show as binary, octal, decimal and hexadecimal number)" msgstr "baser (visa som binärt, otkalt, decimalt och hexadecimalt tal)" #: ../src/qalc.cc:2305 msgid "fraction (show result in combined fractional format)" msgstr "bråktal (visa resultatet som kombinerat bråktal)" #: ../src/qalc.cc:2306 msgid "factors (factorize result)" msgstr "faktorer (faktoriserar resultatet)" #: ../src/qalc.cc:2308 msgid "Example: to ?g" msgstr "Exempel: till ?g" #: ../src/qalc.cc:2311 msgid "" "This command can also be typed directly at the end of the mathematical " "expression." msgstr "" "Det här kommandot kan även skrivas direkt i slutet av det matematiska " "uttrycket." #: ../src/qalc.cc:2316 msgid "Terminates this program." msgstr "Avslutar det här programmet." #: ../src/qalc.cc:2321 msgid "" "Implicit multiplication does not differ from explicit multiplication " "(\"12/2(1+2) = 12/2*3 = 18\", \"5x/5y = 5*x/5*y = xy\")." msgstr "" "Implicit multiplikation särskiljer sig inte från explicit multiplikation " "(\"12/2(1+2) = 12/2*3 = 18\", \"5x/5y = 5*x/5*y = xy\")." #: ../src/qalc.cc:2324 msgid "" "Implicit multiplication is parsed before explicit multiplication " "(\"12/2(1+2) = 12/(2*3) = 2\", \"5x/5y = (5*x)/(5*y) = x/y\")." msgstr "" "Implicit multiplikation tolkas före explicit multiplikation (\"12/2(1+2) = " "12/(2*3) = 2\", \"5x/5y = (5*x)/(5*y) = x/y\")." #: ../src/qalc.cc:2327 msgid "" "The default adaptive mode works as the \"implicit first\" mode, unless " "spaces are found (\"1/5x = 1/(5*x)\", but \"1/5 x = (1/5)*x\"). In the " "adaptive mode unit expressions are parsed separately (\"5 m/5 m/s = (5*m)/" "(5*(m/s)) = 1 s\")." msgstr "" "Det förvalda adaptiva läget fungerar som \"implicit först\"-läget, såvida " "inte blanksteg är funna (\"1/5x = 1/(5*x)\", but \"1/5 x = (1/5)*x\"). I " "adaptivt läge tolkas enhetsuttryck separat (\"5 m/5 m/s = (5*m)/(5*(m/s)) = " "1 s\")." #: ../src/qalc.cc:2329 msgid "" "Function arguments without parentheses are an exception, where implicit " "multiplication in front of variables and units is parsed first regardless of " "mode (\"sqrt 2x = sqrt(2x)\")." msgstr "" "Funktionsparametrar utan parenteser utgör ett undantag, där implicit " "multiplikation frmför variabler och enheter tolkas först oavsett läge " "(\"sqrt 2x = sqrt(2x)\")." #: ../src/qalc.cc:2380 msgid "error" msgstr "fel" #: ../src/qalc.cc:2382 msgid "warning" msgstr "varning" #: ../src/qalc.cc:2437 ../libqalculate/Calculator.cc:8740 #: ../libqalculate/MathStructure.cc:483 ../libqalculate/MathStructure.cc:730 msgid "aborted" msgstr "avbruten" #: ../src/qalc.cc:2468 msgid "RPN Register Moved" msgstr "RPN-register flyttades" #: ../src/qalc.cc:2508 msgid "Processing (press Enter to abort)" msgstr "Behandlar (tryck Enter för att avbryta)" #: ../src/qalc.cc:2581 ../src/qalc.cc:3071 msgid "approx." msgstr "ca" #: ../src/qalc.cc:2693 msgid "Factorizing (press Enter to abort)" msgstr "Faktoriserar (tryck Enter för att avbryta)" #: ../src/qalc.cc:2697 msgid "Simplifying (press Enter to abort)" msgstr "Förenklar (tryck Enter för att avbryta)" #: ../src/qalc.cc:2958 msgid "Calculating (press Enter to abort)" msgstr "Beräknar (tryck Enter för att avbryta)" #: ../src/qalc.cc:3031 msgid "RPN Operation" msgstr "RPN-operation" #: ../src/qalc.cc:3414 #, c-format msgid "" "Couldn't write preferences to\n" "%s" msgstr "" "Kunde inte spara inställningar till\n" "%s" #: ../src/qalc.cc:3492 msgid "Couldn't write definitions" msgstr "Kunde inte spara definitioner" #: ../libqalculate/BuiltinFunctions.cc:59 #, 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:121 #: ../libqalculate/BuiltinFunctions.cc:181 #, c-format msgid "Row %s does not exist in matrix." msgstr "Rad %s finns inte i matrisen." #: ../libqalculate/BuiltinFunctions.cc:134 #: ../libqalculate/BuiltinFunctions.cc:177 #, c-format msgid "Column %s does not exist in matrix." msgstr "Kolumn %s finns inte i matrisen." #: ../libqalculate/BuiltinFunctions.cc:192 #, c-format msgid "Argument 3, %s, is ignored for vectors." msgstr "Parameter 3, %s, bortses från för vektorer." #: ../libqalculate/BuiltinFunctions.cc:196 #: ../libqalculate/BuiltinFunctions.cc:217 #, c-format msgid "Element %s does not exist in vector." msgstr "Element %s finns inte i vektorn." #: ../libqalculate/BuiltinFunctions.cc:405 #, 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:1243 #, 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:2113 #: ../libqalculate/BuiltinFunctions.cc:2156 #, c-format msgid "Unsolvable comparison in %s()." msgstr "Olöslig jämförelse i %s()." #: ../libqalculate/BuiltinFunctions.cc:2274 ../libqalculate/util.cc:52 msgid "now" msgstr "nu" #: ../libqalculate/BuiltinFunctions.cc:2286 #, 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:2319 #: ../libqalculate/BuiltinFunctions.cc:2332 #: ../libqalculate/BuiltinFunctions.cc:2345 #: ../libqalculate/BuiltinFunctions.cc:2367 #: ../libqalculate/BuiltinFunctions.cc:2388 #, c-format msgid "Error in date format for function %s()." msgstr "Felaktigt datumformat för %s()." #: ../libqalculate/BuiltinFunctions.cc:2642 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:2937 #: ../libqalculate/BuiltinFunctions.cc:2954 msgid "Comparison failed." msgstr "Jämförelse misslyckades." #: ../libqalculate/BuiltinFunctions.cc:2942 #: ../libqalculate/BuiltinFunctions.cc:2972 msgid "No matching item found." msgstr "Inga matchande poster funna." #: ../libqalculate/BuiltinFunctions.cc:3054 #, c-format msgid "Object %s does not exist." msgstr "Okjektet %s finns inte." #: ../libqalculate/BuiltinFunctions.cc:3081 #, c-format msgid "Register %s does not exist. Returning zero." msgstr "RPN-registret %s finns inte. Returnerar noll." #: ../libqalculate/BuiltinFunctions.cc:3124 #, c-format msgid "" "The %s function is incomplete, unreliable and unstable. Use at your own risk " "and avoid complex expressions." msgstr "" "Funktionen %s är ofullständig, inte tillförlitlig och instabil. Använd på " "egen risk och undvik komplexa uttryck." #: ../libqalculate/BuiltinFunctions.cc:3135 #: ../libqalculate/BuiltinFunctions.cc:3146 msgid "Unable to integrate the expression." msgstr "Kan inte integrera uttrycket." #: ../libqalculate/BuiltinFunctions.cc:3141 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:3282 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:3329 #, 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:3333 msgid "No possible solution was found (with current assumptions)." msgstr "Ingen möjlig lösning funnen (med nuvarande antaganden)." #: ../libqalculate/BuiltinFunctions.cc:3337 #, c-format msgid "Was unable to completely isolate %s." msgstr "Kunde inte isolera %s fullständigt." #: ../libqalculate/BuiltinFunctions.cc:3341 #: ../libqalculate/BuiltinFunctions.cc:3469 #: ../libqalculate/BuiltinFunctions.cc:3564 #, 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:3345 #, c-format msgid "Was unable to isolate %s." msgstr "Kunde inte isolera %s." #: ../libqalculate/BuiltinFunctions.cc:3428 #: ../libqalculate/BuiltinFunctions.cc:3455 #: ../libqalculate/BuiltinFunctions.cc:3538 #, 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:3431 #: ../libqalculate/BuiltinFunctions.cc:3458 #: ../libqalculate/BuiltinFunctions.cc:3541 #, 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:3464 #: ../libqalculate/BuiltinFunctions.cc:3549 #, c-format msgid "The solution requires that %s." msgstr "Lösningen kräver att %s." #: ../libqalculate/BuiltinFunctions.cc:3557 #, c-format msgid "Solution %s requires that %s." msgstr "Lösning %s kräver att %s." #: ../libqalculate/BuiltinFunctions.cc:3625 #, c-format msgid "" "Unable to isolate %s.\n" "\n" "You might need to place the equations and variables in an appropriate order " "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:3627 #: ../libqalculate/BuiltinFunctions.cc:3641 #: ../libqalculate/BuiltinFunctions.cc:3650 #, c-format msgid "Unable to isolate %s." msgstr "Kan inte isolera %s." #: ../libqalculate/BuiltinFunctions.cc:3634 #, c-format msgid "Inequalities is not allowed in %s()." msgstr "Olikheter är inte tillåtna i %s()." #: ../libqalculate/Calculator.cc:322 msgid "per" msgstr "per" #: ../libqalculate/Calculator.cc:324 msgid "times" msgstr "gånger" #: ../libqalculate/Calculator.cc:326 msgid "plus" msgstr "plus" #: ../libqalculate/Calculator.cc:328 msgid "minus" msgstr "minus" #: ../libqalculate/Calculator.cc:330 ../libqalculate/MathStructure.cc:11628 #: ../libqalculate/Function.cc:1146 ../libqalculate/Function.cc:1154 #: ../libqalculate/Function.cc:1563 ../libqalculate/Function.cc:1707 msgid "and" msgstr "och" #: ../libqalculate/Calculator.cc:334 ../libqalculate/DataSet.cc:1066 #: ../libqalculate/DataSet.cc:1129 ../libqalculate/MathStructure.cc:11642 #: ../libqalculate/Function.cc:2022 ../libqalculate/Function.cc:2038 msgid "or" msgstr "eller" #: ../libqalculate/Calculator.cc:378 ../libqalculate/Calculator.cc:1092 #: ../libqalculate/Calculator.cc:2232 ../libqalculate/Calculator.cc:2237 #: ../libqalculate/Calculator.cc:2238 msgid " to " msgstr " till " #: ../libqalculate/Calculator.cc:445 msgid "Gradians unit is missing. Creating one for this session." msgstr "Gradientenheten saknas. Skapar en för nuvarande session." #: ../libqalculate/Calculator.cc:446 ../libqalculate/Calculator.cc:454 #: ../libqalculate/Calculator.cc:462 msgid "Angle/Plane Angle" msgstr "Vinkel/Planvinkel" #: ../libqalculate/Calculator.cc:453 msgid "Radians unit is missing. Creating one for this session." msgstr "Radianenheten saknas. Skapar en för nuvarande session." #: ../libqalculate/Calculator.cc:461 msgid "Degrees unit is missing. Creating one for this session." msgstr "Gradenheten saknas. Skapar en för nuvarande session." #: ../libqalculate/Calculator.cc:1439 ../libqalculate/Calculator.cc:8795 msgid "Currency" msgstr "Valuta" #: ../libqalculate/Calculator.cc:1440 ../libqalculate/Calculator.cc:1442 #: ../libqalculate/Calculator.cc:1443 msgid "Temperature" msgstr "Temperatur" #: ../libqalculate/Calculator.cc:2197 msgid "calculating..." msgstr "beräknar..." #: ../libqalculate/Calculator.cc:2428 ../libqalculate/Calculator.cc:2436 msgid "" "Cannot convert to unit expression that includes degrees Celsius or " "Fahrenheit in addition to other units, prefixes or exponents." msgstr "" "Kan inte omvandla till enhetsuttryck som inkluderar grader Celsius eller " "Fahrenheit utöver andra ehnheter, prefix eller exponenter." #: ../libqalculate/Calculator.cc:2445 ../libqalculate/Calculator.cc:2450 #: ../libqalculate/Calculator.cc:2455 msgid "Cannot convert the expression to degrees Celsius or Fahrenheit." msgstr "Kan inte omandla uttrycket till grader Celsius eller Fahrenheit." #: ../libqalculate/Calculator.cc:3374 #, 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:3391 #, 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:3407 #, 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:4615 ../libqalculate/Calculator.cc:5378 #: ../libqalculate/Calculator.cc:5390 ../libqalculate/Calculator.cc:5415 #: ../libqalculate/Calculator.cc:5441 #, c-format msgid "Misplaced operator(s) \"%s\" ignored" msgstr "Malplacerad(e) \"%s\" ignorerades" #: ../libqalculate/Calculator.cc:4639 ../libqalculate/Calculator.cc:5465 #, c-format msgid "Misplaced '%c' ignored" msgstr "Malplacerat '%c' ignorerades" #: ../libqalculate/Calculator.cc:4666 ../libqalculate/Function.cc:1293 #: ../libqalculate/Function.cc:1324 #, c-format msgid "Internal id %s does not exist." msgstr "Internt id %s finns inte." #: ../libqalculate/Calculator.cc:4684 #, c-format msgid "\"%s\" is not a valid variable/function/unit." msgstr "\"%s\" motsvarar inte någon giltig variabel/funktion/enhet." #: ../libqalculate/Calculator.cc:4699 #, 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:5076 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:5079 msgid "Unused stack values." msgstr "Oanvända stackvärden." #: ../libqalculate/Calculator.cc:5118 ../libqalculate/Calculator.cc:5186 #, c-format msgid "RPN syntax error. Operator '%c' not supported." msgstr "RPN syntaxfel. Operator '%c' stöds ej." #: ../libqalculate/Calculator.cc:5146 msgid "RPN syntax error. Stack is empty." msgstr "RPN syntaxfel. Stacken är tom." #: ../libqalculate/Calculator.cc:5148 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:5664 #, c-format msgid "Name \"%s\" is in use. Replacing with \"%s\"." msgstr "Namnet \"%s\" är upptaget. Ändrar till \"%s\"." #: ../libqalculate/Calculator.cc:6360 ../libqalculate/DataSet.cc:535 #, c-format msgid "File not identified as Qalculate! definitions file: %s." msgstr "Filen identifierades inte som en Qalculate! definitionsfil: %s." #: ../libqalculate/Calculator.cc:8343 ../libqalculate/DataSet.cc:353 msgid "Object" msgstr "Objekt" #: ../libqalculate/Calculator.cc:8352 ../libqalculate/DataSet.cc:354 msgid "Property" msgstr "Egenskap" #: ../libqalculate/Calculator.cc:8645 msgid "column" msgstr "kolumn" #: ../libqalculate/Calculator.cc:8648 msgid "Column " msgstr "Kolumn" #: ../libqalculate/Calculator.cc:8739 ../libqalculate/Calculator.cc:8743 msgid "timed out" msgstr "tiden rann ut" #: ../libqalculate/Calculator.cc:8901 msgid "Failed to download exchange rates from ECB." msgstr "Misslyckades med att ladda ner växelkurser från ECB." #: ../libqalculate/Calculator.cc:8961 ../libqalculate/Calculator.cc:8975 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:8991 ../libqalculate/Calculator.cc:9005 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:9051 msgid "No extension in file name. Saving as PNG image." msgstr "Inget tillägg i filnamnet. Sparar som PNG-bild." #: ../libqalculate/Calculator.cc:9068 msgid "Unknown extension in file name. Saving as PNG image." msgstr "Okänt tillägg i filnamnet. Sparar som PNG-bild." #: ../libqalculate/Calculator.cc:9261 #, c-format msgid "Could not create temporary file %s" msgstr "Kunde inte skapa temporär fil %s" #: ../libqalculate/Calculator.cc:9302 msgid "It took too long to generate the plot data." msgstr "Det tog för lång tid att generara data till diagrammet." #: ../libqalculate/Calculator.cc:9316 #, 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:9318 #, 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:9344 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:379 #, c-format msgid "Object %s not available in data set." msgstr "Okjektet %s finns inte i dataset." #: ../libqalculate/DataSet.cc:389 #, c-format msgid "Property %s not available in data set." msgstr "Egenskap %s är inte tillgänglig i dataset." #: ../libqalculate/DataSet.cc:394 #, c-format msgid "Property %s not defined for object %s." msgstr "Egenskap %s inte definierad för objekt %s." #: ../libqalculate/DataSet.cc:513 ../libqalculate/DataSet.cc:521 #, c-format msgid "Unable to load data objects in %s." msgstr "Kunde inhämte dataobjekt i %s." #: ../libqalculate/DataSet.cc:1036 msgid "data property" msgstr "dataegenskap" #: ../libqalculate/DataSet.cc:1038 msgid "name of a data property" msgstr "namn på dataegenskap" #: ../libqalculate/DataSet.cc:1046 ../libqalculate/DataSet.cc:1062 msgid "no properties available" msgstr "inga egenskaper tillgängliga" #: ../libqalculate/DataSet.cc:1096 #, 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:1101 msgid "data object" msgstr "dataobjekt" #: ../libqalculate/DataSet.cc:1103 msgid "an object from" msgstr "ett objekt från" #: ../libqalculate/DataSet.cc:1132 msgid "use" msgstr "använd" #: ../libqalculate/MathStructure.cc:94 ../libqalculate/MathStructure.cc:115 #: ../libqalculate/MathStructure.cc:145 #, 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:2614 #, 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:5241 ../libqalculate/MathStructure.cc:5282 #: ../libqalculate/MathStructure.cc:5315 ../libqalculate/MathStructure.cc:5371 #: ../libqalculate/MathStructure.cc:5391 ../libqalculate/MathStructure.cc:5410 #: ../libqalculate/MathStructure.cc:5429 ../libqalculate/MathStructure.cc:5448 #: ../libqalculate/MathStructure.cc:5539 ../libqalculate/MathStructure.cc:8792 #: ../libqalculate/MathStructure.cc:8803 ../libqalculate/MathStructure.cc:8880 msgid "This is a bug. Please report it." msgstr "Detta är en bug. Var vänlig rapportera felet." #: ../libqalculate/MathStructure.cc:11722 msgid "undefined" msgstr "odefinierad" #: ../libqalculate/MathStructure.cc:11772 #, 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:11820 #, 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:12245 msgid "The determinant can only be calculated for square matrices." msgstr "Determinanten kan enbart beräknas för kvadratiska matriser." #: ../libqalculate/MathStructure.cc:12308 msgid "The permanent can only be calculated for square matrices." msgstr "Permanenten kan enbart beräknas för kvadratiska matriser." #: ../libqalculate/MathStructure.cc:12397 msgid "Inverse of singular matrix." msgstr "Invers av singulär matrs." #: ../libqalculate/Function.cc:153 #, c-format msgid "%s() requires that %s" msgstr "%s() kräver att %s" #: ../libqalculate/Function.cc:306 ../libqalculate/Function.cc:363 #: ../libqalculate/Function.cc:422 #, 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:443 #, 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:445 #, 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:1136 msgid "a free value" msgstr "ett valfritt värde" #: ../libqalculate/Function.cc:1141 msgid "that is nonzero" msgstr "som är icke-noll" #: ../libqalculate/Function.cc:1149 msgid "that is rational (polynomial)" msgstr "som är rationellt (polynom)" #: ../libqalculate/Function.cc:1157 msgid "that fulfills the condition:" msgstr "som uppfyller villkoret:" #: ../libqalculate/Function.cc:1160 msgid "Argument" msgstr "Parameter" #: ../libqalculate/Function.cc:1215 #, c-format msgid "Argument %s in %s() must be %s." msgstr "Parameter %s i %s() måste vara %s." #: ../libqalculate/Function.cc:1217 #, c-format msgid "Argument %s, %s, in %s() must be %s." msgstr "Parameter %s, %s, i %s() måste vara %s." #: ../libqalculate/Function.cc:1544 msgid "a rational number" msgstr "ett rationellt nummer" #: ../libqalculate/Function.cc:1546 msgid "a number" msgstr "ett nummer" #: ../libqalculate/Function.cc:1548 msgid "a real number" msgstr "ett reellt nummer" #: ../libqalculate/Function.cc:1553 ../libqalculate/Function.cc:1700 msgid ">=" msgstr ">=" #: ../libqalculate/Function.cc:1555 msgid ">" msgstr ">" #: ../libqalculate/Function.cc:1567 ../libqalculate/Function.cc:1710 msgid "<=" msgstr "<=" #: ../libqalculate/Function.cc:1569 msgid "<" msgstr "<" #: ../libqalculate/Function.cc:1697 msgid "an integer" msgstr "ett heltal" #: ../libqalculate/Function.cc:1728 msgid "symbol" msgstr "symbol" #: ../libqalculate/Function.cc:1729 msgid "an unknown variable/symbol" msgstr "en okänd variabel/symbol" #: ../libqalculate/Function.cc:1742 msgid "text" msgstr "text" #: ../libqalculate/Function.cc:1743 msgid "a text string" msgstr "en textsträng" #: ../libqalculate/Function.cc:1758 msgid "date" msgstr "datum" #: ../libqalculate/Function.cc:1759 msgid "a date" msgstr "ett datum" #: ../libqalculate/Function.cc:1805 msgid "a vector with " msgstr "en vektor med " #: ../libqalculate/Function.cc:1817 msgid "a vector" msgstr "en vektor" #: ../libqalculate/Function.cc:1866 msgid "a square matrix" msgstr "en kvadratisk matris" #: ../libqalculate/Function.cc:1868 msgid "a matrix" msgstr "en matris" #: ../libqalculate/Function.cc:1883 msgid "object" msgstr "objekt" #: ../libqalculate/Function.cc:1884 msgid "a valid function, unit or variable name" msgstr "ett giltigt funktions, enhets eller variabelnamn" #: ../libqalculate/Function.cc:1897 msgid "function" msgstr "funktion" #: ../libqalculate/Function.cc:1898 msgid "a valid function name" msgstr "ett giltigt funktionsnamn" #: ../libqalculate/Function.cc:1911 msgid "unit" msgstr "enhet" #: ../libqalculate/Function.cc:1912 msgid "a valid unit name" msgstr "ett giltigt enhetsnamn" #: ../libqalculate/Function.cc:1925 msgid "variable" msgstr "variabel" #: ../libqalculate/Function.cc:1926 msgid "a valid variable name" msgstr "ett giltigt variabelnamn" #: ../libqalculate/Function.cc:1939 msgid "file" msgstr "fil" #: ../libqalculate/Function.cc:1940 msgid "a valid file name" msgstr "ett giltigt filnamn" #: ../libqalculate/Function.cc:1953 msgid "boolean" msgstr "boolskt värde" #: ../libqalculate/Function.cc:1954 msgid "a boolean (0 or 1)" msgstr "ett boolskt värde (0 eller 1)" #: ../libqalculate/Function.cc:1964 msgid "angle" msgstr "vinkel" #: ../libqalculate/Function.cc:1965 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:91 ../libqalculate/Number.cc:197 #: ../libqalculate/Number.cc:219 ../libqalculate/Number.cc:521 #: ../libqalculate/Number.cc:689 ../libqalculate/Number.cc:808 #: ../libqalculate/Number.cc:818 ../libqalculate/Number.cc:828 #: ../libqalculate/Number.cc:838 ../libqalculate/Number.cc:847 #: ../libqalculate/Number.cc:860 ../libqalculate/Number.cc:873 #: ../libqalculate/Number.cc:883 ../libqalculate/Number.cc:895 #: ../libqalculate/Number.cc:905 ../libqalculate/Number.cc:944 #: ../libqalculate/Number.cc:951 ../libqalculate/Number.cc:997 #: ../libqalculate/Number.cc:1015 ../libqalculate/Number.cc:1029 #: ../libqalculate/Number.cc:1076 ../libqalculate/Number.cc:1261 #: ../libqalculate/Number.cc:1417 ../libqalculate/Number.cc:1463 #: ../libqalculate/Number.cc:1515 ../libqalculate/Number.cc:1560 #: ../libqalculate/Number.cc:1583 ../libqalculate/Number.cc:1661 #: ../libqalculate/Number.cc:1668 ../libqalculate/Number.cc:1676 #: ../libqalculate/Number.cc:1746 ../libqalculate/Number.cc:1763 #: ../libqalculate/Number.cc:1775 ../libqalculate/Number.cc:1798 #: ../libqalculate/Number.cc:1808 ../libqalculate/Number.cc:1828 #: ../libqalculate/Number.cc:1841 ../libqalculate/Number.cc:1854 #: ../libqalculate/Number.cc:1870 ../libqalculate/Number.cc:1887 #: ../libqalculate/Number.cc:1904 ../libqalculate/Number.cc:1921 #: ../libqalculate/Number.cc:1935 ../libqalculate/Number.cc:1949 #: ../libqalculate/Number.cc:1962 ../libqalculate/Number.cc:1977 #: ../libqalculate/Number.cc:1991 ../libqalculate/Number.cc:2005 #: ../libqalculate/Number.cc:2016 ../libqalculate/Number.cc:2030 #: ../libqalculate/Number.cc:2042 ../libqalculate/Number.cc:2107 #: ../libqalculate/Number.cc:2121 ../libqalculate/Number.cc:2137 #: ../libqalculate/Number.cc:2153 ../libqalculate/Number.cc:2169 #: ../libqalculate/Number.cc:2188 ../libqalculate/Number.cc:2207 #: ../libqalculate/Number.cc:2230 ../libqalculate/Number.cc:2246 #: ../libqalculate/Number.cc:2262 ../libqalculate/Number.cc:2284 #: ../libqalculate/Number.cc:2302 ../libqalculate/Number.cc:2326 #: ../libqalculate/Number.cc:2350 ../libqalculate/Number.cc:2389 #: ../libqalculate/Number.cc:2396 ../libqalculate/Number.cc:2418 #: ../libqalculate/Number.cc:2445 ../libqalculate/Number.cc:2453 #: ../libqalculate/Number.cc:2467 ../libqalculate/Number.cc:2493 #: ../libqalculate/Number.cc:2506 ../libqalculate/Number.cc:2539 #: ../libqalculate/Number.cc:2568 ../libqalculate/Number.cc:2595 #: ../libqalculate/Number.cc:2623 ../libqalculate/Number.cc:2638 #: ../libqalculate/Number.cc:2648 ../libqalculate/Number.cc:2666 #: ../libqalculate/Number.cc:2684 ../libqalculate/Number.cc:2690 #: ../libqalculate/Number.cc:2709 ../libqalculate/Number.cc:2716 #: ../libqalculate/Number.cc:3077 ../libqalculate/Number.cc:3113 #: ../libqalculate/Number.cc:3149 ../libqalculate/Number.cc:3258 #: ../libqalculate/Number.cc:3268 ../libqalculate/Number.cc:3274 #: ../libqalculate/Number.cc:3280 ../libqalculate/Number.cc:3286 #: ../libqalculate/Number.cc:3362 ../libqalculate/Number.cc:3386 #: ../libqalculate/Number.cc:3422 #, c-format msgid "CLN Exception: %s" msgstr "CLN Exception: %s" #: ../libqalculate/Number.cc:174 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:268 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:346 #, c-format msgid "Error in roman numerals: %s." msgstr "Fel i romerska siffor: \"%s\"." #: ../libqalculate/Number.cc:381 #, c-format msgid "Unknown roman numeral: %c." msgstr "Okänd romersk siffra: %c." #: ../libqalculate/Number.cc:439 #, 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:528 msgid "':' in decimal number ignored (decimal point detected)." msgstr "':' i decimalt tal ignorerades (decimalkomma upptäckt)." #: ../libqalculate/Number.cc:584 #, 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:1633 msgid "Division by zero." msgstr "Division med noll." #. 0^0 #: ../libqalculate/Number.cc:1639 msgid "0^0 might be considered undefined" msgstr "0^0 kan anses vara odefinierat" #: ../libqalculate/Number.cc:1644 msgid "The result of 0^i is possibly undefined" msgstr "Resulatatet av 0^i är möjligen idefinierat" #: ../libqalculate/Number.cc:2094 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:2100 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:3231 ../libqalculate/Number.cc:3239 #: ../libqalculate/Number.cc:3248 msgid "infinity" msgstr "oändlighet" #: ../libqalculate/Unit.cc:850 msgid "Error(s) in unitexpression." msgstr "Fel i enhetsuttryck." #. 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); #: ../libqalculate/util.cc:52 msgid "today" msgstr "idag" #: ../libqalculate/util.cc:55 msgid "tomorrow" msgstr "imorgon" #: ../libqalculate/util.cc:59 msgid "yesterday" msgstr "igår" #: ../libqalculate/util.cc:535 msgid "Yes" msgstr "Ja" #: ../libqalculate/util.cc:536 msgid "No" msgstr "Nej" #: ../libqalculate/util.cc:543 msgid "True" msgstr "Sant" #: ../libqalculate/util.cc:544 msgid "False" msgstr "Falskt" #: ../libqalculate/util.cc:551 msgid "On" msgstr "På" #: ../libqalculate/util.cc:552 msgid "Off" msgstr "Av" #~ msgid "no variables" #~ msgstr "inga variabler" #~ msgid "no functions" #~ msgstr "inga funktioner" #~ msgid "no units" #~ msgstr "inga enheter" #~ msgid "" #~ "For a list of predefined functions, variables and units, see the " #~ "appendixes of the manual of the graphical user interface (available at " #~ "http://qalculate.github.io/manual/index.html)." #~ msgstr "" #~ "För en förteckning över fördefinierade funktioner, variabler och enheter, " #~ "se appendixen i instruktionsboken för det grafiska användargränssnittet " #~ "(tillgänglig på http://qalculate.github.io/manual/index.html)." #~ 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." #~ msgid "implicit" #~ msgstr "implicit" #~ msgid "UNIT" #~ msgstr "ENHET" #~ msgid "a unit (example meter)" #~ msgstr "en enhet (exempel meter)" #~ msgid "best (convert best unit)" #~ msgstr "bästa (omvandla till bästa enhet)" #~ msgid "Example: convert best." #~ msgstr "Exempel: convert bästa." #~ msgid "Decimal point in sexagesimal number treated as ':'." #~ msgstr "Decimalkomma i sexagesimala tal behandlas som ':'." #~ 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.10/configure.ac0000644000175000017500000001771412757635777013516 00000000000000dnl dnl configure.in for libqalculate dnl dnl ---------------------- dnl | initialize autotools |--------------------------------------------------- dnl ---------------------- AC_INIT([libqalculate], [0.9.10]) AC_CONFIG_SRCDIR(libqalculate/Calculator.cc) AM_INIT_AUTOMAKE 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=6 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++]) AC_CHECK_HEADERS([unordered_map]) 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_CLAGS) 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_CFLAGS" 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) AC_SEARCH_LIBS([nanosleep],[rt posix4]) 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 dnl lconv AC_CHECK_MEMBERS([struct lconv.int_p_cs_precedes,] dnl [struct lconv.int_n_cs_precedes],[],[],[AC_INCLUDES_DEFAULT #include ]) 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 ])