diff --git a/.cproject b/.cproject new file mode 100644 index 0000000000000000000000000000000000000000..173198bb74208c249e340effb523ee7b99162a7c --- /dev/null +++ b/.cproject @@ -0,0 +1,318 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<?fileVersion 4.0.0?> + +<cproject> +<storageModule moduleId="org.eclipse.cdt.core.settings"> +<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.2028848925"> +<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.2028848925" moduleId="org.eclipse.cdt.core.settings" name="Linux GCC"> +<externalSettings/> +<extensions> +<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> +<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +</extensions> +</storageModule> +<storageModule moduleId="cdtBuildSystem" version="4.0.0"> +<configuration artifactName="sflphone" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.2028848925" name="Linux GCC" parent="org.eclipse.cdt.build.core.emptycfg"> +<folderInfo id="cdt.managedbuild.toolchain.gnu.base.2028848925.1702545013" name="/" resourcePath=""> +<toolChain id="cdt.managedbuild.toolchain.gnu.base.2089599304" name="cdt.managedbuild.toolchain.gnu.base" superClass="cdt.managedbuild.toolchain.gnu.base"> +<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1774974985" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/> +<builder id="cdt.managedbuild.target.gnu.builder.base.466829147" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/> +<tool id="cdt.managedbuild.tool.gnu.archiver.base.740005240" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.63410449" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base"> +<option id="gnu.cpp.compiler.option.include.paths.1295746905" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value="/usr/include/c++/4.3/list"/> +<listOptionValue builtIn="false" value="/usr/include/c++/4.3/string"/> +<listOptionValue builtIn="false" value="/usr/include/c++/4.3/map"/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1521967404" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.260142907" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base"> +<option id="gnu.c.compiler.option.include.paths.1990006641" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value="/usr/include/c++/4.3/list"/> +<listOptionValue builtIn="false" value="/usr/include/c++/4.3/string"/> +<listOptionValue builtIn="false" value="/usr/include/c++/4.3/map"/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.124347870" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.linker.base.457097362" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1227214045" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base"> +<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.890036182" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> +<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> +<additionalInput kind="additionalinput" paths="$(LIBS)"/> +</inputType> +</tool> +<tool id="cdt.managedbuild.tool.gnu.assembler.base.157782839" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base"> +<option id="gnu.both.asm.option.include.paths.1462205363" superClass="gnu.both.asm.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value="/usr/include/c++/4.3/list"/> +<listOptionValue builtIn="false" value="/usr/include/c++/4.3/string"/> +<listOptionValue builtIn="false" value="/usr/include/c++/4.3/map"/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1762206279" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> +</tool> +</toolChain> +</folderInfo> +<sourceEntries> +<entry excluding="sflphone-gtk" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> +</sourceEntries> +</configuration> +</storageModule> +<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> +<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/> +<storageModule moduleId="scannerConfiguration"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.2028848925;cdt.managedbuild.toolchain.gnu.base.2028848925.1702545013;cdt.managedbuild.tool.gnu.cpp.compiler.base.63410449;cdt.managedbuild.tool.gnu.cpp.compiler.input.1521967404"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.2028848925;cdt.managedbuild.toolchain.gnu.base.2028848925.1702545013;cdt.managedbuild.tool.gnu.c.compiler.base.260142907;cdt.managedbuild.tool.gnu.c.compiler.input.124347870"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +</storageModule> +</cconfiguration> +</storageModule> +<storageModule moduleId="cdtBuildSystem" version="4.0.0"> +<project id="sflphone.null.1186992360" name="sflphone"/> +</storageModule> +</cproject> diff --git a/.gitignore b/.gitignore index a7f98b11f341ba96fcb1b1c9762e4fb301eb4bb0..cb731eed49f3f940f395c46ea085dbed6254baca 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,8 @@ doc/doxygen/core-doc doc/doxygen/gtk-gui-doc doc/*.html +INSTALL + # Ignore buildsys stuff /autom4te.cache /configure @@ -36,6 +38,7 @@ doc/*.html /install-sh /stamp-h1 /Makefile +sflphone-gtk/stamp-h1 # Ignore built stuff /src/sflphoned @@ -70,6 +73,7 @@ src/plug-in/audiorecorder/Makefile src/audio/Makefile src/audio/codecs/Makefile src/audio/codecs/ilbc/Makefile +src/hooks/Makefile doc/Makefile man/Makefile po/Makefile @@ -79,13 +83,17 @@ doc/doxygen/Makefile libs/Makefile libs/utilspp/Makefile libs/stund/Makefile +libs/iax2/Makefile libs/utilspp/functor/Makefile libs/utilspp/singleton/Makefile sflphone-gtk/Makefile sflphone-gtk/src/Makefile -sflphone-gtk/src/contactlist/Makefile +sflphone-gtk/src/config/Makefile +sflphone-gtk/src/dbus/Makefile +sflphone-gtk/src/contacts/Makefile +sflphone-gtk/src/contacts/addressbook/Makefile sflphone-gtk/pixmaps/Makefile - +sflphone-gtk/tests/Makefile # Ignore sflphone-gtk stuff @@ -100,6 +108,10 @@ sflphone-gtk/pixmaps/Makefile /sflphone-gtk/sflphone.desktop /sflphone-gtk/confdefs.h /sflphone-gtk/conftest.dir +/sflphone-gtk/tests/check_config +/sflphone-gtk/tests/check_contacts +/sflphone-gtk/tests/check_dbus +/sflphone-gtk/tests/check_global # Ignore sflphone_kde stuff /sflphone_kde/build diff --git a/.project b/.project new file mode 100644 index 0000000000000000000000000000000000000000..f9b08154597ee09847322ef15e715a9a244a7b75 --- /dev/null +++ b/.project @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>sflphone</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> + <triggers>clean,full,incremental,</triggers> + <arguments> + <dictionary> + <key>?name?</key> + <value></value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.append_environment</key> + <value>true</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.autoBuildTarget</key> + <value>all</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.buildArguments</key> + <value></value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.buildCommand</key> + <value>make</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.cleanBuildTarget</key> + <value>clean</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.contents</key> + <value>org.eclipse.cdt.make.core.activeConfigSettings</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.enableAutoBuild</key> + <value>false</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.enableCleanBuild</key> + <value>true</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.enableFullBuild</key> + <value>true</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.fullBuildTarget</key> + <value>all</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.stopOnError</key> + <value>true</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key> + <value>true</value> + </dictionary> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.cdt.core.ccnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.core.cnature</nature> + </natures> +</projectDescription> diff --git a/INSTALL b/INSTALL deleted file mode 100644 index d3c5b40a94091285c27361905f591af64c1f7b21..0000000000000000000000000000000000000000 --- a/INSTALL +++ /dev/null @@ -1,237 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007 Free Software Foundation, Inc. - -This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - -Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. - - 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 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. - - Running `configure' might take a while. 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. - - 6. Often, you can also type `make uninstall' to remove the installed - files again. - -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=c99 CFLAGS=-g 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 can use 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 `..'. - - With a non-GNU `make', it is safer 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' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' 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 option `--target=TYPE' 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 - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`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. - diff --git a/Makefile.am b/Makefile.am index 8dc7f28e1dde2b564673fec2b447e5a6df0620d3..f774bdf57cdde3095aa6082adb35b7f09a5c383c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,6 +9,6 @@ unittest: ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = libs src ringtones po man +SUBDIRS = libs src ringtones po man test EXTRA_DIST = m4/*.m4 tools/*.sh platform/* images/* README.gentoo diff --git a/autogen.sh b/autogen.sh index 06b6a97c95e0c7f4db9c8bd21a358a14784e9187..4221697b3a0b863fe31f65321bcf3ad0dd7409ef 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,9 +1,20 @@ -#!/bin/sh - -# could be replaced with autoconf -v -f (verbose, force rebuild of ltmain, .in files, etc.) -aclocal -I m4 -libtoolize --force -autoheader -autoconf -f -automake -a +#!/bin/bash + +function autocmd() +{ + echo "Running ${1}..." + $* || { + echo "Error running ${1}" + exit 1 + } +} + +autocmd libtoolize --force --copy +autocmd aclocal +autocmd autoheader +autocmd autoconf -f +autocmd automake --add-missing --force-missing --copy -Wall + ./configure $@ + + diff --git a/configure.ac b/configure.ac index e0108a27a838387af7d1b79794aa8896bd535517..61f85264c8731efe2fe61bd99efdae62f56cd39d 100644 --- a/configure.ac +++ b/configure.ac @@ -2,18 +2,23 @@ dnl SFLPhone - configure.ac for automake 1.9 and autoconf 2.59 dnl dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([SFLphone],[0.9.4],[sflphoneteam@savoirfairelinux.com],[sflphone]) +AC_INIT([SFLphone],[0.9.5~beta],[sflphoneteam@savoirfairelinux.com],[sflphone]) AC_COPYRIGHT([[Copyright (c) Savoir-Faire Linux 2004-2009]]) AC_REVISION([$Revision$]) +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) +AM_CONFIG_HEADER([config.h]) + dnl Compute canonical system name -AC_CANONICAL_TARGET +dnl AC_CANONICAL_TARGET -dnl Rewrite name of programs to be installed -AC_ARG_PROGRAM +dnl Use this variable in the program +AC_SUBST(PACKAGE_VERSION) + +AM_PROG_LIBTOOL -dnl Automake options -AM_INIT_AUTOMAKE([-Wno-portability]) +dnl Rewrite name of programs to be installed +dnl AC_ARG_PROGRAM dnl Improve make variable MAKE AC_PROG_MAKE_SET @@ -29,7 +34,12 @@ AC_CONFIG_FILES([libs/Makefile \ libs/stund/Makefile \ libs/utilspp/Makefile \ libs/utilspp/functor/Makefile \ - libs/utilspp/singleton/Makefile]) + libs/utilspp/singleton/Makefile \ + libs/dbus-c++/Makefile \ + libs/dbus-c++/src/Makefile \ + libs/dbus-c++/tools/Makefile \ + libs/dbus-c++/data/Makefile \ + libs/iax2/Makefile]) AC_CONFIG_FILES([src/Makefile \ src/audio/Makefile \ @@ -60,17 +70,6 @@ AC_CONFIG_FILES([platform/suse.spec \ dnl the file stamp-h.in should be there before (instead of AC_CONFIG_HEADERS(config.h)) dnl AM_CONFIG_HEADER(config.h) -dnl Get project version -VERSION=`sed -ne 's/^#define SFLPHONED_VERSION "\(.*\)"/\1/p' src/global.h` - -dnl Get rid of release number -RPM_VERSION=`echo $VERSION | cut -d- -f1` -AC_SUBST(RPM_VERSION) -RPM_RELEASE=`echo $VERSION | sed -ne 's/.*-\(.*\)/\1/p' ` -AC_SUBST(RPM_RELEASE) -VERSION=`echo $VERSION | cut -f1 -d\' \'` -AC_SUBST(VERSION) - dnl Settings need Standard C++ Library LIBS="$LIBS -lstdc++" @@ -190,10 +189,82 @@ PKG_CHECK_MODULES(CCRTP, libccrtp1 >= ${LIBCCRT_MIN_VERSION}) AC_SUBST(CCRTP_LIBS) AC_SUBST(CCRTP_CFLAGS) -LIBDBUSCPP_MIN_VERSION=0.5 -PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1 >= ${LIBDBUSCPP_MIN_VERSION}) -AC_SUBST(DBUSCPP_LIBS) -AC_SUBST(DBUSCPP_CFLAGS) +dnl DBus-C++ detection (used to be in library own build system) +DBUS_REQUIRED_VERSION=0.60 +PKG_CHECK_MODULES(dbus, [dbus-1 >= $DBUS_REQUIRED_VERSION],, + AC_MSG_ERROR([You need the DBus libraries (version 0.6 or better)] + [http://www.freedesktop.org/wiki/Software_2fdbus]) +) +AC_SUBST(dbus_CFLAGS) +AC_SUBST(dbus_LIBS) + +DBUS_API_STABLE_VERSION=1.0.0 +PKG_CHECK_EXISTS([dbus-1 < $DBUS_API_STABLE_VERSION], + [AC_DEFINE(DBUS_API_SUBJECT_TO_CHANGE, , [unstable DBus])] +) + +DBUS_THREADS_INIT_DEFAULT_VERSION=0.93 +PKG_CHECK_EXISTS([dbus-1 >= $DBUS_THREADS_INIT_DEFAULT_VERSION], + [AC_DEFINE(DBUS_HAS_THREADS_INIT_DEFAULT, , [dbus_threads_init_default (needs DBus >= 0.93)])] +) + +DBUS_RECURSIVE_MUTEX_VERSION=0.95 +PKG_CHECK_EXISTS([dbus-1 >= $DBUS_RECURSIVE_MUTEX_VERSION], + [AC_DEFINE(DBUS_HAS_RECURSIVE_MUTEX, , [DBus supports recursive mutexes (needs DBus >= 0.95)])] +) + +if test "$enable_glib" = "yes" ; then +PKG_CHECK_MODULES([glib], glib-2.0) +AC_SUBST(glib_CFLAGS) +AC_SUBST(glib_LIBS) +AM_CONDITIONAL(ENABLE_GLIB, test 1 = 1) +PKG_CHECK_MODULES([gtkmm], gtkmm-2.4, + AM_CONDITIONAL(HAVE_GTKMM, test 1 = 1), + AM_CONDITIONAL(HAVE_GTKMM, test 0 = 1) +) +AC_SUBST(gtkmm_CFLAGS) +AC_SUBST(gtkmm_LIBS) +else +AM_CONDITIONAL(ENABLE_GLIB, test 0 = 1) +AM_CONDITIONAL(HAVE_GTKMM, test 0 = 1) +fi + +AC_CHECK_LIB([expat], XML_ParserCreate_MM, + [AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false)], + have_expat=false) + +if ! $have_expat; then + AC_MSG_ERROR([You need the eXpat xml parser] + [http://expat.sourceforge.net/]) +fi + +xml_CFLAGS= +xml_LIBS=-lexpat + +AC_SUBST(xml_CFLAGS) +AC_SUBST(xml_LIBS) + +AC_CHECK_LIB([pthread], pthread_create, + [AC_CHECK_HEADERS(pthread.h, have_pthread=true, have_pthread=false)], + have_pthread=false) + +if test "$have_pthread" = "false"; then + AC_MSG_ERROR([You need the POSIX Thread library (pthreads)]) +fi + +# For the tools/, we need libdbus-c++ for the "build" architecture as well + +AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes") + +AC_ARG_WITH(build-libdbus-cxx, + AS_HELP_STRING([--with-build-libdbus-cxx], + [For cross compilation: path to libdbus-cxx which was compiled for the 'build' system.]), + [ BUILD_LIBDBUS_CXX_DIR=${withval} ], + [ BUILD_LIBDBUS_CXX_DIR="\$(top_builddir)" ] +) +AC_SUBST(BUILD_LIBDBUS_CXX_DIR) + + dnl Check for libcppunit-dev CPPUNIT_MIN_VERSION=1.12 @@ -240,12 +311,6 @@ AS_IF([test "x$with_speex" != xno], ] dnl More advanced check in case the libspeexdsp is not installed AC_SEARCH_LIBS(speex_preprocess_run, speexdsp, HAVE_SPEEXDSP="yes", HAVE_SPEEXDSP="no", []) - -if test $HAVE_SPEEXDSP="no"; then - echo $HAVE_SPEEXDSP; - AC_MSG_WARN([The silence detection in speex could not have been enabled]) -fi - ) AC_DEFINE([HAVE_SPEEX], test "x$with_speex" = "xyes", [Define if you have libspeex]) @@ -268,72 +333,9 @@ AC_ARG_WITH([iax2], [], [with_iax2=yes]) -LIBIAX2= -AS_IF([test "x$with_iax2" != xno], - [AC_CHECK_HEADER([iax2/iax.h], , AC_MSG_FAILURE([Unable to find the libiax2 headers. You may need to install sflphone-iax2-dev package. You may use --without-iax2 to compile without iax2 protocol support.]))] - [AC_CHECK_LIB([iax2], [iax_init], - [], - [AC_MSG_FAILURE( - [libiax2 link test failed. You may use --without-iax2 to compile without iax2 protocol support.])] - ) - ] -) - AC_DEFINE([HAVE_IAX], test "x$with_iax2" = "xyes", [Define if you have libiax2]) AM_CONDITIONAL(USE_IAX, test "x$with_iax2" = "xyes" ) -dnl Check for readline -GNUPG_CHECK_READLINE - -dnl Check for zeroconf (from apple) -AC_ARG_ENABLE(zeroconf, - AS_HELP_STRING( - [--disable-zeroconf], - [disables libdns_sd (browsing and publishing DNS-SD services will not be possible) @<:@default=no@:>@] - ), - [without_zeroconf=$enableval], - [without_zeroconf="no"] -) -if test "x$without_zeroconf" = "xno"; then - AC_MSG_CHECKING(for DNS-SD support) - save_dnssdtest_LIBS="$LIBS" - save_dnssdtest_LDFLAGS="$LDFLAGS" - save_dnssdtest_CPPFLAGS="$CPPFLAGS" - LDFLAGS="$all_libraries $LDFLAGS" - CPPFLAGS="$CPPFLAGS $all_includes" - case $host_os in - darwin*) LIBS="" ;; - *) LIBS="-ldns_sd" ;; - esac - have_libdns_sd="no" - AC_LINK_IFELSE( - [AC_LANG_SOURCE([[ - #include <dns_sd.h> - ]], [[ - DNSServiceRefDeallocate( (DNSServiceRef) 0); - TXTRecordDeallocate( (TXTRecordRef*) 0); - ]]) - ],[ - AC_DEFINE(HAVE_DNSSD, 1, [Define if dns-sd is available]) - case $host_os in - darwin*) LIB_DNSSD="" ;; - *) LIB_DNSSD="-ldns_sd" ;; - esac - have_libdns_sd="yes" - AC_MSG_RESULT(yes) - ],[ - AC_MSG_RESULT(no) - LIB_DNSSD="" - ]) - CPPFLAGS=$save_dnssdtest_CPPFLAGS - LDFLAGS=$save_dnssdtest_LDFLAGS - LIBS=$save_dnssdtest_LIBS -fi -AC_SUBST(LIB_DNSSD) -AM_CONDITIONAL(USE_ZEROCONF, test "$have_libdns_sd" = "yes") - - - # check for doxygen, mostly stolen from http://log4cpp.sourceforge.net/ # ---------------------------------------------------------------------------- AC_DEFUN([BB_ENABLE_DOXYGEN], diff --git a/debian/changelog b/debian/changelog index 82738fe39e45b91e3ac4d680a3d0c2706644fda3..d0add3cf4a119ae9dcdf89101b038aa6133b86ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,52 @@ +sflphone (0.9.4-0ubuntu2) %system%; urgency=low + + [ Alexandre Savard ] + * Restore speex and GSM detection + + [ Emmanuel Milou ] + * Fix bug #1090 + + -- Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> Wed, 8 Apr 2009 11:29:15 -0500 + +sflphone (0.9.4-0ubuntu1) %system%; urgency=low + + [ Emmanuel Milou ] + * Integrate DBus-c++ and libiax2 in the main build system + * Clean up in the working repository + * Reorder hooks configuration panel + * Protect case when no codecs are active + * Fix some return values + * Add unitary tests for the hook manager (premisces) + + [Yun Liu] + * Update chinese translation + + [Sven Werlen] + * Update german translation + + [Hussein Abdallah] + * Update russian translation + + [Maxime Chambreuil] + * Update spanish translation + + -- Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> Fri, 3 Apr 2009 18:29:15 -0500 + + +sflphone (0.9.4-rc1) %system%; urgency=low + + [ Emmanuel Milou ] + * Fix bug while trying to hold/unhold several simultaneous call + * Improve address book build system + * Implement SIP url popup on incoming call + * Improve GTK+ panel configuration + [ Julien Bonjean ] + * GTK+ client refactoring + * GTK+ clean up + * Address book improvment + + -- Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> Fri, 27 Mar 2009 18:29:15 -0500 + sflphone (0.9.4-0beta1) %system%; urgency=low [ Alexandre Savard ] diff --git a/debian/control.hardy b/debian/control.hardy index 62a95771912ac053345e9e54bb6442e9ac14e3e0..80a4d6eb66ffbf533d8420eef2bf0f18aa004502 100644 --- a/debian/control.hardy +++ b/debian/control.hardy @@ -2,13 +2,13 @@ Source: sflphone Maintainer: SavoirFaireLinux Inc <emmanuel.milou@savoirfairelinux.com> Section: gnome Priority: optional -Build-Depends: debhelper (>= 5), autoconf, automake, libpulse-dev, libsamplerate0-dev, libcommoncpp2-dev, libccrtp-dev, libcppunit-dev, libgsm1-dev, libspeex-dev, libtool, libgtk2.0-dev, libsexy-dev, libdbus-1-dev, libdbus-glib-1-dev, libnotify-dev, libasound2-dev +Build-Depends: debhelper (>= 5), autoconf, automake, libpulse-dev, libsamplerate0-dev, libcommoncpp2-dev, libccrtp-dev, libcppunit-dev, libgsm1-dev, libspeex-dev, libtool, libgtk2.0-dev, libsexy-dev, libdbus-1-dev, libdbus-glib-1-dev, libnotify-dev, libasound2-dev, libebook1.2-dev, uuid-dev, check Standards-Version: 3.7.3 Package: sflphone Priority: optional Architecture: any -Depends: libgcc1 , libsamplerate0 (>=0.1.2) , libdbus-glib-1-2 (>= 0.73), libexpat1 , libgtk2.0-0 , libc6 (>= 2.3.6-6) , libglib2.0-0 (>= 2.12.0) , libcommoncpp2-1.6-0 ,libgsm1 (>=1.0.10) , libspeex1 (>=1.1.12) , libdbus-1-3, libdbus-glib-1-2, libsexy2 (>=0.1.11), libcppunit-1.12-0, libasound2 (>= 1.0), libpulse0 (>= 0.9.6), libccrtp1-1.6-0, libnotify1 (>= 0.4), libsexy2 (>= 0.1), perl (>=5.5.8), librsvg2-common (>=2.22.2) +Depends: libgcc1 , libsamplerate0 (>=0.1.2) , libdbus-glib-1-2 (>= 0.73), libexpat1 , libgtk2.0-0 , libc6 (>= 2.3.6-6) , libglib2.0-0 (>= 2.12.0) , libcommoncpp2-1.6-0 ,libgsm1 (>=1.0.10) , libspeex1 (>=1.1.12) , libdbus-1-3, libdbus-glib-1-2, libasound2 (>= 1.0), libpulse0 (>= 0.9.6), libccrtp1-1.6-0, libnotify1 (>= 0.4), libsexy2 (>= 0.1), librsvg2-common (>=2.22.2) Homepage: http://www.sflphone.org Description: SIP and IAX2 compatible softphone SFLphone is meant to be a robust enterprise-class desktop phone. diff --git a/debian/control.intrepid b/debian/control.intrepid index 737fc36b64c051d0cbee4f8b4dff548f014d2234..879c38dcb23eabb2b16c4e735894bf6a4d510e9b 100644 --- a/debian/control.intrepid +++ b/debian/control.intrepid @@ -2,13 +2,13 @@ Source: sflphone Maintainer: SavoirFaireLinux Inc <emmanuel.milou@savoirfairelinux.com> Section: gnome Priority: optional -Build-Depends: debhelper (>= 5), autoconf, libpulse-dev, libsamplerate0-dev, libcommoncpp2-dev, libccrtp-dev, libcppunit-dev, libgsm1-dev, libspeex-dev, libtool, libgtk2.0-dev, libsexy-dev, libdbus-1-dev, libdbus-glib-1-dev, libnotify-dev, libasound2-dev, libspeexdsp-dev, uuid-dev +Build-Depends: debhelper (>= 5), autoconf, libpulse-dev, libsamplerate0-dev, libcommoncpp2-dev, libccrtp-dev, libcppunit-dev, libgsm1-dev, libspeex-dev, libtool, libgtk2.0-dev, libsexy-dev, libdbus-1-dev, libdbus-glib-1-dev, libnotify-dev, libasound2-dev, libspeexdsp-dev, uuid-dev, libebook1.2-dev, check Standards-Version: 3.8.0 Package: sflphone Priority: optional Architecture: any -Depends: libgcc1 , libsamplerate0 (>=0.1.2) , libdbus-glib-1-2 (>= 0.73), libexpat1 , libgtk2.0-0 , libc6 (>= 2.3.6-6) , libglib2.0-0 (>= 2.12.0) , libcommoncpp2-1.6-0 , libgsm1 (>=1.0.10) , libspeex1 (>=1.1.12) , libdbus-1-3, libdbus-glib-1-2, libsexy2 (>=0.1.11), libcppunit-1.12-1, libasound2 (>= 1.0), libpulse0 (>= 0.9.6), libccrtp1-1.6-1, libnotify1 (>= 0.4), libsexy2 (>= 0.1), perl (>=5.5.8), librsvg2-common (>= 2.22.2), libspeexdsp1 +Depends: libgcc1 , libsamplerate0 (>=0.1.2) , libdbus-glib-1-2 (>= 0.73), libexpat1 , libgtk2.0-0 , libc6 (>= 2.3.6-6) , libglib2.0-0 (>= 2.12.0) , libcommoncpp2-1.6-0 , libgsm1 (>=1.0.10) , libspeex1 (>=1.1.12) , libdbus-1-3, libdbus-glib-1-2, libasound2 (>= 1.0), libpulse0 (>= 0.9.6), libccrtp1-1.6-1, libnotify1 (>= 0.4), libsexy2 (>= 0.1), librsvg2-common (>= 2.22.2), libspeexdsp1 Homepage: http://www.sflphone.org Description: SIP and IAX2 compatible softphone SFLphone is meant to be a robust enterprise-class desktop phone. diff --git a/debian/control.jaunty b/debian/control.jaunty index b88584932302734a1bd1de6494b94d9040584f73..2c5f9f0a2c0457afd2f962fc55cae696ae5187e6 100644 --- a/debian/control.jaunty +++ b/debian/control.jaunty @@ -2,13 +2,13 @@ Source: sflphone Maintainer: SavoirFaireLinux Inc <emmanuel.milou@savoirfairelinux.com> Section: gnome Priority: optional -Build-Depends: debhelper (>= 5), autoconf, automake, libpulse-dev, libsamplerate0-dev, libcommoncpp2-dev, libccrtp-dev, libcppunit-dev, libgsm1-dev, libspeex-dev, libtool, libgtk2.0-dev, libsexy-dev, libdbus-1-dev, libdbus-glib-1-dev, libnotify-dev, libasound2-dev, libspeexdsp-dev, uuid-dev +Build-Depends: debhelper (>= 5), autoconf, automake, libpulse-dev, libsamplerate0-dev, libcommoncpp2-dev, libccrtp-dev, libcppunit-dev, libgsm1-dev, libspeex-dev, libtool, libgtk2.0-dev (>=2.16), libdbus-1-dev, libdbus-glib-1-dev, libnotify-dev, libasound2-dev, libspeexdsp-dev, uuid-dev, libebook1.2-dev, check Standards-Version: 3.7.3 Package: sflphone Priority: optional Architecture: any -Depends: libgcc1 , libsamplerate0 (>=0.1.2) , libdbus-glib-1-2 (>= 0.73), libexpat1 , libgtk2.0-0 , libc6 (>= 2.3.6-6) , libglib2.0-0 (>= 2.12.0) , libcommoncpp2-1.6-0 , libgsm1 (>=1.0.10) , libspeex1 (>=1.1.12) , libdbus-1-3, libdbus-glib-1-2, libsexy2 (>=0.1.11), libcppunit-1.12-1, libasound2 (>= 1.0), libpulse0 (>= 0.9.6), libccrtp1-1.6-1, libnotify1 (>= 0.4), libsexy2 (>= 0.1), perl (>=5.5.8), librsvg2-common (>=2.22.2), libspeexdsp1 +Depends: libgcc1 , libsamplerate0 (>=0.1.2) , libdbus-glib-1-2 (>= 0.73), libexpat1 , libgtk2.0-0 (>=2.16) , libc6 (>= 2.3.6-6) , libglib2.0-0 (>= 2.12.0) , libcommoncpp2-1.6-0 , libgsm1 (>=1.0.10) , libspeex1 (>=1.1.12) , libdbus-1-3, libdbus-glib-1-2, libasound2 (>= 1.0), libpulse0 (>= 0.9.6), libccrtp1-1.6-1, libnotify1 (>= 0.4), librsvg2-common (>=2.22.2), libspeexdsp1 Homepage: http://www.sflphone.org Description: SIP and IAX2 compatible softphone SFLphone is meant to be a robust enterprise-class desktop phone. diff --git a/debian/copyright b/debian/copyright index b2b1db618faada9f059816c127e00d081dbf17bf..fbde2314bef1fb7ee643083e6d27c397213c5ead 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,5 +1,5 @@ This package was debianized by Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> on -Wed, 26 Nov 2008 09:47:53 -0500. +Fri, 3 Apr 2009 09:47:53 -0500. It was downloaded from the git repository of SFLphone: git://sflphone.org/git/sflphone.git diff --git a/debian/preinst b/debian/preinst new file mode 100644 index 0000000000000000000000000000000000000000..62e6bac01fd509baaafd1febc19e6d0eff567a97 --- /dev/null +++ b/debian/preinst @@ -0,0 +1,18 @@ +#!/bin/sh +# postrm script for sflphone +# +# see: dh_installdeb(1) + +set -e + +package=sflphone + +case "$1" in + install|upgrade) + # Clear the old dbus-c++ and iax2 if presents + rm -rf /usr/lib/libdbus-c++* + rm -rf /usr/lib/libiax2* + ;; +esac + +exit 0 diff --git a/debian/rules b/debian/rules index c67463555b7fb6a22722ba263014dc2e120a600a..da1410ce42a2e7adc6c06984de755a7852defb91 100755 --- a/debian/rules +++ b/debian/rules @@ -20,11 +20,9 @@ configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. - cd libs/dbus-c++; ./autogen.sh; ./configure - cd libs/libiax2; ./gen.sh; ./configure - cd libs/pjproject-1.0.1; ./configure - ./autogen.sh --prefix=/usr --with-debug + ./autogen.sh --prefix=/usr cd sflphone-gtk; ./autogen.sh --prefix=/usr + cd libs/pjproject-1.0.1; ./configure touch configure-stamp @@ -34,13 +32,11 @@ build: build-arch build-indep build-arch: build-arch-stamp build-arch-stamp: configure-stamp - # Add here commands to compile the arch part of the package. + # Add here commands to compile the arch part of the package. $(MAKE) cd sflphone-gtk; make cd libs/pjproject-1.0.1; $(MAKE) dep; $(MAKE) touch $@ - cd libs/dbus-c++; $(MAKE) - cd libs/libiax2; $(MAKE) build-indep: build-indep-stamp build-indep-stamp: configure-stamp @@ -81,8 +77,6 @@ install-arch: $(MAKE) prefix=$(CURDIR)/debian/$(package)/usr install cd sflphone-gtk; $(MAKE) prefix=$(CURDIR)/debian/$(package)/usr install cd libs/pjproject-1.0.1; $(MAKE) prefix=$(CURDIR)/debian/$(package)/usr install - cd libs/dbus-c++; $(MAKE) prefix=$(CURDIR)/debian/$(package)/usr install - cd libs/libiax2; $(MAKE) prefix=$(CURDIR)/debian/$(package)/usr install rm -rf $(CURDIR)/debian/$(package)/usr/include dh_install -s # Must not depend on anything. This is to be called by diff --git a/debian/update.sh b/debian/update.sh deleted file mode 100755 index 33c00891cb2f6afdad0a63c5446c97fd5c5b198b..0000000000000000000000000000000000000000 --- a/debian/update.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -# @author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> -# Update the existing debian package wit the updated installation script -# Use it if you modify the installation scripts sflphone.preinst, sflphone.postrm or sflphone.prerm - -# you need the text base files: package and arch. They have just one line with respectively the name of the package and the architecture - -base_file="package arch" - -for i in $base_file -do - if [ ! -f $i ] - then - echo " Could not find the file $i " - exit 0 - fi -done - -package=`(cat package)` -arch=`(cat arch)` - -if [ ! -d $package ] -then - exit 0 -fi - -# Update installation scripts -cp sflphone.preinst $package/DEBIAN/preinst -cp sflphone.postrm $package/DEBIAN/postrm -cp sflphone.prerm $package/DEBIAN/prerm - -# Rebuild the debian package -dpkg --build $package ${package}_${arch}.deb 2> /dev/null - -echo "Done!" diff --git a/debian/upload.sh b/debian/upload.sh deleted file mode 100755 index 197740fe8e4d73863b6215c1cfac9053b3e3f63d..0000000000000000000000000000000000000000 --- a/debian/upload.sh +++ /dev/null @@ -1,3 +0,0 @@ -!#/bin/sh - -scp $1 root@gpl.savoirfairelinux.net:/var/www/vhosts/sflphone.org/htdocs/debian/dists/unstable/universe/binary-i386 diff --git a/globals.mak b/globals.mak index 7a0b085b9efbe0f7deefb226deed286cbba7982a..832c65d78edca78ef83300de391f4b978c1d41ed 100644 --- a/globals.mak +++ b/globals.mak @@ -5,9 +5,25 @@ sflplugindir=$(libdir)/sflphone/plugins PJSIP_LIBS = -lpjnath-sfl -lpjsua-sfl -lpjsip-sfl -lpjmedia-sfl -lpjsip-simple-sfl -lpjsip-ua-sfl -lpjmedia-codec-sfl -lpjlib-util-sfl -lpj-sfl +DBUSCPP_CFLAGS=$(top_srcdir)/libs/dbus-c++/include/dbus-c++ + +if BUILD_SPEEX +SPEEXCODEC=-DHAVE_SPEEX_CODEC +else +SPEEXCODEC= +endif + +if BUILD_GSM +GSMCODEC=-DHAVE_GSM_CODEC +else +GSMCODEC= +endif + # Preprocessor flags AM_CPPFLAGS = \ -I$(src)/libs \ + -I$(src)/libs/dbus-c++/include \ + -I$(src)/libs/iax2 \ -I$(src)/src \ -I$(src)/test \ -DPREFIX=\"$(prefix)\" \ @@ -15,8 +31,10 @@ AM_CPPFLAGS = \ $(ZEROCONFFLAGS) \ $(IAX_FLAGS) \ @SIP_CFLAGS@ \ - @DBUSCPP_CFLAGS@ \ + $(DBUSCPP_CFLAGS) \ -DCODECS_DIR=\""$(sflcodecdir)"\" \ -DPLUGINS_DIR=\""$(sflplugindir)"\" \ - -DENABLE_TRACE - + -DENABLE_TRACE \ + -DSFLDEBUG \ + $(SPEEXCODEC) \ + $(GSMCODEC) diff --git a/install_deps.sh b/install_deps.sh deleted file mode 100755 index cd7b966bbe0eab152c22ac8d4d95a9d9fd9fa60b..0000000000000000000000000000000000000000 --- a/install_deps.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# Daemon side -sudo apt-get install build-essential gnome-common \ - libasound2-dev \ - libpulse-dev \ - libcommoncpp2-dev \ - libccrtp-dev \ - libsamplerate0-dev \ - libdbus-1-dev \ - libexpat1-dev \ - libcppunit-dev \ - libgsm1-dev \ - sflphone-iax2-dev \ - dbus-c++-1-dev \ - libspeex-dev - -# Client side -sudo apt-get install libgtk2.0-dev \ - libdbus-glib-1-dev \ - libnotify-dev \ - libsexy-dev - diff --git a/libs/Makefile.am b/libs/Makefile.am index b565e8b61cb0fbd17e7a4647a879d4fb18f9cb4b..ac4d6a267255832f81f4bbf534a859414b226e02 100644 --- a/libs/Makefile.am +++ b/libs/Makefile.am @@ -1 +1 @@ -SUBDIRS = stund utilspp +SUBDIRS = stund utilspp iax2 dbus-c++ diff --git a/libs/dbus-c++/ChangeLog b/libs/dbus-c++/ChangeLog deleted file mode 100644 index e1aa57adee9c4266d17b694d9e8966116aeee71e..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/ChangeLog +++ /dev/null @@ -1,4 +0,0 @@ -dbus-c++-1 (0.5.1-1) unstable; urgency=low - * Debian package (no warning version) - - -- Yun Liu <yun.liu@savoirfairelinux.com> Mon, 01 Dec 2008 10:29:29 -0500 diff --git a/libs/dbus-c++/INSTALL b/libs/dbus-c++/INSTALL deleted file mode 100644 index d3c5b40a94091285c27361905f591af64c1f7b21..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/INSTALL +++ /dev/null @@ -1,237 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007 Free Software Foundation, Inc. - -This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - -Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. - - 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 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. - - Running `configure' might take a while. 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. - - 6. Often, you can also type `make uninstall' to remove the installed - files again. - -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=c99 CFLAGS=-g 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 can use 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 `..'. - - With a non-GNU `make', it is safer 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' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' 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 option `--target=TYPE' 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 - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`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. - diff --git a/libs/dbus-c++/Makefile.am b/libs/dbus-c++/Makefile.am index 29bb7c9bb72b0e73a77594019c38280345c20cf2..6b7789bc86de855bd27f6311be7b0c11caf24efa 100644 --- a/libs/dbus-c++/Makefile.am +++ b/libs/dbus-c++/Makefile.am @@ -1,22 +1,5 @@ -SUBDIRS = src tools data doc examples - -EXTRA_DIST = autogen.sh libdbus-c++.spec libdbus-c++.spec.in - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = dbus-c++-1.pc +SUBDIRS = src tools data MAINTAINERCLEANFILES = \ - configure \ - Makefile.in \ - aclocal.m4 \ - compile \ - config.guess \ - config.sub \ - depcomp \ - install-sh \ - ltmain.sh \ - mdate-sh \ - missing \ - mkinstalldirs \ - libdbus-c++.spec + Makefile.in diff --git a/libs/dbus-c++/NEWS b/libs/dbus-c++/NEWS deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/libs/dbus-c++/SConscript b/libs/dbus-c++/SConscript deleted file mode 100644 index d7b235898951800d2de2cb1470266aa63daad1df..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/SConscript +++ /dev/null @@ -1,85 +0,0 @@ -# -# library -# - -env = WengoGetEnvironment() - -env.ParseConfig('pkg-config --cflags --libs dbus-1') - -libs = [ - 'expat' -] -lib_path = [] -include_path = [ - 'include' -] -defines = { - 'DBUS_API_SUBJECT_TO_CHANGE':1, - 'DEBUG':1 -} -headers = [] -sources = [ - 'src/connection.cpp', - 'src/debug.cpp', - 'src/dispatcher.cpp', - 'src/error.cpp', - 'src/eventloop.cpp', - 'src/interface.cpp', - 'src/introspection.cpp', - 'src/property.cpp', - 'src/message.cpp', - 'src/object.cpp', - 'src/pendingcall.cpp', - 'src/server.cpp', - 'src/types.cpp', - 'src/xml.cpp' -] - -env.WengoAddDefines(defines) -env.WengoAddIncludePath(include_path) -env.WengoUseLibraries(libs) -env.WengoStaticLibrary('dbus-c++', sources) - -# -# tools -# - -tools_env = WengoGetEnvironment() - -tools_libs = [ - 'dbus-c++' -] -tools_defines = { - 'DBUS_API_SUBJECT_TO_CHANGE':1, -} -introspect_sources = [ - 'tools/introspect.cpp', -] - -xml2cpp_sources = [ - 'tools/xml2cpp.cpp' -] - -#tools_env.Append(LINKFLAGS = '-z origin') -#tools_env.Append(RPATH = env.Literal('\\$$ORIGIN\.')) - -tools_env.WengoAddDefines(tools_defines) -tools_env.WengoAddIncludePath(include_path) -tools_env.WengoUseLibraries(tools_libs) - -dbusxx_introspect = tools_env.WengoProgram('dbusxx-introspect', introspect_sources) -dbusxx_xml2cpp = tools_env.WengoProgram('dbusxx-xml2cpp', xml2cpp_sources) - -# -# xml translator -# - -def dbusxx_xml2cpp_emitter(target, source, env): - env.Depends(target, dbusxx_xml2cpp) - return (target, source) - -dbusxx_xml2cpp_builder = Builder(action = dbusxx_xml2cpp[0].abspath + ' $SOURCE --adaptor=$TARGET', - emitter = dbusxx_xml2cpp_emitter, - suffix = '.h', src_suffix = '.xml') - -Export('dbusxx_xml2cpp_builder') diff --git a/libs/dbus-c++/TODO b/libs/dbus-c++/TODO deleted file mode 100644 index f975a80a45241239e7a50bbb859bdc26de54d1c2..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/TODO +++ /dev/null @@ -1,8 +0,0 @@ -* Implement asynchronous method calls (hint: start from DBus::PendingCall) -* ...and patch the codegen to generate stubs for them -* Implement continuations in a saner way -* Find time for some hardcore valgrinding -* Make DBus::Server free an incoming connection when it's disconnected, not when freeing the server -* More examples -* Inline (Doxygen-style) documentation -* Native protocol implementation (as an alternative to libdbus) diff --git a/libs/dbus-c++/autogen.sh b/libs/dbus-c++/autogen.sh deleted file mode 100755 index 4af86e25d4b4dde140668ab04805c9f0c3a8018e..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/autogen.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -function autocmd() -{ - echo "Running ${1}..." - $* || { - echo "Error running ${1}" - exit 1 - } -} - -autocmd libtoolize --force --copy -autocmd aclocal -autocmd autoheader -autocmd automake --add-missing --force-missing --copy -Wall -autocmd autoconf - -echo "Autogen done, now you can ./configure" diff --git a/libs/dbus-c++/config.guess b/libs/dbus-c++/config.guess deleted file mode 100755 index f32079abda668e5fc8f8de6f226e7b26384e8a03..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/config.guess +++ /dev/null @@ -1,1526 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -# Free Software Foundation, Inc. - -timestamp='2008-01-23' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner <per@bothner.com>. -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include <stdio.h> /* 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 <sys/systemcfg.h> - - 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:*:[456]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <unistd.h> - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T | authenticamd) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - 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 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - arm*:Linux:*:*) - 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-gnu - else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <features.h> - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL - elif /bin/uname -X 2>/dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <hewes@openmarket.com>. - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include <sys/param.h> - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include <sys/param.h> -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 <<EOF -$0: unable to guess system type - -This script, last modified $timestamp, has failed to recognize -the operating system you are using. It is advised that you -download the most up to date version of the config scripts from - - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -and - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> 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: diff --git a/libs/dbus-c++/config.sub b/libs/dbus-c++/config.sub deleted file mode 100755 index 6759825a5b7fcf64476b4398dc0e30b3090b925c..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/config.sub +++ /dev/null @@ -1,1658 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -# Free Software Foundation, Inc. - -timestamp='2008-01-16' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | mt \ - | msp430 \ - | nios | nios2 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the 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 - ;; - 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 - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - 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 - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - 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) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tile*) - basic_machine=tile-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 - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/libs/dbus-c++/configure.ac b/libs/dbus-c++/configure.ac deleted file mode 100644 index 8517c67c2fce4a43b36a61a59d0b28b69aee6df8..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/configure.ac +++ /dev/null @@ -1,196 +0,0 @@ -# Autojunk script for libdbus-c++ - -AC_PREREQ(2.59) -AC_INIT([libdbus-c++], 0.5.0, [shackan@gmail.com]) - -AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) -AM_CONFIG_HEADER([include/dbus-c++/config.h]) - -AC_CANONICAL_HOST - -AC_SUBST(PACKAGE_VERSION) - - -# Set configuration options - -AC_ARG_ENABLE(debug, - AS_HELP_STRING([--enable-debug], - [enable debugging support]), - [enable_debug=$enableval], - [enable_debug=no] -) - -AC_ARG_ENABLE(glib, - AS_HELP_STRING([--enable-glib], - [enable glib integration]), - [enable_glib=$enableval], - [enable_glib=no] -) - -AC_ARG_ENABLE(doxygen-docs, - AS_HELP_STRING([--enable-doxygen-docs], - [build DOXYGEN documentation (requires Doxygen)]), - [enable_doxygen_docs=$enableval], - [enable_doxygen_docs=no] -) - -# Check for programs - -AC_LANG_CPLUSPLUS - -AC_PROG_CC -AC_PROG_CXX - -CXX_FOR_BUILD=${CXX_FOR_BUILD-${CXX}} -AC_SUBST(CXX_FOR_BUILD) - -AM_PROG_LIBTOOL - -PKG_PROG_PKG_CONFIG - - -AC_MSG_CHECKING([whether $CXX supports symbol visibility]) - -vtest=`$CXX --help --verbose 2>&1 | grep fvisibility` - -if test -n "$vtest"; then - AC_MSG_RESULT(yes) - - AC_DEFINE(GCC_HASCLASSVISIBILITY, 1, [to enable hidden symbols]) - CXXFLAGS="-fvisibility=hidden" -else - AC_MSG_RESULT(no) -fi - - -# Check for dependencies - -DBUS_REQUIRED_VERSION=0.60 -PKG_CHECK_MODULES(dbus, [dbus-1 >= $DBUS_REQUIRED_VERSION],, - AC_MSG_ERROR([You need the DBus libraries (version 0.6 or better)] - [http://www.freedesktop.org/wiki/Software_2fdbus]) -) -AC_SUBST(dbus_CFLAGS) -AC_SUBST(dbus_LIBS) - -DBUS_API_STABLE_VERSION=1.0.0 -PKG_CHECK_EXISTS([dbus-1 < $DBUS_API_STABLE_VERSION], - [AC_DEFINE(DBUS_API_SUBJECT_TO_CHANGE, , [unstable DBus])] -) - -DBUS_THREADS_INIT_DEFAULT_VERSION=0.93 -PKG_CHECK_EXISTS([dbus-1 >= $DBUS_THREADS_INIT_DEFAULT_VERSION], - [AC_DEFINE(DBUS_HAS_THREADS_INIT_DEFAULT, , [dbus_threads_init_default (needs DBus >= 0.93)])] -) - -DBUS_RECURSIVE_MUTEX_VERSION=0.95 -PKG_CHECK_EXISTS([dbus-1 >= $DBUS_RECURSIVE_MUTEX_VERSION], - [AC_DEFINE(DBUS_HAS_RECURSIVE_MUTEX, , [DBus supports recursive mutexes (needs DBus >= 0.95)])] -) - - -if test "$enable_glib" = "yes" ; then -PKG_CHECK_MODULES([glib], glib-2.0) -AC_SUBST(glib_CFLAGS) -AC_SUBST(glib_LIBS) -AM_CONDITIONAL(ENABLE_GLIB, test 1 = 1) -PKG_CHECK_MODULES([gtkmm], gtkmm-2.4, - AM_CONDITIONAL(HAVE_GTKMM, test 1 = 1), - AM_CONDITIONAL(HAVE_GTKMM, test 0 = 1) -) -AC_SUBST(gtkmm_CFLAGS) -AC_SUBST(gtkmm_LIBS) -else -AM_CONDITIONAL(ENABLE_GLIB, test 0 = 1) -AM_CONDITIONAL(HAVE_GTKMM, test 0 = 1) -fi - -AC_CHECK_LIB([expat], XML_ParserCreate_MM, - [AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false)], - have_expat=false) - -if ! $have_expat; then - AC_MSG_ERROR([You need the eXpat xml parser] - [http://expat.sourceforge.net/]) -fi - -xml_CFLAGS= -xml_LIBS=-lexpat - -AC_SUBST(xml_CFLAGS) -AC_SUBST(xml_LIBS) - -AC_CHECK_LIB([pthread], pthread_create, - [AC_CHECK_HEADERS(pthread.h, have_pthread=true, have_pthread=false)], - have_pthread=false) - -if test "$have_pthread" = "false"; then - AC_MSG_ERROR([You need the POSIX Thread library (pthreads)]) -fi - -if test "$enable_debug" = "yes" ; then - CXXFLAGS="$CXXFLAGS -Wall -ggdb -O0 -DDEBUG -Wfatal-errors -Werror" -else - CXXFLAGS="$CXXFLAGS -Wall -O3" -fi - - -# Doxygen Documentation - -AC_PATH_PROG(DOXYGEN, doxygen, no) - -AC_MSG_CHECKING([whether to build Doxygen documentation]) - -if test "$DOXYGEN" = "no" ; then - have_doxygen=no -else - have_doxygen=yes -fi - -if test "$enable_doxygen_docs" = "auto" ; then - enable_doxygen_docs=no - - AC_MSG_RESULT(no) -fi - -if test "$enable_doxygen_docs" = "yes" ; then - if test "$have_doxygen" = "no"; then - AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found]) - fi - - AC_MSG_RESULT(yes) -fi - -AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test "$enable_doxygen_docs" = "yes") - -# For the tools/, we need libdbus-c++ for the "build" architecture as well - -AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes") - -AC_ARG_WITH(build-libdbus-cxx, - AS_HELP_STRING([--with-build-libdbus-cxx], - [For cross compilation: path to libdbus-cxx which was compiled for the 'build' system.]), - [ BUILD_LIBDBUS_CXX_DIR=${withval} ], - [ BUILD_LIBDBUS_CXX_DIR="\$(top_builddir)" ] -) -AC_SUBST(BUILD_LIBDBUS_CXX_DIR) - - -# Save processed files - -AC_OUTPUT( - Makefile - src/Makefile - tools/Makefile - data/Makefile - doc/Makefile - doc/Doxyfile - examples/Makefile - examples/properties/Makefile - examples/echo/Makefile - examples/hal/Makefile - examples/glib/Makefile - dbus-c++-1.pc - dbus-c++-1-uninstalled.pc - libdbus-c++.spec -) diff --git a/libs/dbus-c++/dbus-c++-1-uninstalled.pc.in b/libs/dbus-c++/dbus-c++-1-uninstalled.pc.in deleted file mode 100644 index 839fa86ab6375c46cf961ad5dca2c9789eecca2e..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/dbus-c++-1-uninstalled.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -prefix= -exec_prefix= -libdir=src -includedir=include - -Name: @PACKAGE@ -Description: Native C++ bindings for D-Bus, Not Installed -Version: @VERSION@ -Requires: -Conflicts: -Libs: ${pcfiledir}/${libdir}/libdbus-c++-1.la -Cflags: -I${pcfiledir}/${includedir} - diff --git a/libs/dbus-c++/dbus-c++-1.pc.in b/libs/dbus-c++/dbus-c++-1.pc.in deleted file mode 100644 index bc5860a95594e9bd30af8687b7c1e162f6fd79bb..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/dbus-c++-1.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: dbus-c++ -Description: Native C++ bindings for D-Bus. -Requires: dbus-1 -Version: @VERSION@ -Libs: -L${libdir} -ldbus-c++-1 -Cflags: -I${includedir}/dbus-c++-1 -DDBUS_API_SUBJECT_TO_CHANGE diff --git a/libs/dbus-c++/debian/changelog b/libs/dbus-c++/debian/changelog deleted file mode 100644 index 488f083fd5c443302e812b0d20cebf369b67161e..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/debian/changelog +++ /dev/null @@ -1,4 +0,0 @@ -dbus-c++-1 (0.5.1-2ubuntu1) intrepid; urgency=low - * Debian package (no warning version) - - -- Yun Liu <yun.liu@savoirfairelinux.com> Mon, 01 Dec 2008 10:29:29 -0500 diff --git a/libs/dbus-c++/debian/compat b/libs/dbus-c++/debian/compat deleted file mode 100644 index 7ed6ff82de6bcc2a78243fc9c54d3ef5ac14da69..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/libs/dbus-c++/debian/control b/libs/dbus-c++/debian/control deleted file mode 100644 index f74909f987ff1269fbed34daf06a8e1b5d5944f5..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/debian/control +++ /dev/null @@ -1,30 +0,0 @@ -Source: dbus-c++-1 -Priority: optional -Maintainer: SavoirFaireLinux Inc <yun.liu@savoirfairelinux.com> -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.3 -Section: libs - -Package: dbus-c++-1-dev -Section: libdevel -Architecture: amd64 -Depends: libc6 (>=2.6.1-1), dbus-c++-1 (>= 0.5.1) -Homepage: http://www.sflphone.org -Description: SFLphone C++ DBus Bindings - It is a C++ interface for DBus. It has the ability to reflect DBus methods - and signals into a more natural C++ object system. - SFLphone is being developed by the global community, and maintained by - Savoir-faire Linux, a Montreal, Quebec, Canada-based Linux consulting company. - This package is only for the development use. - -Package: dbus-c++-1 -Section: libs -Architecture: amd64 -Homepage: http://www.sflphone.org -Depends: libc6 (>=2.6.1-1),${shlibs:Depends} -Description: SFLphone C++ DBus Bindings - It is a C++ interface for DBus. It has the ability to reflect DBus methods - and signals into a more natural C++ object system. - SFLphone is being developed by the global community, and maintained by - Savoir-faire Linux, a Montreal, Quebec, Canada-based Linux consulting company. - This package is only the library. diff --git a/libs/dbus-c++/debian/copyright b/libs/dbus-c++/debian/copyright deleted file mode 100644 index db09a6388967aac83978355137f74cd4b558da86..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/debian/copyright +++ /dev/null @@ -1,12 +0,0 @@ -This package was debianized by Yun Liu <yun.liu@savoirfairelinux.com> on -Mon, 01 Dec 2008 10:29:29 -0500. - -It was download from: svn --username guest --password guest --non-interactive co http://dev.openwengo.org/svn/openwengo/wengophone-ng/branches/wengophone-dbus-api/libs/dbus/ -Copyright: - Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - -License: - Lesser General Public License ( LGPL ) - -On Debian systems, the complete text of the licenses can be found in the -/usr/share/common-licenses/LGPL and /usr/share/common-licenses/GPL files. diff --git a/libs/dbus-c++/debian/dbus-c++-1-dev.install b/libs/dbus-c++/debian/dbus-c++-1-dev.install deleted file mode 100644 index 9f564627cb728e01b56c09bde90457cfa304ed7a..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/debian/dbus-c++-1-dev.install +++ /dev/null @@ -1,6 +0,0 @@ -usr/include/* -usr/lib/*.a -usr/lib/*.so -usr/lib/*.la -usr/lib/pkgconfig/* - diff --git a/libs/dbus-c++/debian/dbus-c++-1.install b/libs/dbus-c++/debian/dbus-c++-1.install deleted file mode 100644 index 0bfc1fdb18d1d52aed647ca1c36cc243e7c7b496..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/debian/dbus-c++-1.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/*.so.* -usr/bin/* diff --git a/libs/dbus-c++/debian/docs b/libs/dbus-c++/debian/docs deleted file mode 100644 index 7d96d4e7e64707836831fa81886c7a44ec116fcb..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/debian/docs +++ /dev/null @@ -1,2 +0,0 @@ -AUTHORS -TODO diff --git a/libs/dbus-c++/debian/rules b/libs/dbus-c++/debian/rules deleted file mode 100755 index a0a20bfc24a08bfa1ec480b5004c840efee4f5d1..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/debian/rules +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - - - - -# shared library versions, option 1 -version=0.5.1 -major=1 -# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so -#version=`ls src/.libs/lib*.so.* | \ -# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` -#major=`ls src/.libs/lib*.so.* | \ -# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - ./autogen.sh - ./configure --prefix=/usr - touch configure-stamp - - -build: build-stamp -build-stamp: configure-stamp - dh_testdir - - # Add here commands to compile the package. - $(MAKE) - - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - # Add here commands to clean up after the build process. - [ ! -f Makefile ] || $(MAKE) distclean - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/tmp - $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs ChangeLog - dh_installdocs - dh_installexamples - dh_install --sourcedir debian/tmp -# dh_install -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl -# dh_python - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/libs/dbus-c++/depcomp b/libs/dbus-c++/depcomp deleted file mode 100755 index e5f9736c7239301c765e2d7abefb9bb9b9237ac5..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/depcomp +++ /dev/null @@ -1,589 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2007-03-29.01 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software -# Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to <bug-automake@gnu.org>. -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. - sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no - for arg in "$@"; do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix="`echo $object | sed 's/^.*\././'`" - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - "$@" || exit $? - IFS=" " - for arg - do - case "$arg" in - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/libs/dbus-c++/doc/Doxyfile.in b/libs/dbus-c++/doc/Doxyfile.in deleted file mode 100644 index a2b3d4415fe2026b0f0e520d88934377bda6ff9a..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/doc/Doxyfile.in +++ /dev/null @@ -1,251 +0,0 @@ -# Doxyfile 1.4.6 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = @PACKAGE@ -PROJECT_NUMBER = @VERSION@ -OUTPUT_DIRECTORY = @top_srcdir@/doc/ -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = YES -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 4 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -BUILTIN_STL_SUPPORT = YES -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = NO -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = YES -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = NO -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = YES -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = @top_srcdir@/src/ @top_srcdir@/include/ -FILE_PATTERNS = *.cpp \ - *.h -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = Makefile.* \ - ChangeLog \ - CHANGES \ - CHANGES.* \ - README \ - README.* \ - *.png \ - AUTHORS \ - DESIGN \ - DESIGN.* \ - *.desktop \ - DESKTOP* \ - COMMENTS \ - HOWTO \ - magic \ - NOTES \ - TODO \ - THANKS -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = YES -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -USE_HTAGS = NO -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = YES -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = NO -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 640 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 1000 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/libs/dbus-c++/doc/Makefile.am b/libs/dbus-c++/doc/Makefile.am deleted file mode 100644 index 39fd9b9deb140ecfadc9dde627dc835de95fb335..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/doc/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -if DBUS_DOXYGEN_DOCS_ENABLED - -EXTRA_DIST = Doxyfile.in - -noinst_PROGRAMS = index.html - -index_html_SOURCES = Doxyfile - -index.html: Doxyfile - doxygen Doxyfile - -endif - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/doc/html/Makefile.am b/libs/dbus-c++/doc/html/Makefile.am deleted file mode 100644 index 8eb67f86574b1821e66ddf261e6c7de2eaa46546..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/doc/html/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -CLEANFILES = *.html *.css *.png *.gif - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/examples/Makefile.am b/libs/dbus-c++/examples/Makefile.am deleted file mode 100644 index b346604bad07e6aabfc20c1e3a581325446085f1..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -SUBDIRS = properties echo hal glib - -MAINTAINERCLEANFILES = \ - Makefile.in - diff --git a/libs/dbus-c++/examples/echo/Makefile.am b/libs/dbus-c++/examples/echo/Makefile.am deleted file mode 100644 index 565fb1a0136bd9eaaa6fcfe4d0119438dd7e1041..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -EXTRA_DIST = README echo-introspect.xml - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include - -noinst_PROGRAMS = echo-server - -echo_server_SOURCES = echo-server-glue.h echo-server.h echo-server.cpp -echo_server_LDADD = $(top_builddir)/src/libdbus-c++-1.la - -echo-server-glue.h: echo-introspect.xml - $(top_builddir)/tools/dbusxx-xml2cpp $^ --adaptor=$@ - -noinst_PROGRAMS += echo-client-mt - -echo_client_mt_SOURCES = echo-client-glue.h echo-client.h echo-client.cpp -echo_client_mt_LDADD = $(top_builddir)/src/libdbus-c++-1.la -lpthread - -echo-client-glue.h: echo-introspect.xml - $(top_builddir)/tools/dbusxx-xml2cpp $^ --proxy=$@ - -BUILT_SOURCES = echo-server-glue.h echo-client-glue.h -CLEANFILES = $(BUILT_SOURCES) - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/examples/echo/README b/libs/dbus-c++/examples/echo/README deleted file mode 100644 index 74e1d6d16c59858237e98e5186000951397d95d5..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/README +++ /dev/null @@ -1,23 +0,0 @@ -This is probably the most simple D-Bus program you could conceive - -To test, run `DBUSXX_VERBOSE=1 ./echo-server` and try the following commands: - -dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Random - -dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Hello string:"world" - -dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Sum array:int32:10,100,250 - -dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Info - -or, using python instead - -$ python -import dbus -bus = dbus.SessionBus() -object = bus.get_object('org.freedesktop.DBus.Examples.Echo','/org/freedesktop/DBus/Examples/Echo') -echo = dbus.Interface(object, dbus_interface='org.freedesktop.DBus.EchoDemo') -echo.Random() -echo.Hello("world") -echo.Sum([123, 234, 95, 520]) -echo.Info() diff --git a/libs/dbus-c++/examples/echo/echo-client.cpp b/libs/dbus-c++/examples/echo/echo-client.cpp deleted file mode 100644 index 287206671d08f5d98be3df7e151f876660a2883f..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/echo-client.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "echo-client.h" -#include <iostream> -#include <pthread.h> -#include <signal.h> - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -using namespace std; - -static const char *ECHO_SERVER_NAME = "org.freedesktop.DBus.Examples.Echo"; -static const char *ECHO_SERVER_PATH = "/org/freedesktop/DBus/Examples/Echo"; - -EchoClient::EchoClient(DBus::Connection &connection, const char *path, const char *name) -: DBus::ObjectProxy(connection, path, name) -{ -} - -void EchoClient::Echoed(const DBus::Variant &value) -{ - cout << "!"; -} - -/* - * For some strange reason, libdbus frequently dies with an OOM - */ - -static const int THREADS = 3; - -static bool spin = true; - -void *greeter_thread(void *arg) -{ - DBus::Connection *conn = reinterpret_cast<DBus::Connection *>(arg); - - EchoClient client(*conn, ECHO_SERVER_PATH, ECHO_SERVER_NAME); - - char idstr[16]; - - snprintf(idstr, sizeof(idstr), "%lu", pthread_self()); - - for (int i = 0; i < 30 && spin; ++i) - { - cout << client.Hello(idstr) << endl; - } - - cout << idstr << " done " << endl; - - return NULL; -} - -DBus::BusDispatcher dispatcher; - -void niam(int sig) -{ - spin = false; - - dispatcher.leave(); -} - -int main() -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - -#ifdef DBUS_HAS_THREADS_INIT_DEFAULT - DBus::_init_threading(); -#else - cerr << "Thread support is not enabled! your D-Bus version is too old" << endl; -#endif - - DBus::default_dispatcher = &dispatcher; - - DBus::Connection conn = DBus::Connection::SessionBus(); - - pthread_t threads[THREADS]; - - for (int i = 0; i < THREADS; ++i) - { - pthread_create(threads+i, NULL, greeter_thread, &conn); - } - - dispatcher.enter(); - - cout << "terminating" << endl; - - for (int i = 0; i < THREADS; ++i) - { - pthread_join(threads[i], NULL); - } - - return 0; -} diff --git a/libs/dbus-c++/examples/echo/echo-client.h b/libs/dbus-c++/examples/echo/echo-client.h deleted file mode 100644 index 54401eca4152e03a5621e6b947a3062eb911d702..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/echo-client.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __DEMO_ECHO_CLIENT_H -#define __DEMO_ECHO_CLIENT_H - -#include <dbus-c++/dbus.h> -#include "echo-client-glue.h" - -class EchoClient -: public org::freedesktop::DBus::EchoDemo_proxy, - public DBus::IntrospectableProxy, - public DBus::ObjectProxy -{ -public: - - EchoClient(DBus::Connection &connection, const char *path, const char *name); - - void Echoed(const DBus::Variant &value); -}; - -#endif//__DEMO_ECHO_CLIENT_H diff --git a/libs/dbus-c++/examples/echo/echo-introspect.xml b/libs/dbus-c++/examples/echo/echo-introspect.xml deleted file mode 100644 index 7d415abdd4c17c9bd653bb9d619fc9dff22f5264..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/echo-introspect.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" ?> -<node name="/org/freedesktop/DBus/Examples/Echo"> - <interface name="org.freedesktop.DBus.EchoDemo"> - <method name="Random"> - <arg type="i" name="version" direction="out"/> - </method> - <method name="Hello"> - <arg type="s" name="name" direction="in"/> - <arg type="s" name="greeting" direction="out"/> - </method> - <method name="Echo"> - <arg type="v" name="input" direction="in"/> - <arg type="v" name="output" direction="out"/> - </method> - <method name="Cat"> - <arg type="s" name="file" direction="in"/> - <arg type="ay" name="stream" direction="out"/> - </method> - <method name="Sum"> - <arg type="ai" name="ints" direction="in"/> - <arg type="i" names="sum" direction="out"/> - </method> - <signal name="Echoed"> - <arg type="v" name="value"/> - </signal> - <method name="Info"> - <arg type="a{ss}" name="info" direction="out"/> - </method> - </interface> -</node> diff --git a/libs/dbus-c++/examples/echo/echo-server.cpp b/libs/dbus-c++/examples/echo/echo-server.cpp deleted file mode 100644 index d69333b56141167eaf2599b346edfe14c70648dc..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/echo-server.cpp +++ /dev/null @@ -1,92 +0,0 @@ -#include "echo-server.h" -#include <unistd.h> -#include <stdlib.h> -#include <signal.h> -#include <stdio.h> -#include <limits.h> - -static const char *ECHO_SERVER_NAME = "org.freedesktop.DBus.Examples.Echo"; -static const char *ECHO_SERVER_PATH = "/org/freedesktop/DBus/Examples/Echo"; - -EchoServer::EchoServer(DBus::Connection &connection) -: DBus::ObjectAdaptor(connection, ECHO_SERVER_PATH) -{ -} - -int32_t EchoServer::Random() -{ - return rand(); -} - -std::string EchoServer::Hello(const std::string &name) -{ - return "Hello " + name + "!"; -} - -DBus::Variant EchoServer::Echo(const DBus::Variant &value) -{ - this->Echoed(value); - - return value; -} - -std::vector< uint8_t > EchoServer::Cat(const std::string &file) -{ - FILE *handle = fopen(file.c_str(), "rb"); - - if (!handle) throw DBus::Error("org.freedesktop.DBus.EchoDemo.ErrorFileNotFound", "file not found"); - - uint8_t buff[1024]; - - size_t nread = fread(buff, 1, sizeof(buff), handle); - - fclose(handle); - - return std::vector< uint8_t > (buff, buff + nread); -} - -int32_t EchoServer::Sum(const std::vector<int32_t>& ints) -{ - int32_t sum = 0; - - for (size_t i = 0; i < ints.size(); ++i) sum += ints[i]; - - return sum; -} - -std::map< std::string, std::string > EchoServer::Info() -{ - std::map< std::string, std::string > info; - char hostname[HOST_NAME_MAX]; - - gethostname(hostname, sizeof(hostname)); - info["hostname"] = hostname; - info["username"] = getlogin(); - - return info; -} - - -DBus::BusDispatcher dispatcher; - -void niam(int sig) -{ - dispatcher.leave(); -} - -int main() -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - - DBus::default_dispatcher = &dispatcher; - - DBus::Connection conn = DBus::Connection::SessionBus(); - conn.request_name(ECHO_SERVER_NAME); - - EchoServer server(conn); - - dispatcher.enter(); - - return 0; -} diff --git a/libs/dbus-c++/examples/echo/echo-server.h b/libs/dbus-c++/examples/echo/echo-server.h deleted file mode 100644 index 3f0be5811733e4439ff9a80fa762266b1a9df974..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/echo-server.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __DEMO_ECHO_SERVER_H -#define __DEMO_ECHO_SERVER_H - -#include <dbus-c++/dbus.h> -#include "echo-server-glue.h" - -class EchoServer -: public org::freedesktop::DBus::EchoDemo_adaptor, - public DBus::IntrospectableAdaptor, - public DBus::ObjectAdaptor -{ -public: - - EchoServer(DBus::Connection &connection); - - int32_t Random(); - - std::string Hello(const std::string &name); - - DBus::Variant Echo(const DBus::Variant &value); - - std::vector< uint8_t > Cat(const std::string &file); - - int32_t Sum(const std::vector<int32_t> & ints); - - std::map< std::string, std::string > Info(); -}; - -#endif//__DEMO_ECHO_SERVER_H diff --git a/libs/dbus-c++/examples/glib/Makefile.am b/libs/dbus-c++/examples/glib/Makefile.am deleted file mode 100644 index 42a33d8edb4959e50ea54e7edca045f79e5ca783..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/glib/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -EXTRA_DIST = - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(gtkmm_CFLAGS) -I$(top_srcdir)/tools - -if HAVE_GTKMM -noinst_PROGRAMS = dbus-browser -endif - -dbus_browser_SOURCES = dbus-glue.h dbus-browser.h dbus-browser.cpp $(top_srcdir)/tools/xml.cpp -dbus_browser_LDADD = $(top_builddir)/src/libdbus-c++-1.la $(gtkmm_LIBS) - -dbus-glue.h: $(top_srcdir)/data/org.freedesktop.DBus.xml - $(top_builddir)/tools/dbusxx-xml2cpp $^ --proxy=$@ - -BUILT_SOURCES = dbus-glue.h -CLEANFILES = $(BUILT_SOURCES) - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/examples/glib/dbus-browser.cpp b/libs/dbus-c++/examples/glib/dbus-browser.cpp deleted file mode 100644 index 382d07f17a1dae20f200a445c18ae5e5b687278a..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/glib/dbus-browser.cpp +++ /dev/null @@ -1,136 +0,0 @@ -#include "dbus-browser.h" - -#include <xml.h> -#include <iostream> - -using namespace std; - -static const char *DBUS_SERVER_NAME = "org.freedesktop.DBus"; -static const char *DBUS_SERVER_PATH = "/org/freedesktop/DBus"; - -DBusBrowser::DBusBrowser(::DBus::Connection &conn) -: ::DBus::ObjectProxy(conn, DBUS_SERVER_PATH, DBUS_SERVER_NAME) -{ - set_title("D-Bus Browser"); - set_border_width(5); - set_default_size(400, 500); - - typedef std::vector< std::string > Names; - - Names names = ListNames(); - - for (Names::iterator it = names.begin(); it != names.end(); ++it) - { - _cb_busnames.append_text(*it); - } - - _cb_busnames.signal_changed().connect(sigc::mem_fun(*this, &DBusBrowser::on_select_busname)); - - _tm_inspect = Gtk::TreeStore::create(_records); - _tv_inspect.set_model(_tm_inspect); - _tv_inspect.append_column("Node", _records.name); - - _sc_tree.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - _sc_tree.add(_tv_inspect); - - _vbox.pack_start(_cb_busnames, Gtk::PACK_SHRINK); - _vbox.pack_start(_sc_tree); - - add(_vbox); - - show_all_children(); -} - -void DBusBrowser::NameOwnerChanged( - const std::string &name, const std::string &old_owner, const std::string &new_owner) -{ - cout << name << ": " << old_owner << " -> " << new_owner << endl; -} - -void DBusBrowser::NameLost(const std::string &name) -{ - cout << name << " lost" << endl; -} - -void DBusBrowser::NameAcquired(const std::string &name) -{ - cout << name << " acquired" << endl; -} - -void DBusBrowser::on_select_busname() -{ - Glib::ustring busname = _cb_busnames.get_active_text(); - if (busname.empty()) return; - - _tm_inspect->clear(); - _inspect_append(NULL, "", busname); -} - -void DBusBrowser::_inspect_append(Gtk::TreeModel::Row *row, const std::string &buspath, const std::string &busname) -{ - DBusInspector inspector(conn(), buspath.empty() ? "/" : buspath.c_str(), busname.c_str()); - - ::DBus::Xml::Document doc(inspector.Introspect()); - ::DBus::Xml::Node &root = *(doc.root); - - ::DBus::Xml::Nodes ifaces = root["interface"]; - - for (::DBus::Xml::Nodes::iterator ii = ifaces.begin(); ii != ifaces.end(); ++ii) - { - ::DBus::Xml::Node &iface = **ii; - - Gtk::TreeModel::Row i_row = row - ? *(_tm_inspect->append(row->children())) - : *(_tm_inspect->append()); - i_row[_records.name] = "interface: " + iface.get("name"); - - ::DBus::Xml::Nodes methods = iface["method"]; - - for (::DBus::Xml::Nodes::iterator im = methods.begin(); im != methods.end(); ++im) - { - Gtk::TreeModel::Row m_row = *(_tm_inspect->append(i_row.children())); - m_row[_records.name] = "method: " + (*im)->get("name"); - } - - ::DBus::Xml::Nodes signals = iface["signal"]; - - for (::DBus::Xml::Nodes::iterator is = signals.begin(); is != signals.end(); ++is) - { - Gtk::TreeModel::Row s_row = *(_tm_inspect->append(i_row.children())); - s_row[_records.name] = "signal: " + (*is)->get("name"); - } - } - - ::DBus::Xml::Nodes nodes = root["node"]; - - for (::DBus::Xml::Nodes::iterator in = nodes.begin(); in != nodes.end(); ++in) - { - std::string name = (*in)->get("name"); - - Gtk::TreeModel::Row n_row = row - ? *(_tm_inspect->append(row->children())) - : *(_tm_inspect->append()); - n_row[_records.name] = name; - - _inspect_append(&n_row, buspath + "/" + name, busname); - } -} - -DBus::Glib::BusDispatcher dispatcher; - -int main(int argc, char *argv[]) -{ - Gtk::Main kit(argc, argv); - - DBus::default_dispatcher = &dispatcher; - - dispatcher.attach(NULL); - - DBus::Connection conn = DBus::Connection::SessionBus(); - - DBusBrowser browser(conn); - - Gtk::Main::run(browser); - - return 0; -} diff --git a/libs/dbus-c++/examples/glib/dbus-browser.h b/libs/dbus-c++/examples/glib/dbus-browser.h deleted file mode 100644 index 9bbefbf084d9188376439b36e4294653f7787660..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/glib/dbus-browser.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __DEMO_DBUS_BROWSER_H -#define __DEMO_DBUS_BROWSER_H - -#include <dbus-c++/dbus.h> -#include <dbus-c++/glib-integration.h> -#include <gtkmm.h> - -#include "dbus-glue.h" - -class DBusInspector -: public DBus::IntrospectableProxy, - public DBus::ObjectProxy -{ -public: - - DBusInspector(DBus::Connection &conn, const char *path, const char *service) - : DBus::ObjectProxy(conn, path, service) - {} -}; - -class DBusBrowser -: public org::freedesktop::DBus_proxy, - public DBus::IntrospectableProxy, - public DBus::ObjectProxy, - public Gtk::Window -{ -public: - - DBusBrowser(::DBus::Connection &); - -private: - - void NameOwnerChanged(const std::string &, const std::string &, const std::string &); - - void NameLost(const std::string &); - - void NameAcquired(const std::string &); - - void on_select_busname(); - - void _inspect_append(Gtk::TreeModel::Row *, const std::string &, const std::string &); - -private: - - class InspectRecord : public Gtk::TreeModel::ColumnRecord - { - public: - - InspectRecord() { add(name); } - - Gtk::TreeModelColumn<Glib::ustring> name; - }; - - Gtk::VBox _vbox; - Gtk::ScrolledWindow _sc_tree; - Gtk::ComboBoxText _cb_busnames; - Gtk::TreeView _tv_inspect; - Glib::RefPtr<Gtk::TreeStore> _tm_inspect; - InspectRecord _records; -}; - -#endif//__DEMO_DBUS_BROWSER_H diff --git a/libs/dbus-c++/examples/hal/Makefile.am b/libs/dbus-c++/examples/hal/Makefile.am deleted file mode 100644 index 22868c80fa8c8bb5e5579ce4089c09b8044e401a..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/hal/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include - -noinst_PROGRAMS = hal-listen - -hal_listen_SOURCES = hal-listen.h hal-listen.cpp -hal_listen_LDADD = $(top_builddir)/src/libdbus-c++-1.la - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/examples/hal/hal-listen.cpp b/libs/dbus-c++/examples/hal/hal-listen.cpp deleted file mode 100644 index 11e18de300343891da03a76ee71348cc5c29ef5a..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/hal/hal-listen.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include "hal-listen.h" - -#include <signal.h> -#include <iostream> - -HalManagerProxy::HalManagerProxy(DBus::Connection &connection) -: DBus::InterfaceProxy("org.freedesktop.Hal.Manager"), - DBus::ObjectProxy(connection, "/org/freedesktop/Hal/Manager", "org.freedesktop.Hal") -{ - connect_signal(HalManagerProxy, DeviceAdded, DeviceAddedCb); - connect_signal(HalManagerProxy, DeviceRemoved, DeviceRemovedCb); - - std::vector< std::string > devices = GetAllDevices(); - - std::vector< std::string >::iterator it; - for (it = devices.begin(); it != devices.end(); ++it) - { - DBus::Path udi = *it; - - std::cout << "found device " << udi << std::endl; - - _devices[udi] = new HalDeviceProxy(connection, udi); - } -} - -std::vector< std::string > HalManagerProxy::GetAllDevices() -{ - std::vector< std::string > udis; - DBus::CallMessage call; - - call.member("GetAllDevices"); - - DBus::Message reply = invoke_method(call); - DBus::MessageIter it = reply.reader(); - - it >> udis; - return udis; -} - -void HalManagerProxy::DeviceAddedCb(const DBus::SignalMessage &sig) -{ - DBus::MessageIter it = sig.reader(); - std::string devname; - - it >> devname; - - DBus::Path udi(devname); - - _devices[devname] = new HalDeviceProxy(conn(), udi); - std::cout << "added device " << udi << std::endl; -} - -void HalManagerProxy::DeviceRemovedCb(const DBus::SignalMessage &sig) -{ - DBus::MessageIter it = sig.reader(); - std::string devname; - - it >> devname; - - std::cout << "removed device " << devname << std::endl; - - _devices.erase(devname); -} - -HalDeviceProxy::HalDeviceProxy(DBus::Connection &connection, DBus::Path &udi) -: DBus::InterfaceProxy("org.freedesktop.Hal.Device"), - DBus::ObjectProxy(connection, udi, "org.freedesktop.Hal") -{ - connect_signal(HalDeviceProxy, PropertyModified, PropertyModifiedCb); - connect_signal(HalDeviceProxy, Condition, ConditionCb); -} - -void HalDeviceProxy::PropertyModifiedCb(const DBus::SignalMessage &sig) -{ - typedef DBus::Struct< std::string, bool, bool > HalProperty; - - DBus::MessageIter it = sig.reader(); - int32_t number; - - it >> number; - - DBus::MessageIter arr = it.recurse(); - - for (int i = 0; i < number; ++i, ++arr) - { - HalProperty hp; - - arr >> hp; - - std::cout << "modified property " << hp._1 << " in " << path() << std::endl; - } -} - -void HalDeviceProxy::ConditionCb(const DBus::SignalMessage &sig) -{ - DBus::MessageIter it = sig.reader(); - std::string condition; - - it >> condition; - - std::cout << "encountered condition " << condition << " in " << path() << std::endl; -} - -DBus::BusDispatcher dispatcher; - -void niam(int sig) -{ - dispatcher.leave(); -} - -int main() -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - - DBus::default_dispatcher = &dispatcher; - - DBus::Connection conn = DBus::Connection::SystemBus(); - - HalManagerProxy hal(conn); - - dispatcher.enter(); - - return 0; -} diff --git a/libs/dbus-c++/examples/hal/hal-listen.h b/libs/dbus-c++/examples/hal/hal-listen.h deleted file mode 100644 index 12862e617e9e97679bbd403cba6f68122004e6c0..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/hal/hal-listen.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef __DEMO_HAL_LISTEN_H -#define __DEMO_HAL_LISTEN_H - -#include <dbus-c++/dbus.h> -#include <vector> -#include <map> - -class HalDeviceProxy; - -class HalManagerProxy -: public DBus::InterfaceProxy, - public DBus::ObjectProxy -{ -public: - - HalManagerProxy(DBus::Connection &connection); - - std::vector< std::string > GetAllDevices(); - -private: - - void DeviceAddedCb(const DBus::SignalMessage &sig); - - void DeviceRemovedCb(const DBus::SignalMessage &sig); - - std::map< std::string, DBus::RefPtr< HalDeviceProxy > > _devices; -}; - -class HalDeviceProxy -: public DBus::InterfaceProxy, - public DBus::ObjectProxy -{ -public: - - HalDeviceProxy(DBus::Connection &connection, DBus::Path &udi); - -private: - - void PropertyModifiedCb(const DBus::SignalMessage &sig); - - void ConditionCb(const DBus::SignalMessage &sig); -}; - -#endif//__DEMO_HAL_LISTEN_H diff --git a/libs/dbus-c++/examples/properties/Makefile.am b/libs/dbus-c++/examples/properties/Makefile.am deleted file mode 100644 index a99749a19f191c29b6d6b350e32449b871b5135b..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/properties/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -EXTRA_DIST = propsgs-introspect.xml - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include - -noinst_PROGRAMS = propsgs-server propsgs-client - -propsgs_server_SOURCES = propsgs-glue-adaptor.h propsgs-server.h propsgs-server.cpp -propsgs_server_LDADD = $(top_builddir)/src/libdbus-c++-1.la - -propsgs_client_SOURCES = propsgs-glue-proxy.h propsgs-client.h propsgs-client.cpp -propsgs_client_LDADD = $(top_builddir)/src/libdbus-c++-1.la -lpthread - -propsgs-glue-adaptor.h: propsgs-introspect.xml - $(top_builddir)/tools/dbusxx-xml2cpp $^ --adaptor=$@ -- - -propsgs-glue-proxy.h: propsgs-introspect.xml - $(top_builddir)/tools/dbusxx-xml2cpp $^ --proxy=$@ -- - -BUILT_SOURCES = propsgs-glue-adaptor.h propsgs-glue-proxy.h -CLEANFILES = $(BUILT_SOURCES) - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/examples/properties/propsgs-client.cpp b/libs/dbus-c++/examples/properties/propsgs-client.cpp deleted file mode 100644 index d4b51f4bd258afdacd966b613456ad4e8b572599..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/properties/propsgs-client.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include "propsgs-client.h" -#include <iostream> -#include <signal.h> -#include <pthread.h> - -using namespace org::freedesktop::DBus; - -static const char *PROPS_SERVER_NAME = "org.freedesktop.DBus.Examples.Properties"; -static const char *PROPS_SERVER_PATH = "/org/freedesktop/DBus/Examples/Properties"; - -PropsClient::PropsClient(DBus::Connection &connection, const char *path, const char *name) -: DBus::ObjectProxy(connection, path, name) -{ -} - -void PropsClient::MessageChanged(const std::string& message) -{ - std::cout << "MessageChanged signal, new value: " << message << "\n"; -}; - -void PropsClient::DataChanged(const double& data) -{ - std::cout << "DataChanged signal, new value:" << data << "\n"; -}; - -void *test_property_proxy(void * input) -{ - PropsClient *client = static_cast<PropsClient*>(input); - - std::cout << "read property 'Version', value:" << client->Version() << "\n"; - - std::cout << "read property 'Message', value:" << client->Message() << "\n"; - - client->Message("message set by property access"); - std::cout << "wrote property 'Message'\n"; - - std::cout << "read property 'Message', value:" << client->Message() << "\n"; - - client->Data(1.1); - std::cout << "wrote property 'Data'\n"; - - return NULL; -} - -DBus::BusDispatcher dispatcher; - -void niam(int sig) -{ - dispatcher.leave(); - pthread_exit(NULL); -} - -int main() -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - - DBus::default_dispatcher = &dispatcher; - - DBus::_init_threading(); - - DBus::Connection conn = DBus::Connection::SessionBus(); - - PropsClient client (conn, PROPS_SERVER_PATH, PROPS_SERVER_NAME); - - pthread_t thread; - pthread_create(&thread, NULL, test_property_proxy, &client); - - dispatcher.enter(); - - return 0; -} diff --git a/libs/dbus-c++/examples/properties/propsgs-client.h b/libs/dbus-c++/examples/properties/propsgs-client.h deleted file mode 100644 index 99b70c500c4f9098c691ba6e11ef58a74349decc..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/properties/propsgs-client.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef __DEMO_PROPS_SERVER_H -#define __DEMO_PROPS_SERVER_H - -#include <dbus-c++/dbus.h> -#include "propsgs-glue-proxy.h" - -class PropsClient -: public org::freedesktop::DBus::PropsGSDemo_proxy, - public DBus::IntrospectableProxy, - public DBus::PropertiesProxy, - public DBus::ObjectProxy -{ -public: - - PropsClient(DBus::Connection &connection, const char *path, const char *name); - - void MessageChanged(const std::string& message); - - void DataChanged(const double& data); -}; - -#endif//__DEMO_PROPS_SERVER_H diff --git a/libs/dbus-c++/examples/properties/propsgs-introspect.xml b/libs/dbus-c++/examples/properties/propsgs-introspect.xml deleted file mode 100644 index 10459308fc3b0e5118e09dcefe6d6241eadc4b46..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/properties/propsgs-introspect.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" ?> -<node name="/org/freedesktop/DBus/Examples/Properties"> - <interface name="org.freedesktop.DBus.PropsGSDemo"> - <property name="Version" type="i" access="read"/> - <property name="Message" type="s" access="readwrite"/> - <property name="Data" type="d" access="write"/> - <signal name="MessageChanged"> - <arg name="message" type="s"/> - </signal> - <signal name="DataChanged"> - <arg name="Data" type="d"/> - </signal> - </interface> -</node> diff --git a/libs/dbus-c++/examples/properties/propsgs-server.cpp b/libs/dbus-c++/examples/properties/propsgs-server.cpp deleted file mode 100644 index c3ff23f645bc6d986f05ed0d894b3de998596d7f..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/properties/propsgs-server.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "propsgs-server.h" -#include <iostream> -#include <signal.h> - -static const char *PROPS_SERVER_NAME = "org.freedesktop.DBus.Examples.Properties"; -static const char *PROPS_SERVER_PATH = "/org/freedesktop/DBus/Examples/Properties"; - -PropsServer::PropsServer(DBus::Connection &connection) -: DBus::ObjectAdaptor(connection, PROPS_SERVER_PATH) -{ - Version = 1; - Message = "default message"; -} - -void PropsServer::on_set_property - (DBus::InterfaceAdaptor &interface, const std::string &property, const DBus::Variant &value) -{ - if (property == "Message") - { - std::cout << "'Message' has been changed\n"; - - std::string msg = value; - this->MessageChanged(msg); - } - if (property == "Data") - { - std::cout << "'Data' has been changed\n"; - - double data = value; - this->DataChanged(data); - } -} - -DBus::BusDispatcher dispatcher; - -void niam(int sig) -{ - dispatcher.leave(); -} - -int main() -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - - DBus::default_dispatcher = &dispatcher; - - DBus::Connection conn = DBus::Connection::SessionBus(); - conn.request_name(PROPS_SERVER_NAME); - - PropsServer server(conn); - - dispatcher.enter(); - - return 0; -} diff --git a/libs/dbus-c++/examples/properties/propsgs-server.h b/libs/dbus-c++/examples/properties/propsgs-server.h deleted file mode 100644 index a3169d629f9c857bd4a307c3a54e34b3886a8ae6..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/properties/propsgs-server.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef __DEMO_PROPS_SERVER_H -#define __DEMO_PROPS_SERVER_H - -#include <dbus-c++/dbus.h> -#include "propsgs-glue-adaptor.h" - -class PropsServer -: public org::freedesktop::DBus::PropsGSDemo_adaptor, - public DBus::IntrospectableAdaptor, - public DBus::PropertiesAdaptor, - public DBus::ObjectAdaptor -{ -public: - - PropsServer(DBus::Connection &connection); - - void on_set_property - (DBus::InterfaceAdaptor &interface, const std::string &property, const DBus::Variant &value); -}; - -#endif//__DEMO_PROPS_SERVER_H diff --git a/libs/dbus-c++/include/dbus-c++/api.h b/libs/dbus-c++/include/dbus-c++/api.h index 9afe229bd6f65a2ae695b5a056424a971b2a3a79..1e63a8e3dc8d9809e4754a8464e0ee9b84776459 100644 --- a/libs/dbus-c++/include/dbus-c++/api.h +++ b/libs/dbus-c++/include/dbus-c++/api.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_API_H #define __DBUSXX_API_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/connection.h b/libs/dbus-c++/include/dbus-c++/connection.h index c2bc4ede396b67b65b6e7393781ba837ff20d691..4251cdddf3d3db8837d4af5253c3907df0d12c79 100644 --- a/libs/dbus-c++/include/dbus-c++/connection.h +++ b/libs/dbus-c++/include/dbus-c++/connection.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_CONNECTION_H #define __DBUSXX_CONNECTION_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/dbus.h b/libs/dbus-c++/include/dbus-c++/dbus.h index 0e05e6a57fa109ec2eccdb741131a48f29d2d1cd..7dfc1641a26d09341e92252fb95daa178573f7c0 100644 --- a/libs/dbus-c++/include/dbus-c++/dbus.h +++ b/libs/dbus-c++/include/dbus-c++/dbus.h @@ -25,10 +25,6 @@ #ifndef __DBUSXX_DBUS_H #define __DBUSXX_DBUS_H -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - #include "types.h" #include "interface.h" #include "object.h" diff --git a/libs/dbus-c++/include/dbus-c++/debug.h b/libs/dbus-c++/include/dbus-c++/debug.h index 6b871f612869e4084fa68406ea07f5f9bbd338e0..6ebd03d4ccd1e363453863dd9304733b2b5ce726 100644 --- a/libs/dbus-c++/include/dbus-c++/debug.h +++ b/libs/dbus-c++/include/dbus-c++/debug.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_DEBUG_H #define __DBUSXX_DEBUG_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/dispatcher.h b/libs/dbus-c++/include/dbus-c++/dispatcher.h index c6f4d125de3381dad3852cad405d1d1171d89024..7b7858b84c00eac6efd4fa20d8a137fcab2912c9 100644 --- a/libs/dbus-c++/include/dbus-c++/dispatcher.h +++ b/libs/dbus-c++/include/dbus-c++/dispatcher.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_DISPATCHER_H #define __DBUSXX_DISPATCHER_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/error.h b/libs/dbus-c++/include/dbus-c++/error.h index 9339e5ef06be08724a4d205f6290e7de933a5ea0..152eb83000de770f4cd47c7217135cbbfe77dab0 100644 --- a/libs/dbus-c++/include/dbus-c++/error.h +++ b/libs/dbus-c++/include/dbus-c++/error.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_ERROR_H #define __DBUSXX_ERROR_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/eventloop-integration.h b/libs/dbus-c++/include/dbus-c++/eventloop-integration.h index 4a5289e59a376070ba0d7492d8f1170b9d1b0f29..1395129e1a044ef3cdeee57dc92cdf6cd699aa93 100644 --- a/libs/dbus-c++/include/dbus-c++/eventloop-integration.h +++ b/libs/dbus-c++/include/dbus-c++/eventloop-integration.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_EVENTLOOP_INTEGRATION_H #define __DBUSXX_EVENTLOOP_INTEGRATION_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/eventloop.h b/libs/dbus-c++/include/dbus-c++/eventloop.h index 42d66b16c8e8b9f704beaa0e30d9e350f8b284ab..6760ebd940725b02869ae55c2ce757b05f47b18a 100644 --- a/libs/dbus-c++/include/dbus-c++/eventloop.h +++ b/libs/dbus-c++/include/dbus-c++/eventloop.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_EVENTLOOP_H #define __DBUSXX_EVENTLOOP_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/glib-integration.h b/libs/dbus-c++/include/dbus-c++/glib-integration.h index 82f8178a991bea95dff0ffda19d3475603f6d567..0bbd3472bfb2470b0f6bfd67bb917e12a1064c5e 100644 --- a/libs/dbus-c++/include/dbus-c++/glib-integration.h +++ b/libs/dbus-c++/include/dbus-c++/glib-integration.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_GLIB_INTEGRATION_H #define __DBUSXX_GLIB_INTEGRATION_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include "config.h" #endif diff --git a/libs/dbus-c++/include/dbus-c++/interface.h b/libs/dbus-c++/include/dbus-c++/interface.h index 00da7c2a909dbba05832d37a81a1dcb9dfb25055..ea39fb752f209ad65f6dca8d364178af7de03134 100644 --- a/libs/dbus-c++/include/dbus-c++/interface.h +++ b/libs/dbus-c++/include/dbus-c++/interface.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_INTERFACE_H #define __DBUSXX_INTERFACE_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/introspection.h b/libs/dbus-c++/include/dbus-c++/introspection.h index 8bb4ee9892af50ce6c3bfd7cef8aad7d1021b3f5..f909f0b165140a23a095c75f4523e85c12229246 100644 --- a/libs/dbus-c++/include/dbus-c++/introspection.h +++ b/libs/dbus-c++/include/dbus-c++/introspection.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_INTROSPECTION_H #define __DBUSXX_INTROSPECTION_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/message.h b/libs/dbus-c++/include/dbus-c++/message.h index 3b27fdd425a9c4725f9a683d2941321de70f7777..2be55298b3f9faa9e5bd68d6888864673d283929 100644 --- a/libs/dbus-c++/include/dbus-c++/message.h +++ b/libs/dbus-c++/include/dbus-c++/message.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_MESSAGE_H #define __DBUSXX_MESSAGE_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/object.h b/libs/dbus-c++/include/dbus-c++/object.h index a7ed84d43f0be2d5ea0c91d63561135ddccde10b..389f95fc605c1177c8e0fa71866041be304764bd 100644 --- a/libs/dbus-c++/include/dbus-c++/object.h +++ b/libs/dbus-c++/include/dbus-c++/object.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_OBJECT_H #define __DBUSXX_OBJECT_H -#ifdef HAVE_CONFIG_H +#ifdef DUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/pendingcall.h b/libs/dbus-c++/include/dbus-c++/pendingcall.h index 1ba28568479d2d168c9d26dd2dfb26c72d386baf..c8946d43d098d78c454ca1df03db5a958fad0033 100644 --- a/libs/dbus-c++/include/dbus-c++/pendingcall.h +++ b/libs/dbus-c++/include/dbus-c++/pendingcall.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_PENDING_CALL_H #define __DBUSXX_PENDING_CALL_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/property.h b/libs/dbus-c++/include/dbus-c++/property.h index c9755e1fd32fa9c5e425636c5755dbfda3fac61b..20313b06600e8353e5114026e903fbe48fb81413 100644 --- a/libs/dbus-c++/include/dbus-c++/property.h +++ b/libs/dbus-c++/include/dbus-c++/property.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_PROPERTY_H #define __DBUSXX_PROPERTY_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/refptr_impl.h b/libs/dbus-c++/include/dbus-c++/refptr_impl.h index d35d8349ed1e9c1b6d254e94132655aa0149049a..d557c7b2dd47b20270f4e851dae03437ee2ac4ec 100644 --- a/libs/dbus-c++/include/dbus-c++/refptr_impl.h +++ b/libs/dbus-c++/include/dbus-c++/refptr_impl.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_REFPTR_IMPL_H #define __DBUSXX_REFPTR_IMPL_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/server.h b/libs/dbus-c++/include/dbus-c++/server.h index adc6edef264612c1f42b93cbbd32161304e9961b..c380ca71f6791b0ee6a24804afcb7a3ccd37650e 100644 --- a/libs/dbus-c++/include/dbus-c++/server.h +++ b/libs/dbus-c++/include/dbus-c++/server.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_SERVER_H #define __DBUSXX_SERVER_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/types.h b/libs/dbus-c++/include/dbus-c++/types.h index a2b6b830a023de5bca4c54ac819bdf27f32b830b..c5c60fd006e332d5ef950518782f27bd6d4c0747 100644 --- a/libs/dbus-c++/include/dbus-c++/types.h +++ b/libs/dbus-c++/include/dbus-c++/types.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_TYPES_H #define __DBUSXX_TYPES_H -#ifdef HAVE_CONFIG_H +#ifdef _DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/include/dbus-c++/util.h b/libs/dbus-c++/include/dbus-c++/util.h index 071ad306c27da5d31964256441e9c9329fb9e84b..c0a8a488753f7ffbe2256dbbe0f95a129a572ac8 100644 --- a/libs/dbus-c++/include/dbus-c++/util.h +++ b/libs/dbus-c++/include/dbus-c++/util.h @@ -25,7 +25,7 @@ #ifndef __DBUSXX_UTIL_H #define __DBUSXX_UTIL_H -#ifdef HAVE_CONFIG_H +#ifdef DBUS_HAVE_CONFIG_H #include <dbus-c++/config.h> #endif diff --git a/libs/dbus-c++/install-sh b/libs/dbus-c++/install-sh deleted file mode 100755 index a5897de6ea7f74f83fd793474bb4738d32884719..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/install-sh +++ /dev/null @@ -1,519 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2006-12-25.00 - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/libs/dbus-c++/libdbus-c++.spec.in b/libs/dbus-c++/libdbus-c++.spec.in deleted file mode 100644 index 264e02f23bebf974e676610721d4d16601e529fc..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/libdbus-c++.spec.in +++ /dev/null @@ -1,62 +0,0 @@ - - - - -Summary: C++ Interface for DBus -Name: libdbus-c++ -Version: @PACKAGE_VERSION@ -Release: 70001 -URL: http://dev.openwengo.org/trac/openwengo/trac.fcgi/browser/wengophone-ng/branches/wengophone-dbus-api/libs/dbus/src -Source0: %{name}-%{version}.tar.gz -License: LGPL -Group: Libraries -BuildRoot: %{_tmppath}/%{name}-root -Prefix: /usr - -%description - -Ability to reflect dbus methods and signals into a more natural C++ object system. - -%package devel -Requires: libdbus-c++ = %{version} -Group: Development/Libraries -Summary: Header files for libdbus-c++ - -%description devel -Header files for libdbus-c++ - - -%prep -%setup -q - -%build -./configure --prefix=/usr -make -j 4 - -%install -make prefix=$RPM_BUILD_ROOT%{prefix} install - -%clean -rm -rf $RPM_BUILD_ROOT - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%files -%defattr(755,root,root) -%{prefix}/lib/libdbus-c++*.so* - - - -%files devel -%defattr(-,root,root) -%{prefix}/bin/dbusxx-xml2cpp -%{prefix}/bin/dbusxx-introspect -%{prefix}/lib/libdbus-c*.a -%{prefix}/include/dbus-c++-1 -%{prefix}/lib/pkgconfig/*.pc - -%changelog -* Thu Feb 8 2007 Ben Martin -- initial spec file diff --git a/libs/dbus-c++/ltmain.sh b/libs/dbus-c++/ltmain.sh deleted file mode 100755 index 6d056ecf33a3e754e0e901b202f911d48854236f..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/ltmain.sh +++ /dev/null @@ -1,7880 +0,0 @@ -# Generated from ltmain.m4sh. - -# ltmain.sh (GNU libtool) 2.2.4 -# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --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 informational messages (default) -# --version print version information -# -h, --help print short or 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. -# 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) -# $progname: (GNU libtool) 2.2.4 Debian-2.2.4-0ubuntu4 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to <bug-libtool@gnu.org>. - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION="2.2.4 Debian-2.2.4-0ubuntu4" -TIMESTAMP="" -package_revision=1.2976 - -# 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 - -# NLS nuisances: We save the old values to restore during execute mode. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done - -$lt_unset CDPATH - - - - - -: ${CP="cp -f"} -: ${ECHO="echo"} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SED="/bin/sed"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -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. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -dirname="s,/[^/]*$,," -basename="s,^.*/,," - -# 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" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - -# Generated shell functions inserted here. - -# 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: -# In the unlikely event $progname began with a '-', it would play havoc with -# func_echo (imagine progname=-n), so we prepend ./ in that case: -func_dirname_and_basename "$progpath" -progname=$func_basename_result -case $progname in - -*) progname=./$progname ;; -esac - -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=: - for progdir in $PATH; do - IFS="$save_IFS" - test -x "$progdir/$progname" && break - done - IFS="$save_IFS" - test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to 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 '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" - -# Standard options: -opt_dry_run=false -opt_help=false -opt_quiet=false -opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname${mode+: }$mode: $*" -} - -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && 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_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 -} - -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 - - # bash bug again: - : -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` - done - my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_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 "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "X$my_tmpdir" | $Xsed -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# 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 () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "X$1" | $Xsed \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_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. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent 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 () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent 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 () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - - - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $SED -n '/^# Usage:/,/# -h/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - $ECHO - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help -# Echo long help message to standard output and exit. -func_help () -{ - $SED -n '/^# Usage:/,/# Report bugs to/ { - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ - p - }' < "$progpath" - exit $? -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - func_error "missing argument for $1" - exit_cmd=exit -} - -exit_cmd=: - - - - - -# Check that we have a working $ECHO. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell, and then maybe $ECHO will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -$* -EOF - exit $EXIT_SUCCESS -fi - -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" - -# Global variables. -# $mode is unset -nonopt= -execute_dlfiles= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -opt_dry_run=false -opt_duplicate_deps=false -opt_silent=false -opt_debug=: - -# 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= - -# func_fatal_configuration arg... -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "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 "$build_libtool_libs" = yes; then - $ECHO "enable shared libraries" - else - $ECHO "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $ECHO "enable static libraries" - else - $ECHO "disable static libraries" - fi - - exit $? -} - -# 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 -} - -# Parse options once, thoroughly. This comes as soon as possible in -# the script to make things like `libtool --version' happen quickly. -{ - - # 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 - - # Parse non-mode specific arguments: - while test "$#" -gt 0; do - opt="$1" - shift - - case $opt in - --config) func_config ;; - - --debug) preserve_args="$preserve_args $opt" - func_echo "enabling shell trace mode" - opt_debug='set -x' - $opt_debug - ;; - - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break - execute_dlfiles="$execute_dlfiles $1" - shift - ;; - - --dry-run | -n) opt_dry_run=: ;; - --features) func_features ;; - --finish) mode="finish" ;; - - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break - 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 $opt" - exit_cmd=exit - break - ;; - esac - - mode="$1" - shift - ;; - - --preserve-dup-deps) - opt_duplicate_deps=: ;; - - --quiet|--silent) preserve_args="$preserve_args $opt" - opt_silent=: - ;; - - --verbose| -v) preserve_args="$preserve_args $opt" - opt_silent=false - ;; - - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break - preserve_args="$preserve_args $opt $1" - func_enable_tag "$1" # tagname is set here - shift - ;; - - # Separate optargs to long options: - -dlopen=*|--mode=*|--tag=*) - func_opt_split "$opt" - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} - shift - ;; - - -\?|-h) func_usage ;; - --help) opt_help=: ;; - --version) func_version ;; - - -*) func_fatal_help "unrecognized option \`$opt'" ;; - - *) nonopt="$opt" - break - ;; - esac - done - - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps - ;; - esac - - # Having warned about all mis-specified options, bail out if - # anything was wrong. - $exit_cmd $EXIT_FAILURE -} - -# 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 -} - - -## ----------- ## -## Main. ## -## ----------- ## - -$opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - test -z "$mode" && func_fatal_error "error: you must specify a MODE." - - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; 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=$mode' for more information." -} - - -# 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 () -{ - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# 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 -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 "$lalib_p" = yes -} - -# 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 () -{ - func_lalib_p "$1" -} - -# 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_ltwrapper_scriptname_result="" - if func_ltwrapper_executable_p "$1"; then - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" - fi -} - -# 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 () -{ - $opt_debug - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$save_ifs - eval cmd=\"$cmd\" - 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 () -{ - $opt_debug - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$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 () -{ - $opt_debug - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" - done - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" - done - case "$@ " in - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - 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 "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none - fi - - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T <<EOF -# $write_libobj - a libtool object file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# Name of the PIC object. -pic_object=$write_lobj - -# Name of the non-PIC object -non_pic_object=$write_oldobj - -EOF - $MV "${write_libobj}T" "${write_libobj}" - } -} - -# func_mode_compile arg... -func_mode_compile () -{ - $opt_debug - # 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) - pie_flag="$pie_flag $arg" - continue - ;; - - -shared | -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - func_quote_for_eval "$arg" - lastarg="$lastarg $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$lastarg" - lastarg=$func_stripname_result - - # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" - continue - ;; - - *) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - func_quote_for_eval "$lastarg" - base_compile="$base_compile $func_quote_for_eval_result" - 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 | *.obj | *.sx) - 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 "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not 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 "$build_old_libs" = yes; 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*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - removelist="$removelist $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - removelist="$removelist $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; 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 - command="$command -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - 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 "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - 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 "$need_locks" != no; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { -test "$mode" = compile && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $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 building PIC objects only - -prefer-non-pic try to building 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 - -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 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 - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -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 - -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 \`$mode'" - ;; - esac - - $ECHO - $ECHO "Try \`$progname --help' for more information about other modes." - - exit $? -} - - # Now that we've collected a possible --mode arg, show help if necessary - $opt_help && func_mode_help - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # 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 $execute_dlfiles; do - test -f "$file" \ - || func_fatal_help "\`$file' is not a file" - - dir= - case $file in - *.la) - # 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 - dir="$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 - -*) ;; - *) - # 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_quote_for_eval "$file" - args="$args $func_quote_for_eval_result" - done - - if test "X$opt_dry_run" = Xfalse; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - $ECHO "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - fi -} - -test "$mode" = execute && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - 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" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS - - $ECHO "X----------------------------------------------------------------------" | $Xsed - $ECHO "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - $ECHO - $ECHO "If you ever happen to want to link against installed libraries" - $ECHO "in a given directory, LIBDIR, you must either use libtool, and" - $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" - $ECHO "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" - $ECHO " during execution" - fi - if test -n "$runpath_var"; then - $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" - $ECHO " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $ECHO - - $ECHO "See any operating system documentation about shared libraries for" - 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 "X----------------------------------------------------------------------" | $Xsed - exit $EXIT_SUCCESS -} - -test "$mode" = finish && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $opt_debug - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $ECHO "X$nonopt" | $GREP shtool >/dev/null; then - # Aesthetically quote it. - 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" - install_prog="$install_prog$func_quote_for_eval_result" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - install_prog="$install_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 -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=yes - if test "$isdir" = yes; 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. - staticlibs="$staticlibs $file" - ;; - - *.la) - # 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 "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir="$func_dirname_result" - dir="$dir$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -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 "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "X$relink_command" | $Xsed -e "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_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32*) - 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" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - 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 "$build_old_libs" = yes; 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=yes - 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 "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - 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 "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - 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_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $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 "$mode" = install && 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 () -{ - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; 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$TIMESTAMP) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; 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 "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_verbose "extracting global C symbols from \`$progfile'" - $opt_dry_run || eval "$NM $progfile | $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* ) - 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* ) - 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" - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - 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 >/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 - - $ECHO >> "$output_objdir/$my_dlsyms" "\ - -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -" - case $host in - *cygwin* | *mingw* ) - $ECHO >> "$output_objdir/$my_dlsyms" "\ -/* DATA imports from DLLs on WIN32 con't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs. */" - lt_dlsym_const= ;; - *osf5*) - echo >> "$output_objdir/$my_dlsyms" "\ -/* This system does not cope well with relocations in const data */" - lt_dlsym_const= ;; - *) - lt_dlsym_const=const ;; - esac - - $ECHO >> "$output_objdir/$my_dlsyms" "\ -extern $lt_dlsym_const lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; -$lt_dlsym_const lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," - - 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" ;; - *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) symtab_cflags="$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"' - - # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" - case $host in - *cygwin* | *mingw* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "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 "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | - $SED -n -e ' - 1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - 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 () -{ - $opt_debug - 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` - darwin_base_archive=`basename "$darwin_archive"` - 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 "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -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 | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - - -# func_emit_wrapper arg -# -# 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 variable -# 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 in which it is stored is -# the '.lib' directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=no - if test -n "$1" ; then - func_emit_wrapper_arg1=$1 - fi - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $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. -Xsed='${SED} -e 1s/^X//' -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 - ECHO=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$ECHO works! - : - else - # Restart under the correct shell, and then maybe \$ECHO will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $ECHO "\ - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # 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 \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; 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" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && 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 \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $ECHO "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 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\ -" -} -# end: func_emit_wrapper - -# 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 <<EOF - -/* $cwrappersource - temporary wrapper executable for $objdir/$outputname - Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION - - The $output program cannot be directly executed until all the libtool - libraries that it depends on are installed. - - This wrapper executable should never be moved out of the build directory. - If it is, it will not operate correctly. - - Currently, it simply execs the wrapper *script* "$SHELL $output", - but could eventually absorb all of the scripts functionality and - exec $objdir/$outputname directly. -*/ -EOF - cat <<"EOF" -#include <stdio.h> -#include <stdlib.h> -#ifdef _MSC_VER -# include <direct.h> -# include <process.h> -# include <io.h> -# define setmode _setmode -#else -# include <unistd.h> -# include <stdint.h> -# ifdef __CYGWIN__ -# include <io.h> -# endif -#endif -#include <malloc.h> -#include <stdarg.h> -#include <assert.h> -#include <string.h> -#include <ctype.h> -#include <errno.h> -#include <fcntl.h> -#include <sys/stat.h> - -#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 - -#ifdef _MSC_VER -# define S_IXUSR _S_IEXEC -# define stat _stat -# ifndef _INTPTR_T_DEFINED -# define intptr_t int -# endif -#endif - -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# 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 */ - -#ifdef __CYGWIN__ -# define FOPEN_WB "wb" -#endif - -#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 ((void *) stale); stale = 0; } \ -} while (0) - -#undef LTWRAPPER_DEBUGPRINTF -#if defined DEBUGWRAPPER -# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args -static void -ltwrapper_debugprintf (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); -} -#else -# define LTWRAPPER_DEBUGPRINTF(args) -#endif - -const char *program_name = NULL; - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -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_fatal (const char *message, ...); - -static const char *script_text = -EOF - - func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ "/' -e 's/$/\\n"/' - echo ";" - - cat <<EOF -const char * MAGIC_EXE = "$magic_exe"; - -int -main (int argc, char *argv[]) -{ - char **newargz; - char *tmp_pathspec; - char *actual_cwrapper_path; - char *shwrapper_name; - intptr_t rval = 127; - FILE *shwrapper; - - const char *dumpscript_opt = "--lt-dump-script"; - int i; - - program_name = (char *) xstrdup (base_name (argv[0])); - LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0])); - LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name)); - - /* very simple arg parsing; don't want to rely on getopt */ - for (i = 1; i < argc; i++) - { - if (strcmp (argv[i], dumpscript_opt) == 0) - { -EOF - case "$host" in - *mingw* | *cygwin* ) - # make stdout use "unix" line endings - echo " setmode(1,_O_BINARY);" - ;; - esac - - cat <<EOF - printf ("%s", script_text); - return 0; - } - } - - newargz = XMALLOC (char *, argc + 2); -EOF - - if test -n "$TARGETSHELL" ; then - # no path translation at all - lt_newargv0=$TARGETSHELL - else - case "$host" in - *mingw* ) - # awkward: cmd appends spaces to result - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - lt_newargv0=`( cmd //c echo $SHELL | $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo $SHELL` - case $lt_newargv0 in - *.exe | *.EXE) ;; - *) lt_newargv0=$lt_newargv0.exe ;; - esac - ;; - * ) lt_newargv0=$SHELL ;; - esac - fi - - cat <<EOF - newargz[0] = (char *) xstrdup ("$lt_newargv0"); -EOF - - cat <<"EOF" - tmp_pathspec = find_executable (argv[0]); - if (tmp_pathspec == NULL) - lt_fatal ("Couldn't find %s", argv[0]); - LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n", - tmp_pathspec)); - - actual_cwrapper_path = chase_symlinks (tmp_pathspec); - LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n", - actual_cwrapper_path)); - XFREE (tmp_pathspec); - - shwrapper_name = (char *) xstrdup (base_name (actual_cwrapper_path)); - strendzap (actual_cwrapper_path, shwrapper_name); - - /* shwrapper_name transforms */ - strendzap (shwrapper_name, ".exe"); - tmp_pathspec = XMALLOC (char, (strlen (shwrapper_name) + - strlen ("_ltshwrapperTMP") + 1)); - strcpy (tmp_pathspec, shwrapper_name); - strcat (tmp_pathspec, "_ltshwrapperTMP"); - XFREE (shwrapper_name); - shwrapper_name = tmp_pathspec; - tmp_pathspec = 0; - LTWRAPPER_DEBUGPRINTF (("(main) libtool shell wrapper name: %s\n", - shwrapper_name)); -EOF - - cat <<EOF - newargz[1] = - XMALLOC (char, (strlen (actual_cwrapper_path) + - strlen ("$objdir") + 1 + strlen (shwrapper_name) + 1)); - strcpy (newargz[1], actual_cwrapper_path); - strcat (newargz[1], "$objdir"); - strcat (newargz[1], "/"); - strcat (newargz[1], shwrapper_name); -EOF - - - case $host_os in - mingw*) - cat <<"EOF" - { - char* p; - while ((p = strchr (newargz[1], '\\')) != NULL) - { - *p = '/'; - } - } -EOF - ;; - esac - - cat <<"EOF" - XFREE (shwrapper_name); - XFREE (actual_cwrapper_path); - - /* always write in binary mode */ - if ((shwrapper = fopen (newargz[1], FOPEN_WB)) == 0) - { - lt_fatal ("Could not open %s for writing", newargz[1]); - } - fprintf (shwrapper, "%s", script_text); - fclose (shwrapper); - - make_executable (newargz[1]); - - for (i = 1; i < argc; i++) - newargz[i + 1] = xstrdup (argv[i]); - newargz[argc + 1] = NULL; - - for (i = 0; i < argc + 1; i++) - { - LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, newargz[i])); - } - -EOF - - case $host_os in - mingw*) - cat <<EOF - /* execv doesn't actually work on mingw as expected on unix */ - rval = _spawnv (_P_WAIT, "$lt_newargv0", (const char * const *) newargz); - if (rval == -1) - { - /* failed to start process */ - LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"$lt_newargv0\": errno = %d\n", errno)); - return 127; - } - return rval; -} -EOF - ;; - *) - cat <<EOF - execv ("$lt_newargv0", newargz); - return rval; /* =127, but avoids unused variable warning */ -} -EOF - ;; - esac - - cat <<"EOF" - -void * -xmalloc (size_t num) -{ - void *p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), - string) : NULL; -} - -const char * -base_name (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char) name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} - -int -check_executable (const char *path) -{ - struct stat st; - - LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); - if ((!path) || (!*path)) - return 0; - - if ((stat (path, &st) >= 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; - - LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); - 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]; - int tmp_len; - char *concat_name; - - LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", - wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -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) - { - LTWRAPPER_DEBUGPRINTF (("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 - { - char *errstr = strerror (errno); - lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal ("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 (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which 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 which 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 - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - 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 "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && 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 - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - 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 "*) ;; - *) deplibs="$deplibs $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if 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 "$pic_object" = none && - test "$non_pic_object" = none; 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 "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - 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 - ;; - 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 "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - weak) - weak_libs="$weak_libs $arg" - prev= - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$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 - ;; - - -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$arg" = "X-export-symbols"; 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" - dir=$func_stripname_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 "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - -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) - compiler_flags="$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) - compiler_flags="$compiler_flags $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) new_inherited_linker_flags="$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*) - # 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 - ;; - - -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_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$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" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$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" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" - linker_flags="$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" - ;; - - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - func_append compile_command " $arg" - func_append finalize_command " $arg" - compiler_flags="$compiler_flags $arg" - continue - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - *.$objext) - # A standard object. - objs="$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 "$pic_object" = none && - test "$non_pic_object" = none; 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 "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - 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. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - 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 "$export_dynamic" = yes && 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 \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - # 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_duplicate_deps ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - 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=no - 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 "$linkmode,$pass" = "lib,link"; 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 "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; - esac - fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - case $lib in - *.la) func_source "$lib" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` - case " $weak_libs " in - *" $deplib_base "*) ;; - *) deplibs="$deplibs $deplib" ;; - esac - done - done - libs="$dlprefiles" - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test "$linkmode" = lib; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if 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=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" - ;; - *) - func_warning "\`-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - func_stripname '-R' '' "$deplib" - dir=$func_stripname_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - $ECHO - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because the file extensions .$libext of this argument makes me believe" - $ECHO "*** that it is just a static archive that I should not use here." - else - $ECHO - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi - - # 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 "X$inherited_linker_flags" | $Xsed -e '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 "*) ;; - *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" - fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_duplicate_deps ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - 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 "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" - ;; - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_duplicate_deps ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in - *"$absdir:"*) ;; - *) temp_rpath="$temp_rpath$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw*) - # No point in relinking DLLs because paths are not encoded - notinst_deplibs="$notinst_deplibs $lib" - need_relink=no - ;; - *) - if test "$installed" = no; then - notinst_deplibs="$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 "$shouldnotlink" = yes && test "$pass" = link; then - $ECHO - if test "$linkmode" = prog; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - 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*) - 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 "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not - # 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 "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - $ECHO - $ECHO "*** Warning: This system can not link to static lib archive $lib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - $ECHO "*** But as you try to build a module library, libtool will still create " - $ECHO "*** a static module, that should work as long as the dlopening application" - $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if $opt_duplicate_deps ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - 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 - compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - linker_flags="$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 "$pass" = link; then - if test "$linkmode" = "prog"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; 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" - objs="$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 "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" - - if test "$need_lib_prefix" != no; 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 "$deplibs_check_method" != pass_all; 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!" - libobjs="$libobjs $objs" - fi - fi - - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" - - install_libdir="$1" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - 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 - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|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 - ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; - 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" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; 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 "$loop" -ne 0; 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) - 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 "$loop" -ne 0; 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. - verstring="$verstring:${current}.0" - ;; - - qnx) - major=".$current" - versuffix=".$current" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - 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 "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - fi - - func_generate_dlsyms "$libname" "$libname" "yes" - libobjs="$libobjs $symfileobj" - test "X$libobjs" = "X " && libobjs= - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` - # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` - # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs 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 "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c <<EOF - int main() { return 0; } -EOF - $opt_dry_run || $RM conftest - if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then - ldd_output=`ldd conftest` - for i in $deplibs; do - case $i in - -l*) - func_stripname -l '' "$i" - name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $i "*) - newdeplibs="$newdeplibs $i" - i="" - ;; - esac - fi - if test -n "$i" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` - set dummy $deplib_matches; shift - deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - $ECHO - $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $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 I believe you do not have" - $ECHO "*** because a test_compile did reveal that the linker did not use it for" - $ECHO "*** its dynamic dependency list that programs get resolved with at runtime." - fi - fi - ;; - *) - newdeplibs="$newdeplibs $i" - ;; - esac - done - else - # Error occurred in the first compile. Let's try to salvage - # the situation: Compile a separate program for each library. - for i in $deplibs; do - case $i in - -l*) - func_stripname -l '' "$i" - name=$func_stripname_result - $opt_dry_run || $RM conftest - if $LTCC $LTCFLAGS -o conftest conftest.c $i; then - ldd_output=`ldd conftest` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $i "*) - newdeplibs="$newdeplibs $i" - i="" - ;; - esac - fi - if test -n "$i" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` - set dummy $deplib_matches; shift - deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - $ECHO - $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $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 a test_compile did reveal that the linker did not use this one" - $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime." - fi - fi - else - droppeddeps=yes - $ECHO - $ECHO "*** Warning! Library $i is needed by this library but I was not able to" - $ECHO "*** make it link in! You will probably need to install it or some" - $ECHO "*** library that it depends on before this library will be fully" - $ECHO "*** functional. Installing it before continuing would be even better." - fi - ;; - *) - newdeplibs="$newdeplibs $i" - ;; - esac - done - fi - ;; - file_magic*) - set dummy $deplibs_check_method; shift - file_magic_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 "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $ECHO - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - newdeplibs="$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 "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $ECHO - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ - -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` - done - fi - if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | - $GREP . >/dev/null; then - $ECHO - if test "X$deplibs_check_method" = "Xnone"; then - $ECHO "*** Warning: inter-library dependencies are not supported in this platform." - else - $ECHO "*** Warning: inter-library dependencies are not known to be supported." - fi - $ECHO "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - $ECHO - $ECHO "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - $ECHO "*** a static module, that should work as long as the dlopening" - $ECHO "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - $ECHO "*** The inter-library dependencies that have been dropped here will be" - $ECHO "*** automatically added whenever a program is linked with this library" - $ECHO "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - $ECHO - $ECHO "*** Since this library must not contain undefined symbols," - $ECHO "*** because either the platform does not support them or" - $ECHO "*** it was explicitly requested with -no-undefined," - $ECHO "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO "X $deplibs" | $Xsed -e '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 "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - deplibs="$new_libs" - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - 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 - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$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" - delfiles="$delfiles $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then - # 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 - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || 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 cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - func_len " $cmd" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - func_show_eval "$cmd" 'exit $?' - 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 "X$skipped_export" != "X:"; 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 "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' - fi - - if test "X$skipped_export" != "X:" && 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 - delfiles="$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 "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && - 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" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - 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 - output_la=`$ECHO "X$output" | $Xsed -e "$basename"` - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript - func_verbose "creating GNU ld script: $output" - $ECHO 'INPUT (' > $output - for obj in $save_libobjs - do - $ECHO "$obj" >> $output - done - $ECHO ')' >> $output - delfiles="$delfiles $output" - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test "$compiler_needs_object" = yes; then - firstobj="$1 " - shift - fi - for obj - do - $ECHO "$obj" >> $output - done - delfiles="$delfiles $output" - output=$firstobj\"$file_list_spec$output\" - 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 "X$objlist" = X || - 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 "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$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~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - delfiles="$delfiles $output" - - else - output= - fi - - if ${skipped_export-false}; then - 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 - 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_silent || { - 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 "$mode" = relink; 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 - - if ${skipped_export-false}; then - 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 "X$include_expsyms" | $Xsed | $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 - delfiles="$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 - 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 "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - 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" - generated="$generated $gentop" - - func_extract_archives $gentop $dlprefiles - libobjs="$libobjs $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $opt_silent || { - 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 "$mode" = relink; 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 "$mode" = relink; 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 "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; 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= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - 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 - - if test "$build_libtool_libs" != yes; then - 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 - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - 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" - - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - 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 "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e '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 "$tagname" = CXX ; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e '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 "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=yes - case $host in - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "X$compile_command" | $Xsed -e '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=$?' - - # 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 - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - # 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 "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $ECHO for shipping. - if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if 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 - - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $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 - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - oldobjs="$oldobjs $symfileobj" - fi - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $dlprefiles - oldobjs="$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" - generated="$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" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - 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 - 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 "X$oldobjs" = "X" ; 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 "$build_old_libs" = yes && 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 "X$relink_command" | $Xsed -e "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$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" - newdlfiles="$newdlfiles $libdir/$name" - ;; - *) newdlfiles="$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" - newdlprefiles="$newdlprefiles $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 - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $RM $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $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 can not 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 "$installed" = no && test "$need_relink" = yes; 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 -} - -{ test "$mode" = link || test "$mode" = relink; } && - func_mode_link ${1+"$@"} - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $opt_debug - RM="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) RM="$RM $arg"; rmforce=yes ;; - -*) RM="$RM $arg" ;; - *) files="$files $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - func_basename "$file" - name="$func_basename_result" - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - - case "$mode" in - clean) - case " $library_names " in - # " " in the beginning catches empty $dlname - *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; - esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || 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 "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - 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 - rmfiles="$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 - rmfiles="$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 - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -{ test "$mode" = uninstall || test "$mode" = clean; } && - func_mode_uninstall ${1+"$@"} - -test -z "$mode" && { - help="$generic_help" - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$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 -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -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: -# vi:sw=2 - diff --git a/libs/dbus-c++/missing b/libs/dbus-c++/missing deleted file mode 100755 index 1c8ff7049d8f3aaa9741c53e7f3145d9b76a77d8..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/missing +++ /dev/null @@ -1,367 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2006-05-10.23 - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. -# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] - -Send bug reports to <bug-automake@gnu.org>." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - -esac - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). -case $1 in - lex|yacc) - # Not GNU programs, they don't have --version. - ;; - - tar) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $1 in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit 1 - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - tar) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/libs/dbus-c++/src/Makefile.am b/libs/dbus-c++/src/Makefile.am index f449e9db9eb9e68ee8f2ec809b8e8c14e75f2643..abb5abe4c82617725ad2b94194a0b0c97e050a35 100644 --- a/libs/dbus-c++/src/Makefile.am +++ b/libs/dbus-c++/src/Makefile.am @@ -1,17 +1,17 @@ AM_CPPFLAGS = \ $(dbus_CFLAGS) \ $(glib_CFLAGS) \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include + -I$(top_srcdir)/libs/dbus-c++/include \ + -I$(top_builddir)/libs/dbus-c++/include if ENABLE_GLIB GLIB_H = $(HEADER_DIR)/glib-integration.h GLIB_CPP = glib-integration.cpp endif -CONFIG_H = $(top_builddir)/include/dbus-c++/config.h +CONFIG_H = $(top_builddir)/libs/dbus-c++/include/dbus-c++/config.h -HEADER_DIR = $(top_srcdir)/include/dbus-c++ +HEADER_DIR = $(top_builddir)/libs/dbus-c++/include/dbus-c++ HEADER_FILES = \ $(CONFIG_H) \ $(HEADER_DIR)/dbus.h \ @@ -36,9 +36,9 @@ HEADER_FILES = \ $(GLIB_H) lib_includedir=$(includedir)/dbus-c++-1/dbus-c++/ -lib_include_HEADERS = $(HEADER_FILES) +#lib_include_HEADERS = $(HEADER_FILES) -lib_LTLIBRARIES = libdbus-c++-1.la +noinst_LTLIBRARIES = libdbus-c++-1.la libdbus_c___1_la_SOURCES = $(HEADER_FILES) interface.cpp object.cpp introspection.cpp debug.cpp types.cpp connection.cpp connection_p.h property.cpp dispatcher.cpp dispatcher_p.h pendingcall.cpp pendingcall_p.h error.cpp internalerror.h message.cpp message_p.h server.cpp server_p.h eventloop.cpp eventloop-integration.cpp $(GLIB_CPP) libdbus_c___1_la_LIBADD = $(dbus_LIBS) $(glib_LIBS) $(pthread_LIBS) diff --git a/libs/dbus-c++/src/dispatcher.cpp b/libs/dbus-c++/src/dispatcher.cpp index 68c4412c3d5171e1452f43edbcd1aa0fff4cb364..9752afe4030dd45eb90f48be60f8254ce7b3b0b4 100644 --- a/libs/dbus-c++/src/dispatcher.cpp +++ b/libs/dbus-c++/src/dispatcher.cpp @@ -173,6 +173,7 @@ void Dispatcher::dispatch_pending() _mutex_p.unlock(); } +#undef DBUS_HAS_THREADS_INIT_DEFAULT #ifdef DBUS_HAS_THREADS_INIT_DEFAULT void DBus::_init_threading() { diff --git a/libs/dbus-c++/tools/Makefile.am b/libs/dbus-c++/tools/Makefile.am index 8ee021cf20fab1fe9432016d0a05df97be527f9e..f491376bbfde53804607bbb93cd1acaee0fa1216 100644 --- a/libs/dbus-c++/tools/Makefile.am +++ b/libs/dbus-c++/tools/Makefile.am @@ -1,18 +1,18 @@ # hacky, but ... -CXX = $(CXX_FOR_BUILD) +#CXX = $(CXX_FOR_BUILD) AM_CPPFLAGS = \ $(dbus_CFLAGS) \ $(xml_CFLAGS) \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include + -I$(top_srcdir)/libs/dbus-c++/include \ + -I$(top_builddir)/libs/dbus-c++/include -if CROSS_COMPILING -libdbus_cxx_la = $(BUILD_LIBDBUS_CXX_DIR)/src/libdbus-c++-1.la -else -libdbus_cxx_la = $(top_builddir)/src/libdbus-c++-1.la -endif +#if CROSS_COMPILING +#libdbus_cxx_la = $(BUILD_LIBDBUS_CXX_DIR)/src/libdbus-c++-1.la +#else +libdbus_cxx_la = $(top_builddir)/libs/dbus-c++/src/libdbus-c++-1.la +#endif bin_PROGRAMS = dbusxx-xml2cpp dbusxx-introspect diff --git a/libs/libiax2/AUTHORS b/libs/iax2/AUTHORS similarity index 100% rename from libs/libiax2/AUTHORS rename to libs/iax2/AUTHORS diff --git a/libs/libiax2/COPYING b/libs/iax2/COPYING similarity index 100% rename from libs/libiax2/COPYING rename to libs/iax2/COPYING diff --git a/libs/iax2/Makefile.am b/libs/iax2/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..0ffa5583e9027e7bd7e4ad9fbc91c9600f234570 --- /dev/null +++ b/libs/iax2/Makefile.am @@ -0,0 +1,11 @@ +AM_CFLAGS = -Wall -O2 +AM_CFLAGS += -g -Wall -Wstrict-prototypes -I . +AM_CFLAGS += -DLIBIAX +AM_CFLAGS += -fsigned-char +# -DDEBUG_SUPPORT (doesn't compile with it) +# -DDEBUG_DEFAULT +AM_CFLAGS += $(UCFLAGS) + +noinst_LTLIBRARIES = libiax2.la +libiax2_la_SOURCES = iax2-parser.c iax.c md5.c jitterbuf.c + diff --git a/libs/libiax2/src/answer.h b/libs/iax2/answer.h similarity index 100% rename from libs/libiax2/src/answer.h rename to libs/iax2/answer.h diff --git a/libs/libiax2/src/busy.h b/libs/iax2/busy.h similarity index 100% rename from libs/libiax2/src/busy.h rename to libs/iax2/busy.h diff --git a/libs/libiax2/src/dialtone.h b/libs/iax2/dialtone.h similarity index 100% rename from libs/libiax2/src/dialtone.h rename to libs/iax2/dialtone.h diff --git a/libs/libiax2/src/frame.h b/libs/iax2/frame.h similarity index 100% rename from libs/libiax2/src/frame.h rename to libs/iax2/frame.h diff --git a/libs/libiax2/src/iax-client.h b/libs/iax2/iax-client.h similarity index 100% rename from libs/libiax2/src/iax-client.h rename to libs/iax2/iax-client.h diff --git a/libs/libiax2/src/iax.c b/libs/iax2/iax.c similarity index 100% rename from libs/libiax2/src/iax.c rename to libs/iax2/iax.c diff --git a/libs/libiax2/src/iax.h b/libs/iax2/iax.h similarity index 100% rename from libs/libiax2/src/iax.h rename to libs/iax2/iax.h diff --git a/libs/libiax2/src/iax2-parser.c b/libs/iax2/iax2-parser.c similarity index 100% rename from libs/libiax2/src/iax2-parser.c rename to libs/iax2/iax2-parser.c diff --git a/libs/libiax2/src/iax2-parser.h b/libs/iax2/iax2-parser.h similarity index 100% rename from libs/libiax2/src/iax2-parser.h rename to libs/iax2/iax2-parser.h diff --git a/libs/libiax2/src/iax2.h b/libs/iax2/iax2.h similarity index 100% rename from libs/libiax2/src/iax2.h rename to libs/iax2/iax2.h diff --git a/libs/libiax2/src/jitterbuf.c b/libs/iax2/jitterbuf.c similarity index 100% rename from libs/libiax2/src/jitterbuf.c rename to libs/iax2/jitterbuf.c diff --git a/libs/libiax2/src/jitterbuf.h b/libs/iax2/jitterbuf.h similarity index 100% rename from libs/libiax2/src/jitterbuf.h rename to libs/iax2/jitterbuf.h diff --git a/libs/libiax2/src/md5.c b/libs/iax2/md5.c similarity index 100% rename from libs/libiax2/src/md5.c rename to libs/iax2/md5.c diff --git a/libs/libiax2/src/md5.h b/libs/iax2/md5.h similarity index 100% rename from libs/libiax2/src/md5.h rename to libs/iax2/md5.h diff --git a/libs/libiax2/src/miniphone.c b/libs/iax2/miniphone.c similarity index 100% rename from libs/libiax2/src/miniphone.c rename to libs/iax2/miniphone.c diff --git a/libs/libiax2/src/miniphone.h b/libs/iax2/miniphone.h similarity index 100% rename from libs/libiax2/src/miniphone.h rename to libs/iax2/miniphone.h diff --git a/libs/libiax2/src/options.c b/libs/iax2/options.c similarity index 100% rename from libs/libiax2/src/options.c rename to libs/iax2/options.c diff --git a/libs/libiax2/src/options.h b/libs/iax2/options.h similarity index 100% rename from libs/libiax2/src/options.h rename to libs/iax2/options.h diff --git a/libs/libiax2/src/ring10.h b/libs/iax2/ring10.h similarity index 100% rename from libs/libiax2/src/ring10.h rename to libs/iax2/ring10.h diff --git a/libs/libiax2/src/ringtone.h b/libs/iax2/ringtone.h similarity index 100% rename from libs/libiax2/src/ringtone.h rename to libs/iax2/ringtone.h diff --git a/libs/libiax2/src/winiphone.c b/libs/iax2/winiphone.c similarity index 100% rename from libs/libiax2/src/winiphone.c rename to libs/iax2/winiphone.c diff --git a/libs/libiax2/src/winpoop.h b/libs/iax2/winpoop.h similarity index 100% rename from libs/libiax2/src/winpoop.h rename to libs/iax2/winpoop.h diff --git a/libs/libiax2/COPYING.LIB b/libs/libiax2/COPYING.LIB deleted file mode 100644 index 161a3d1d47b94f5d092b4c5fa316007c6f22fe81..0000000000000000000000000000000000000000 --- a/libs/libiax2/COPYING.LIB +++ /dev/null @@ -1,482 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 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. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, 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 library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, 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 companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, 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 library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete 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 distribute a copy of this License along with the -Library. - - 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 Library or any portion -of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -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 Library, 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 Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you 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. - - If distribution of 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 satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. 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. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library 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. - - 9. 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 Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -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. - - 11. 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 Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library 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 Library. - -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. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library 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. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -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 Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -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 - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "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 -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. 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 LIBRARY 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 -LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. 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. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; 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. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/libs/libiax2/ChangeLog b/libs/libiax2/ChangeLog deleted file mode 100644 index 311fecbd3830b243fbc3481b697febc59feb04fc..0000000000000000000000000000000000000000 --- a/libs/libiax2/ChangeLog +++ /dev/null @@ -1,21 +0,0 @@ -libiax -====== - -version 0.2.3: - * Allow password to be passed in connect - -version 0.2.2 (Nov 13th, 2001): - * HTML Unlink requests - * HTML Reject link requests - * Text frames - -version 0.2.1 (Oct 20th, 2001): - * More space for challenge in IAX - * Fixed strncpy security bug - * Accept larger packets - * Handle out of order packets better - * Implemented send_url - * Added an iax-config script :-) - -version 0.2.0 (Oct 10th, 2001): - * Initial Public Release diff --git a/libs/libiax2/INSTALL b/libs/libiax2/INSTALL deleted file mode 120000 index 5bb6e7b7e1a1d3ba4362b1467fabbf2acb70dcbd..0000000000000000000000000000000000000000 --- a/libs/libiax2/INSTALL +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.10/INSTALL \ No newline at end of file diff --git a/libs/libiax2/Makefile.am b/libs/libiax2/Makefile.am deleted file mode 100644 index 0c5a65136ce6f40bc02c4391c8ec6ebbc2527db3..0000000000000000000000000000000000000000 --- a/libs/libiax2/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -SUBDIRS = src - -bin_SCRIPTS=iax2-config -BUILT_SCOURCES=iax2-config -EXTRA_DIST=iax.spec libiax2.vcproj -iax2-config: iax2-config.in diff --git a/libs/libiax2/NEWS b/libs/libiax2/NEWS deleted file mode 100644 index 233df649e23e419bfe8dd51383c0b67398fafc57..0000000000000000000000000000000000000000 --- a/libs/libiax2/NEWS +++ /dev/null @@ -1,12 +0,0 @@ -libiax -====== - -0.2.3: - -0.2.2: - -0.2.1: - -0.2.0 (Oct 10th, 2001): - Initial Release. Hooray! Rejoice! :) - diff --git a/libs/libiax2/README b/libs/libiax2/README deleted file mode 100644 index 72f5e9e795b133f6699a84c59751f4c63d47b082..0000000000000000000000000000000000000000 --- a/libs/libiax2/README +++ /dev/null @@ -1,4 +0,0 @@ -libiax: An implementation of the Inter-Asterisk eXchange protocol distributed -under the terms of the GNU Lesser General Public License - -Written by Mark Spencer <markster@linux-support.net> diff --git a/libs/libiax2/bootstrap.sh b/libs/libiax2/bootstrap.sh deleted file mode 100755 index 640caa72679d71e456e769dd960fe186baacb8f0..0000000000000000000000000000000000000000 --- a/libs/libiax2/bootstrap.sh +++ /dev/null @@ -1,6 +0,0 @@ -echo If this fails you probably need to download the latest -echo libtool,aclocal,autoconf and automake -libtoolize --force -aclocal --force -autoconf -f -automake -acf diff --git a/libs/libiax2/build.sh b/libs/libiax2/build.sh deleted file mode 100755 index 9dfda77c387d94481431b8be7c477ab6cf861aef..0000000000000000000000000000000000000000 --- a/libs/libiax2/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -echo configuring automake -./bootstrap.sh -echo configuring libiax2 -./configure --enable-newjb -echo building libiax2 -make -echo -echo -echo '##################################################################' -echo '# #' -echo '# If all is well, enter "make install" to complete installation. #' -echo '# #' -echo '##################################################################' diff --git a/libs/libiax2/configure.in b/libs/libiax2/configure.in deleted file mode 100644 index b07947603dd25250e89967ad58e1c35b86b25d85..0000000000000000000000000000000000000000 --- a/libs/libiax2/configure.in +++ /dev/null @@ -1,38 +0,0 @@ -dnl Yo Yo Yo -AC_INIT(src/iax.c) -AM_INIT_AUTOMAKE([iax2], [0.2.3]) - - -dnl Check for various goodies -AC_PROG_CC -AM_PROG_LIBTOOL -dnl LIBTOOL="$LIBTOOL --silent" -AC_PROG_INSTALL - -dnl Check for libraries -dnl None available - -dnl Check header files -AC_HEADER_STDC - -AC_SUBST(LIBS) - -AC_ARG_ENABLE(snomhack, [ --enable-snomhack Use slower memset for SNOM phoneem ],,enable_snomhack=no) -AC_ARG_ENABLE(extreme_debug, [ --enable-extreme-debug Compile with extreme debugging code enabled ],,enable_extreme_debug=no) -if test "$enable_snomhack" = yes ; then - AC_DEFINE(SNOM_HACK) -fi - -if test "$enable_extreme_debug" = yes ; then - AC_DEFINE(EXTREME_DEBUG) -fi - -AC_SUBST(IAX_VERSION) - -AC_OUTPUT([ -Makefile -src/Makefile -iax.spec -iax2-config],[case "$CONFIG_FILES" in -*iax2-config*)chmod +x iax2-config;; -esac]) diff --git a/libs/libiax2/debian/changelog b/libs/libiax2/debian/changelog deleted file mode 100644 index 408f809179f044654f649b7a799b06e64109ee52..0000000000000000000000000000000000000000 --- a/libs/libiax2/debian/changelog +++ /dev/null @@ -1,6 +0,0 @@ -sflphone-iax2 (0.2.3-2ubuntu1) intrepid; urgency=low - - * Debian package - - -- Yun Liu <yun.liu@savoirfairelinux.com> Wed, 03 Dec 2008 14:40:44 -0500 - diff --git a/libs/libiax2/debian/compat b/libs/libiax2/debian/compat deleted file mode 100644 index 7ed6ff82de6bcc2a78243fc9c54d3ef5ac14da69..0000000000000000000000000000000000000000 --- a/libs/libiax2/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/libs/libiax2/debian/control b/libs/libiax2/debian/control deleted file mode 100644 index d70b8f677c9af0ea55dd0615716c9aadc9e5e623..0000000000000000000000000000000000000000 --- a/libs/libiax2/debian/control +++ /dev/null @@ -1,44 +0,0 @@ -Source: sflphone-iax2 -Priority: optional -Maintainer: Yun Liu <yun.liu@savoirfairelinux.com> -Build-Depends: debhelper (>= 5), autotools-dev -Standards-Version: 3.8.0 -Section: libs - -Package: sflphone-iax2-dev -Section: libdevel -Architecture: amd64 -Depends: libc6 (>=2.6.1-1), sflphone-iax2(>= 0.2.3) -Homepage: http://www.sflphone.org -Description: IAX2 protocol support for SFLphone - Inter Asterisk eXchange, lovingly called IAX (pronounced: eeks), is the - protocol used by the Asterisk PBX system for inter-asterisk-communication. - Other applications may use libiax to communicate with each other and - other asterisk servers. - IAX is a high performance, feature rich protocol unrelated to SIP or H.323. - Its single-socket design allows it to interoperate with NAT and - PAT masquerade firewalls. It supports internationalization, remote dialplans, - and voice, HTML, image, DTMF, and video content. - This library is needed by SFLphone to support the IAX2 protocol. - SFLphone is being developed by the global community, and maintained by - Savoir-faire Linux, a Montreal, Quebec, Canada-based Linux consulting company. - This package is only the library development files. - -Package: sflphone-iax2 -Section: libs -Architecture: amd64 -Depends: libc6 (>=2.6.1-1), ${shlibs:Depends} -Homepage: http://www.sflphone.org -Description: IAX2 protocol support for SFLphone - Inter Asterisk eXchange, lovingly called IAX (pronounced: eeks), is the - protocol used by the Asterisk PBX system for inter-asterisk-communication. - Other applications may use libiax to communicate with each other and - other asterisk servers. - IAX is a high performance, feature rich protocol unrelated to SIP or H.323. - Its single-socket design allows it to interoperate with NAT and - PAT masquerade firewalls. It supports internationalization, remote dialplans, - and voice, HTML, image, DTMF, and video content. - This library is needed by SFLphone to support the IAX2 protocol. - SFLphone is being developed by the global community, and maintained by - Savoir-faire Linux, a Montreal, Quebec, Canada-based Linux consulting company. - This package is only the library files. diff --git a/libs/libiax2/debian/copyright b/libs/libiax2/debian/copyright deleted file mode 100644 index 573535600fca5c7135d26927434600ecefd5ad52..0000000000000000000000000000000000000000 --- a/libs/libiax2/debian/copyright +++ /dev/null @@ -1,28 +0,0 @@ -This package was debianized by Yun Liu <yun.liu@savoirfairelinux.com> on -Wed, 03 Dec 2008 14:40:44 -0500. - -It was downloaded from: http://www.asterisk.org - -Upstream Author: Mark Spencer <markster@linux-support.net> - -Copyright Holder: Mark Spencer <markster@linux-support.net> - -License from the README file: - -libiax: An implementation of the Inter-Asterisk eXchange protocol distributed -under the terms of the GNU Lesser General Public License - -The following files are marked as being released under the LGPL: - src/frame.h - src/iax.c - -The following files are marked as being released under the GPL: - src/iax.h - src/iaxclient.h - -The following files are in the public domain: - src/md5.c - src/md5.h - -On Debian systems, the complete text of the licenses can be found in the -/usr/share/common-licenses/LGPL and /usr/share/common-licenses/GPL files. diff --git a/libs/libiax2/debian/docs b/libs/libiax2/debian/docs deleted file mode 100644 index eb9b151cc884877495df75b49ed1b6598646328c..0000000000000000000000000000000000000000 --- a/libs/libiax2/debian/docs +++ /dev/null @@ -1,3 +0,0 @@ -NEWS -README -AUTHORS diff --git a/libs/libiax2/debian/rules b/libs/libiax2/debian/rules deleted file mode 100755 index 009c44a737ec878907fea5d3b03d799be7dda154..0000000000000000000000000000000000000000 --- a/libs/libiax2/debian/rules +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - - -# These are used for cross-compiling and for saving the configure script -# from having to guess our platform (since we know it already) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - - -# shared library versions, option 1 -version=2.0.5 -major=2 -# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so -#version=`ls src/.libs/lib*.so.* | \ -# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` -#major=`ls src/.libs/lib*.so.* | \ -# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` - -config.status: configure - dh_testdir - # Add here commands to configure the package. -ifneq "$(wildcard /usr/share/misc/config.sub)" "" - cp -f /usr/share/misc/config.sub config.sub -endif -ifneq "$(wildcard /usr/share/misc/config.guess)" "" - cp -f /usr/share/misc/config.guess config.guess -endif - ./bootstrap.sh - ./configure --prefix=/usr --enable-newjb - -build: build-stamp -build-stamp: config.status - dh_testdir - - # Add here commands to compile the package. - $(MAKE) - - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp - - # Add here commands to clean up after the build process. - [ ! -f Makefile ] || $(MAKE) distclean - rm -f config.sub config.guess - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/tmp - $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs ChangeLog - dh_installdocs - dh_installexamples - dh_install --sourcedir debian/tmp -# dh_install -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl -# dh_python - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install diff --git a/libs/libiax2/debian/sflphone-iax2-dev.install b/libs/libiax2/debian/sflphone-iax2-dev.install deleted file mode 100644 index 25f03e932537815e312b381c366d52d1b33a54d2..0000000000000000000000000000000000000000 --- a/libs/libiax2/debian/sflphone-iax2-dev.install +++ /dev/null @@ -1,4 +0,0 @@ -usr/include/* -usr/lib/*.a -usr/lib/*.so -usr/lib/*.la diff --git a/libs/libiax2/debian/sflphone-iax2.install b/libs/libiax2/debian/sflphone-iax2.install deleted file mode 100644 index 0bfc1fdb18d1d52aed647ca1c36cc243e7c7b496..0000000000000000000000000000000000000000 --- a/libs/libiax2/debian/sflphone-iax2.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/*.so.* -usr/bin/* diff --git a/libs/libiax2/debian/shlibs.local b/libs/libiax2/debian/shlibs.local deleted file mode 100644 index 50b1f00b0e195d709197808bf1da4404593661cc..0000000000000000000000000000000000000000 --- a/libs/libiax2/debian/shlibs.local +++ /dev/null @@ -1 +0,0 @@ -libsflphone-iax2 0.2.3 sflphone-iax2 (>> 0.2.3-0), sflphone-iax2 (<< 0.2.3-99) diff --git a/libs/libiax2/depcomp b/libs/libiax2/depcomp deleted file mode 120000 index 73994f3c0ee9fd96c8cfe36c76746b1183bdddd7..0000000000000000000000000000000000000000 --- a/libs/libiax2/depcomp +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.9/depcomp \ No newline at end of file diff --git a/libs/libiax2/doc/Doxyfile-fullsource b/libs/libiax2/doc/Doxyfile-fullsource deleted file mode 100644 index 9727eade64acd8de939d149cc5dc990a6b14d87e..0000000000000000000000000000000000000000 --- a/libs/libiax2/doc/Doxyfile-fullsource +++ /dev/null @@ -1,1234 +0,0 @@ -# Doxyfile 1.4.4 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = "libiax2" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doc - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, -# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, -# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, -# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, -# Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = YES - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO -EXTRACT_LOCAL_METHODS = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is YES. - -SHOW_DIRECTORIES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via -# popen()) the command <command> <input-file>, where <command> is the value of -# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file -# provided by doxygen. Whatever the progam writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = src - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command <filter> <input-file>, where <filter> -# is the value of the INPUT_FILTER tag, and <input-file> is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = *.cpp *.inl - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO -#FILTER_SOURCE_FILES = YES - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO -INLINE_SOURCES = YES - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = NO - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_PREDEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = *.h *.hpp - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 1024 - -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that a graph may be further truncated if the graph's -# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH -# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), -# the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, which results in a white background. -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/libs/libiax2/gen.sh b/libs/libiax2/gen.sh deleted file mode 100755 index e22d8f797b944bd8c1f31c14fb9b390e9b4944b7..0000000000000000000000000000000000000000 --- a/libs/libiax2/gen.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# -# Run this to generate a new configure script and such :) -# -# -- Rob -# - - -(libtoolize --version) < /dev/null > /dev/null 2>&1 || { - echo; - echo "You must have libtool installed to compile libiax"; - echo; - exit; -} - -autoreconf -vifs diff --git a/libs/libiax2/iax.spec.in b/libs/libiax2/iax.spec.in deleted file mode 100644 index 1fc057d83cd1a467e602bf3d56804a1498449673..0000000000000000000000000000000000000000 --- a/libs/libiax2/iax.spec.in +++ /dev/null @@ -1,91 +0,0 @@ -%define name @PACKAGE@ -%define version @VERSION@ -%define release 1 -%define prefix /usr - -Summary: IAX (Inter Asterisk eXchange) Library -Name: %{name} -Version: %{version} -Release: %{release} -Copyright: LGPL -Group: Development/Libraries -Source: %{name}-%{version}.tar.gz -URL: http://www.linux-support.net/ -Distribution: RedHat Linux -Vendor: Linux Support Services -Packager: Rob Flynn <rob@linux-support.net> -BuildRoot: /var/tmp/%{name}-%{version}-root - -%description -Inter Asterisk eXchange, lovingly called IAX (pronounced: eeks), is the protocol used by the Asterisk PBX -system for inter-asterisk-communication. Other applications may use libiax to communicate with each other -and other asterisk servers. IAX is a high performance, feature rich protocol unrelated -to SIP or H.323. Its single-socket design allows it to interoperate with NAT and PAT -masquerade firewalls. It supports internationalization, remote dialplans, -and voice, HTML, image, DTMF, and video content. For more information see -http://www.gnophone.com. - -%package devel -Summary: IAX (Inter Asterisk eXchange) Development Package -Group: Development/Libraries -Requires: iax - -%description devel -Inter Asterisk eXchange, lovingly called IAX (pronounced: eeks), is the protocol used by the Asterisk PBX -system for inter-asterisk-communication. Other applications may use libiax to communicate with each other -and other asterisk servers. IAX is a high performance, feature rich protocol unrelated -to SIP or H.323. Its single-socket design allows it to interoperate with NAT and PAT -masquerade firewalls. It supports internationalization, remote dialplans, -and voice, HTML, image, DTMF, and video content. For more information see -http://www.gnophone.com. - -This package contains all of the development files that you will need in order to compile IAX applications. - -%prep - -%setup - -%build -CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --enable-autoupdate -make - -%install -rm -rf $RPM_BUILD_ROOT -make prefix=$RPM_BUILD_ROOT%{prefix} install-strip - -%files -%defattr(-,root,root) -%doc NEWS COPYING AUTHORS README -%{prefix}/lib - -%files devel -%defattr(-,root,root) -%{prefix}/include/iax -%{prefix}/bin/* - -%clean -rm -r $RPM_BUILD_ROOT - -%changelog -* Tue Nov 13 2001 Rob Flynn <rob@linux-support.net> (0.2.2 release) -- HTML Unlink requests -- HTML Reject link requests -- Text frames - -* Sat Oct 20 2001 Rob Flynn <rob@linux-support.net> (0.2.1 release) -- More space for challenge in IAX -- Fixed strncpy security bug -- Accept larger packets -- Handle out of order packets better -- Implemented send_url -- Added an iax-config script :-) - -* Wed Oct 10 2001 Rob Flynn <rob@linux-support.net> (0.2.0 release) -- Initial public release - -%post - -%preun - -%postun - diff --git a/libs/libiax2/iax2-config.in b/libs/libiax2/iax2-config.in deleted file mode 100644 index 295e69a97b706bb34ce8a97b870708222643fc55..0000000000000000000000000000000000000000 --- a/libs/libiax2/iax2-config.in +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -prefix=@prefix@ -exec_prefix=@exec_prefix@ -exec_prefix_set=no - -iax_libs="-L$prefix -liax2" -iax_cflags="" - -usage="\ -Usage: iax2-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]" - -if test $# -eq 0; then - echo "${usage}" 1>&2 - exit 1 -fi - -while test $# -gt 0; do - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - case $1 in - --prefix=*) - prefix=$optarg - if test $exec_prefix_set = no ; then - exec_prefix=$optarg - fi - ;; - --prefix) - echo $prefix - ;; - --exec-prefix=*) - exec_prefix=$optarg - exec_prefix_set=yes - ;; - --exec-prefix) - echo $exec_prefix - ;; - --version) - echo @VERSION@ - ;; - --cflags) -# if test ${prefix}/include/iax != /usr/include/iax ; then - includes=-I${prefix}/include/iax - for i in $iax_cflags ; do - if test $i = -I${prefix}/include ; then - includes="" - fi - done -# fi - echo $includes $iax_cflags - ;; - --libs) - my_iax_libs= - libdirs=-L${exec_prefix}/lib - for i in $iax_libs ; do - if test $i != -L${exec_prefix}/lib ; then - if test -z "$my_iax_libs" ; then - my_iax_libs="$i" - else - my_iax_libs="$my_iax_libs $i" - fi - fi - done - echo $libdirs $my_iax_libs - ;; - *) - echo "${usage}" 1>&2 - exit 1 - ;; - esac - shift -done diff --git a/libs/libiax2/install-sh b/libs/libiax2/install-sh deleted file mode 120000 index 50f91a41409b4f7fd323c68d49125ef1c516c6d0..0000000000000000000000000000000000000000 --- a/libs/libiax2/install-sh +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.9/install-sh \ No newline at end of file diff --git a/libs/libiax2/missing b/libs/libiax2/missing deleted file mode 120000 index 0ba95d1b1c424d1a70b11b662138360d4f3d5c0a..0000000000000000000000000000000000000000 --- a/libs/libiax2/missing +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.9/missing \ No newline at end of file diff --git a/libs/libiax2/mkinstalldirs b/libs/libiax2/mkinstalldirs deleted file mode 120000 index 5285bc2cc8f46cd5fba83f36a53e6abc9cb15b0f..0000000000000000000000000000000000000000 --- a/libs/libiax2/mkinstalldirs +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.9/mkinstalldirs \ No newline at end of file diff --git a/libs/libiax2/src/Makefile.am b/libs/libiax2/src/Makefile.am deleted file mode 100644 index 086fbd3659ac04aa984b8928d493af7633effc21..0000000000000000000000000000000000000000 --- a/libs/libiax2/src/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -AM_CFLAGS = -Wall -O2 -AM_CFLAGS += -g -Wall -Wstrict-prototypes -I . -AM_CFLAGS += -DLIBIAX -AM_CFLAGS += -fsigned-char -# -DDEBUG_SUPPORT (doesn't compile with it) -# -DDEBUG_DEFAULT -AM_CFLAGS += $(UCFLAGS) - - -pkgdir = $(libdir) -pkg_LTLIBRARIES=libiax2.la -libiax2_la_SOURCES = iax2-parser.c iax.c md5.c jitterbuf.c -EXTRA_DIST = md5.h frame.h iax-client.h iax2.h iax2-parser.h jitterbuf.h - -install-data-local: - mkdir -p $(DESTDIR)$(includedir)/iax2 - install -m 644 md5.h $(DESTDIR)$(includedir)/iax2 - install -m 644 frame.h $(DESTDIR)$(includedir)/iax2 - install -m 644 iax.h $(DESTDIR)$(includedir)/iax2 - install -m 644 iax2.h $(DESTDIR)$(includedir)/iax2 - install -m 644 iax2-parser.h $(DESTDIR)$(includedir)/iax2 - install -m 644 iax-client.h $(DESTDIR)$(includedir)/iax2 - -uninstall-local: - rm -rf $(DESTDIR)$(includedir)/iax2 diff --git a/libs/pjproject-1.0.1/pjsip-apps/bin/samples/confsample-i686-pc-linux-gnu b/libs/pjproject-1.0.1/pjsip-apps/bin/samples/confsample-i686-pc-linux-gnu index 69228a0150eccef2f0903e71feeef7d177f5cffd..0e7002d55e3c5b2ae15daa725f614ea33efa804a 100755 Binary files a/libs/pjproject-1.0.1/pjsip-apps/bin/samples/confsample-i686-pc-linux-gnu and b/libs/pjproject-1.0.1/pjsip-apps/bin/samples/confsample-i686-pc-linux-gnu differ diff --git a/libs/stund/Stun.sln b/libs/stund/Stun.sln deleted file mode 100644 index b2977f58af4ffbdf307fde74427eebf1ba3dc18d..0000000000000000000000000000000000000000 --- a/libs/stund/Stun.sln +++ /dev/null @@ -1,38 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinStun", "WinStun\WinStun.vcproj", "{717021E7-DCC4-41E7-9CDA-FA7596F18C56}" -EndProject -Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "WinStunSetup", "WinStunSetup\WinStunSetup.vdproj", "{EB812030-9F2E-4FB7-813D-2E99AE2C5E4E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "client.vcproj", "{76E56991-C964-444B-82A6-AFDA5145E18A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "server.vcproj", "{2011B7B6-6932-431D-83A3-E825A271F8A8}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {717021E7-DCC4-41E7-9CDA-FA7596F18C56}.Debug.ActiveCfg = Debug|Win32 - {717021E7-DCC4-41E7-9CDA-FA7596F18C56}.Debug.Build.0 = Debug|Win32 - {717021E7-DCC4-41E7-9CDA-FA7596F18C56}.Release.ActiveCfg = Release|Win32 - {717021E7-DCC4-41E7-9CDA-FA7596F18C56}.Release.Build.0 = Release|Win32 - {EB812030-9F2E-4FB7-813D-2E99AE2C5E4E}.Debug.ActiveCfg = Debug - {EB812030-9F2E-4FB7-813D-2E99AE2C5E4E}.Release.ActiveCfg = Release - {EB812030-9F2E-4FB7-813D-2E99AE2C5E4E}.Release.Build.0 = Release - {76E56991-C964-444B-82A6-AFDA5145E18A}.Debug.ActiveCfg = Debug|Win32 - {76E56991-C964-444B-82A6-AFDA5145E18A}.Debug.Build.0 = Debug|Win32 - {76E56991-C964-444B-82A6-AFDA5145E18A}.Release.ActiveCfg = Release|Win32 - {76E56991-C964-444B-82A6-AFDA5145E18A}.Release.Build.0 = Release|Win32 - {2011B7B6-6932-431D-83A3-E825A271F8A8}.Debug.ActiveCfg = Debug|Win32 - {2011B7B6-6932-431D-83A3-E825A271F8A8}.Debug.Build.0 = Debug|Win32 - {2011B7B6-6932-431D-83A3-E825A271F8A8}.Release.ActiveCfg = Release|Win32 - {2011B7B6-6932-431D-83A3-E825A271F8A8}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/libs/stund/WinStun/WinStun.cpp b/libs/stund/WinStun/WinStun.cpp deleted file mode 100644 index e5bdc3bf9d15760468ebaafd18684e3a62cd8907..0000000000000000000000000000000000000000 --- a/libs/stund/WinStun/WinStun.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// WinStun.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" -#include "WinStun.h" -#include "WinStunDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#endif - - -// CWinStunApp - -BEGIN_MESSAGE_MAP(CWinStunApp, CWinApp) - ON_COMMAND(ID_HELP, CWinApp::OnHelp) -END_MESSAGE_MAP() - - -// CWinStunApp construction - -CWinStunApp::CWinStunApp() -{ - // TODO: add construction code here, - // Place all significant initialization in InitInstance -} - - -// The one and only CWinStunApp object - -CWinStunApp theApp; - - -// CWinStunApp initialization - -BOOL CWinStunApp::InitInstance() -{ - // InitCommonControls() is required on Windows XP if an application - // manifest specifies use of ComCtl32.dll version 6 or later to enable - // visual styles. Otherwise, any window creation will fail. - InitCommonControls(); - - CWinApp::InitInstance(); - - if (!AfxSocketInit()) - { - AfxMessageBox(IDP_SOCKETS_INIT_FAILED); - return FALSE; - } - - AfxEnableControlContainer(); - - - CWinStunDlg dlg; - m_pMainWnd = &dlg; - INT_PTR nResponse = dlg.DoModal(); - - if (nResponse == IDCANCEL) - { - // TODO: Place code here to handle when the dialog is - // dismissed with Cancel - } - - // Since the dialog has been closed, return FALSE so that we exit the - // application, rather than start the application's message pump. - return FALSE; -} diff --git a/libs/stund/WinStun/WinStun.h b/libs/stund/WinStun/WinStun.h deleted file mode 100644 index 34a36db1521e4dad9182fb717c0c62fdca9e0e40..0000000000000000000000000000000000000000 --- a/libs/stund/WinStun/WinStun.h +++ /dev/null @@ -1,31 +0,0 @@ -// WinStun.h : main header file for the PROJECT_NAME application -// - -#pragma once - -#ifndef __AFXWIN_H__ - #error include 'stdafx.h' before including this file for PCH -#endif - -#include "resource.h" // main symbols - - -// CWinStunApp: -// See WinStun.cpp for the implementation of this class -// - -class CWinStunApp : public CWinApp -{ -public: - CWinStunApp(); - -// Overrides - public: - virtual BOOL InitInstance(); - -// Implementation - - DECLARE_MESSAGE_MAP() -}; - -extern CWinStunApp theApp; \ No newline at end of file diff --git a/libs/stund/WinStun/WinStun.rc b/libs/stund/WinStun/WinStun.rc deleted file mode 100644 index 56c1757bf173ca40f2fb86f54ea71ae4cc5d3286..0000000000000000000000000000000000000000 --- a/libs/stund/WinStun/WinStun.rc +++ /dev/null @@ -1,210 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#include ""res\\WinStun.rc2"" // non-Microsoft Visual C++ edited resources\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON "res\\WinStun.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "About WinStun" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 - LTEXT "WinStun Version 0.92",IDC_STATIC,40,10,119,8, - SS_NOPREFIX - LTEXT "Cullen Jennings",IDC_STATIC,40,25,119,8 - DEFPUSHBUTTON "OK",IDOK,178,7,50,16,WS_GROUP -END - -IDD_WINSTUN_DIALOG DIALOGEX 0, 0, 209, 129 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | - WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_APPWINDOW -CAPTION "WinStun" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - PUSHBUTTON "Quit",IDCANCEL,116,106,50,16 - PUSHBUTTON "Run Test",IDC_TEST,19,108,50,14 - LTEXT "Stun Server",IDC_STATIC,7,7,39,8 - EDITTEXT IDC_SERVER,48,7,142,12,ES_AUTOHSCROLL - EDITTEXT IDC_RESULT,7,24,190,77,ES_MULTILINE | ES_AUTOVSCROLL | - ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP, - WS_EX_STATICEDGE -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,92,0,0 - PRODUCTVERSION 0,92,0,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904e4" - BEGIN - VALUE "FileDescription", "STUN Client" - VALUE "FileVersion", "0, 92, 0, 0" - VALUE "InternalName", "WinStun.exe" - VALUE "OriginalFilename", "WinStun.exe" - VALUE "ProductName", "WinStun" - VALUE "ProductVersion", "0.92.0.0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_ABOUTBOX, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 228 - TOPMARGIN, 7 - BOTTOMMARGIN, 48 - END - - IDD_WINSTUN_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 202 - TOPMARGIN, 7 - BOTTOMMARGIN, 122 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// RT_MANIFEST -// - -IDR_MANIFEST RT_MANIFEST "res\\WinStun.manifest" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_ABOUTBOX "&About WinStun..." - IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed." -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE 9, 1 -#pragma code_page(1252) -#include "res\WinStun.rc2" // non-Microsoft Visual C++ edited resources -#include "afxres.rc" // Standard components -#endif - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/libs/stund/WinStun/WinStun.vcproj b/libs/stund/WinStun/WinStun.vcproj deleted file mode 100644 index 8d0f05e0722e3edddc6c1df690cb1cd1742b7644..0000000000000000000000000000000000000000 --- a/libs/stund/WinStun/WinStun.vcproj +++ /dev/null @@ -1,186 +0,0 @@ -<?xml version="1.0" encoding = "Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7.00" - Name="WinStun" - ProjectGUID="{717021E7-DCC4-41E7-9CDA-FA7596F18C56}" - Keyword="MFCProj"> - <Platforms> - <Platform - Name="Win32"/> - </Platforms> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="Debug" - IntermediateDirectory="Debug" - ConfigurationType="1" - UseOfMFC="2" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG" - MinimalRebuild="TRUE" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - TreatWChar_tAsBuiltInType="TRUE" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="FALSE" - DebugInformationFormat="4"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - GenerateDebugInformation="TRUE" - SubSystem="2" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="_DEBUG" - MkTypLibCompatible="FALSE"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - AdditionalIncludeDirectories="$(IntDir)"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="Release" - IntermediateDirectory="Release" - ConfigurationType="1" - UseOfMFC="2" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - OmitFramePointers="TRUE" - PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG" - StringPooling="TRUE" - MinimalRebuild="FALSE" - RuntimeLibrary="2" - EnableFunctionLevelLinking="TRUE" - TreatWChar_tAsBuiltInType="TRUE" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="FALSE" - DebugInformationFormat="3"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - GenerateDebugInformation="TRUE" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="NDEBUG" - MkTypLibCompatible="FALSE"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - AdditionalIncludeDirectories="$(IntDir)"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - </Configuration> - </Configurations> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> - <File - RelativePath="WinStun.cpp"> - </File> - <File - RelativePath="WinStunDlg.cpp"> - </File> - <File - RelativePath="stdafx.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - UsePrecompiledHeader="1"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - UsePrecompiledHeader="1"/> - </FileConfiguration> - </File> - <File - RelativePath="..\stun.cxx"> - </File> - <File - RelativePath="..\udp.cxx"> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc"> - <File - RelativePath="Resource.h"> - </File> - <File - RelativePath="WinStun.h"> - </File> - <File - RelativePath="WinStunDlg.h"> - </File> - <File - RelativePath="stdafx.h"> - </File> - <File - RelativePath="..\stun.h"> - </File> - <File - RelativePath="..\udp.h"> - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest"> - <File - RelativePath="res\WinStun.ico"> - </File> - <File - RelativePath="res\WinStun.manifest"> - </File> - <File - RelativePath="WinStun.rc"> - </File> - <File - RelativePath="res\WinStun.rc2"> - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/libs/stund/WinStun/WinStunDlg.cpp b/libs/stund/WinStun/WinStunDlg.cpp deleted file mode 100644 index 19507aa3c14421514403558719c5d46d2a13dbba..0000000000000000000000000000000000000000 --- a/libs/stund/WinStun/WinStunDlg.cpp +++ /dev/null @@ -1,246 +0,0 @@ - -#include "stdafx.h" -#include "WinStun.h" -#include "WinStunDlg.h" - -#include <cassert> - -#include "../stun.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#endif - - -// CAboutDlg dialog used for App About - -class CAboutDlg : public CDialog -{ -public: - CAboutDlg(); - -// Dialog Data - enum { IDD = IDD_ABOUTBOX }; - - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - -// Implementation -protected: - DECLARE_MESSAGE_MAP() -}; - -CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) -{ -} - -void CAboutDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); -} - -BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) -END_MESSAGE_MAP() - - -// CWinStunDlg dialog - - - -CWinStunDlg::CWinStunDlg(CWnd* pParent /*=NULL*/) - : CDialog(CWinStunDlg::IDD, pParent) - , mServerName(_T("")) -{ - m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); -} - -void CWinStunDlg::DoDataExchange(CDataExchange* pDX) -{ - mServerName = _T("larry.gloo.net"); - CDialog::DoDataExchange(pDX); - DDX_Text(pDX, IDC_SERVER, mServerName); - DDV_MaxChars(pDX, mServerName, 128); -} - -BEGIN_MESSAGE_MAP(CWinStunDlg, CDialog) - ON_WM_SYSCOMMAND() - ON_WM_PAINT() - ON_WM_QUERYDRAGICON() - //}}AFX_MSG_MAP - ON_BN_CLICKED(IDC_TEST, OnBnClickedTest) -END_MESSAGE_MAP() - - -// CWinStunDlg message handlers - -BOOL CWinStunDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - // Add "About..." menu item to system menu. - - // IDM_ABOUTBOX must be in the system command range. - ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); - ASSERT(IDM_ABOUTBOX < 0xF000); - - CMenu* pSysMenu = GetSystemMenu(FALSE); - if (pSysMenu != NULL) - { - CString strAboutMenu; - strAboutMenu.LoadString(IDS_ABOUTBOX); - if (!strAboutMenu.IsEmpty()) - { - pSysMenu->AppendMenu(MF_SEPARATOR); - pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); - } - } - - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon(m_hIcon, TRUE); // Set big icon - SetIcon(m_hIcon, FALSE); // Set small icon - - // TODO: Add extra initialization here - - return TRUE; // return TRUE unless you set the focus to a control -} - -void CWinStunDlg::OnSysCommand(UINT nID, LPARAM lParam) -{ - if ((nID & 0xFFF0) == IDM_ABOUTBOX) - { - CAboutDlg dlgAbout; - dlgAbout.DoModal(); - } - else - { - CDialog::OnSysCommand(nID, lParam); - } -} - -// If you add a minimize button to your dialog, you will need the code below -// to draw the icon. For MFC applications using the document/view model, -// this is automatically done for you by the framework. - -void CWinStunDlg::OnPaint() -{ - if (IsIconic()) - { - CPaintDC dc(this); // device context for painting - - SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0); - - // Center icon in client rectangle - int cxIcon = GetSystemMetrics(SM_CXICON); - int cyIcon = GetSystemMetrics(SM_CYICON); - CRect rect; - GetClientRect(&rect); - int x = (rect.Width() - cxIcon + 1) / 2; - int y = (rect.Height() - cyIcon + 1) / 2; - - // Draw the icon - dc.DrawIcon(x, y, m_hIcon); - } - else - { - CDialog::OnPaint(); - } -} - -// The system calls this function to obtain the cursor to display while the user drags -// the minimized window. -HCURSOR CWinStunDlg::OnQueryDragIcon() -{ - return static_cast<HCURSOR>(m_hIcon); -} - -void CWinStunDlg::OnBnClickedTest() -{ - // TODO: Add your control notification handler code here - CString& server = mServerName; - - CEdit* display = (CEdit*)GetDlgItem(IDC_RESULT); - assert(display); - display->SetWindowText( CString( _T("Running...\r\n")) ); - - CEdit* edit = (CEdit*)GetDlgItem(IDC_SERVER); - assert(edit); - edit->GetWindowText(server); - - StunAddress4 stunServerAddr; - - LPCTSTR str; - str = server; - char* s; - s = (char*)str; - stunParseServerName( s, stunServerAddr); - - bool verbose = false; - StunAddress4 sAddr; - sAddr.port = 0; - sAddr.addr = 0; - bool preservePort; - bool hairpin; - int port=0; - NatType stype = stunNatType( stunServerAddr, verbose, &preservePort, &hairpin, port, &sAddr ); - - CString text; - - switch (stype) - { - case StunTypeOpen: - text = _T("No NAT detected - VoIP should work"); - break; - case StunTypeConeNat: - text = _T("Cone Nat detect - VoIP will work with STUN"); - break; - case StunTypeRestrictedNat: - text = _T("Address restricted NAT detected - VoIP will work with STUN"); - break; - case StunTypePortRestrictedNat: - text = _T("Port restricted NAT detected - VoIP will work with STUN"); - break; - case StunTypeSymNat: - text = _T("Symetric - VOIP will NOT work"); - break; - case StunTypeSymFirewall: - text = _T("Symetric firewall - VOIP will NOT work"); - break; - case StunTypeBlocked: - text = _T("Could not reach the stun server - check server name is correct"); - break; - default: - text = _T("Unkown NAT type"); - break; - } - - text += _T("\r\n"); - - if (preservePort) - { - text+= _T("Preserves port number\r\n"); - } - else - { - text+= _T("Does not preserve port number\r\n"); - } - - if (hairpin) - { - text+= _T("Supports hairpin of media\r\n"); - } - else - { - text+= _T("Does not supports hairpin of media\r\n"); - } - - - CString strAddr; - strAddr.Format(_T("Public IP address: %d.%d.%d.%d"), - (sAddr.addr>>24)&0xFF,(sAddr.addr>>16)&0xFF,(sAddr.addr>>8)&0xFF,(sAddr.addr>>0)&0xFF - ); - - text += strAddr; - - display->SetWindowText( text + CString( _T("\r\n")) ); -} diff --git a/libs/stund/WinStun/WinStunDlg.h b/libs/stund/WinStun/WinStunDlg.h deleted file mode 100644 index 368d26018884eef176e2a9326e1b6a19a38807d8..0000000000000000000000000000000000000000 --- a/libs/stund/WinStun/WinStunDlg.h +++ /dev/null @@ -1,35 +0,0 @@ -// WinStunDlg.h : header file -// - -#pragma once - - -// CWinStunDlg dialog -class CWinStunDlg : public CDialog -{ -// Construction -public: - CWinStunDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - enum { IDD = IDD_WINSTUN_DIALOG }; - - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - -// Implementation -protected: - HICON m_hIcon; - - // Generated message map functions - virtual BOOL OnInitDialog(); - afx_msg void OnSysCommand(UINT nID, LPARAM lParam); - afx_msg void OnPaint(); - afx_msg HCURSOR OnQueryDragIcon(); - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnBnClickedTest(); - // the name of the stun server to use - CString mServerName; -}; diff --git a/libs/stund/WinStun/res/WinStun.ico b/libs/stund/WinStun/res/WinStun.ico deleted file mode 100644 index c920902960a34a21a46c5335471a847e43dedbfe..0000000000000000000000000000000000000000 Binary files a/libs/stund/WinStun/res/WinStun.ico and /dev/null differ diff --git a/libs/stund/WinStun/res/WinStun.manifest b/libs/stund/WinStun/res/WinStun.manifest deleted file mode 100644 index 39ecae9fe14e7a8eb48d4819e39a7bdd824170c8..0000000000000000000000000000000000000000 --- a/libs/stund/WinStun/res/WinStun.manifest +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="1.0.0.0" - processorArchitecture="X86" - name="Microsoft.Windows.WinStun" - type="win32" -/> -<description>Your app description here</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="X86" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> diff --git a/libs/stund/WinStun/res/WinStun.rc2 b/libs/stund/WinStun/res/WinStun.rc2 deleted file mode 100644 index 345909a79d5e75eb0611cf8a94ba33dfb2990057..0000000000000000000000000000000000000000 --- a/libs/stund/WinStun/res/WinStun.rc2 +++ /dev/null @@ -1,13 +0,0 @@ -// -// WinStun.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED -#error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... - -///////////////////////////////////////////////////////////////////////////// diff --git a/libs/stund/WinStun/resource.h b/libs/stund/WinStun/resource.h deleted file mode 100644 index 9a333540d8d59c1c2adbe6f36a568682848fffe5..0000000000000000000000000000000000000000 --- a/libs/stund/WinStun/resource.h +++ /dev/null @@ -1,26 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by WinStun.rc -// -#define IDR_MANIFEST 1 -#define IDM_ABOUTBOX 0x0010 -#define IDD_ABOUTBOX 100 -#define IDS_ABOUTBOX 101 -#define IDD_WINSTUN_DIALOG 102 -#define IDP_SOCKETS_INIT_FAILED 103 -#define IDR_MAINFRAME 128 -#define IDC_TEST 1000 -#define IDC_SERVER 1001 -#define IDC_EDIT2 1002 -#define IDC_RESULT 1002 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 129 -#define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1003 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/libs/stund/WinStun/stdafx.cpp b/libs/stund/WinStun/stdafx.cpp deleted file mode 100644 index e20fa31c57dc4bb29151be8c207bb2411c26372a..0000000000000000000000000000000000000000 --- a/libs/stund/WinStun/stdafx.cpp +++ /dev/null @@ -1,7 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// WinStun.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - - diff --git a/libs/stund/WinStun/stdafx.h b/libs/stund/WinStun/stdafx.h deleted file mode 100644 index 69dcbe280db7867b1ae49fe6132869a79d84fc95..0000000000000000000000000000000000000000 --- a/libs/stund/WinStun/stdafx.h +++ /dev/null @@ -1,43 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently - -#pragma once - -#ifndef VC_EXTRALEAN -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#endif - -// Modify the following defines if you have to target a platform prior to the ones specified below. -// Refer to MSDN for the latest info on corresponding values for different platforms. -#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later. -#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. -#endif - -#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. -#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. -#endif - -#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. -#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. -#endif - -#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later. -#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later. -#endif - -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit - -// turns off MFC's hiding of some common and often safely ignored warning messages -#define _AFX_ALL_WARNINGS - -#include <afxwin.h> // MFC core and standard components -#include <afxext.h> // MFC extensions -#include <afxdisp.h> // MFC Automation classes - -#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include <afxcmn.h> // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - -#include <afxsock.h> // MFC socket extensions diff --git a/libs/stund/WinStunSetup/WinStunSetup.vdproj b/libs/stund/WinStunSetup/WinStunSetup.vdproj deleted file mode 100644 index 71023929170c7a668fa6036c3106750d5d26e365..0000000000000000000000000000000000000000 --- a/libs/stund/WinStunSetup/WinStunSetup.vdproj +++ /dev/null @@ -1,797 +0,0 @@ -"DeployProject" -{ -"VSVersion" = "3:700" -"ProjectType" = "8:{5443560c-dbb4-11d2-8724-00a0c9a8b90c}" -"IsWebType" = "8:FALSE" -"ProjectName" = "8:WinStunSetup" -"LanguageId" = "3:1033" -"CodePage" = "3:1252" -"UILanguageId" = "3:1033" -"SccProjectName" = "8:" -"SccLocalPath" = "8:" -"SccAuxPath" = "8:" -"SccProvider" = "8:" - "Hierarchy" - { - "Entry" - { - "MsmKey" = "8:_09250952BF7CDB5CAADD71B62AF74DB4" - "OwnerKey" = "8:_F6B936BEEBCC457AA39994BB0B8A53A5" - "MsmSig" = "8:C:\\WINDOWS\\SYSTEM32\\WSOCK32.DLL" - } - "Entry" - { - "MsmKey" = "8:_18DB37B1E06F4ECDBE22138D2E3423BA" - "OwnerKey" = "8:_F6B936BEEBCC457AA39994BB0B8A53A5" - "MsmSig" = "8:VC_User_MFC.BA9B6D6E_0DE0_11D5_A548_0090278A1BB8" - } - "Entry" - { - "MsmKey" = "8:_4B317DFBE5B54D45BA632D40E0B2978C" - "OwnerKey" = "8:_F6B936BEEBCC457AA39994BB0B8A53A5" - "MsmSig" = "8:VC_User_STL.BA9B76E9_0DE0_11D5_A548_0090278A1BB8" - } - "Entry" - { - "MsmKey" = "8:_4D3B42BBD8694AA0A7E8B8681774E515" - "OwnerKey" = "8:_F6B936BEEBCC457AA39994BB0B8A53A5" - "MsmSig" = "8:VC_User_CRT.BA9B6D09_0DE0_11D5_A548_0090278A1BB8" - } - "Entry" - { - "MsmKey" = "8:_F6B936BEEBCC457AA39994BB0B8A53A5" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:C:\\VOCAL\\STUND\\WINSTUN\\DEBUG\\WINSTUN.EXE" - } - } - "Configurations" - { - "Debug" - { - "DisplayName" = "8:Debug" - "IsDebugOnly" = "11:TRUE" - "IsReleaseOnly" = "11:FALSE" - "OutputFilename" = "8:Debug\\WinStunSetup.msi" - "PackageFilesAs" = "3:2" - "PackageFileSize" = "3:-2147483648" - "CabType" = "3:1" - "Compression" = "3:2" - "SignOutput" = "11:FALSE" - "CertificateFile" = "8:" - "PrivateKeyFile" = "8:" - "TimeStampServer" = "8:" - "InstallerBootstrapper" = "3:2" - } - "Release" - { - "DisplayName" = "8:Release" - "IsDebugOnly" = "11:FALSE" - "IsReleaseOnly" = "11:TRUE" - "OutputFilename" = "8:Release\\WinStunSetup.msi" - "PackageFilesAs" = "3:2" - "PackageFileSize" = "3:-2147483648" - "CabType" = "3:1" - "Compression" = "3:3" - "SignOutput" = "11:FALSE" - "CertificateFile" = "8:" - "PrivateKeyFile" = "8:" - "TimeStampServer" = "8:" - "InstallerBootstrapper" = "3:2" - } - } - "Deployable" - { - "CustomAction" - { - } - "DefaultFeature" - { - "Name" = "8:DefaultFeature" - "Title" = "8:" - "Description" = "8:" - } - "Feature" - { - } - "File" - { - "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_09250952BF7CDB5CAADD71B62AF74DB4" - { - "Signature" = "8:2000000000e0230e7df7c201409bc8ce88f8c30100e0230e7df7c20100000000005400000000000000000000770073006f0063006b00330032002e0064006c006c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - "SourcePath" = "8:WSOCK32.dll" - "TargetName" = "8:WSOCK32.dll" - "Tag" = "8:" - "Folder" = "8:_1ACFCA01E86242009E7DA340371B556E" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:TRUE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - } - "FileType" - { - } - "Folder" - { - "{EE62640D-12F2-11D3-8D6C-00A0C9CFCEE6}:_1ACFCA01E86242009E7DA340371B556E" - { - "DefaultLocation" = "8:[ProgramFilesFolder][Manufacturer]\\[ProductName]" - "Name" = "8:#1925" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:TARGETDIR" - "Folders" - { - } - } - "{777C097F-0ED8-11D3-8D6C-00A0C9CFCEE6}:_9F73FB694078487ABBE751685A98BAE5" - { - "Name" = "8:#1919" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:ProgramMenuFolder" - "Folders" - { - } - } - "{777C097F-0ED8-11D3-8D6C-00A0C9CFCEE6}:_CD285AFD3A9A4AF09C71F647BCB5F55F" - { - "Name" = "8:#1916" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:DesktopFolder" - "Folders" - { - } - } - } - "LaunchCondition" - { - } - "Locator" - { - } - "Shortcut" - { - "{D0C99CFE-1238-11D3-8E00-00C04F6837D0}:_9DD31FDA83A043F7A0E558517B5725D3" - { - "Name" = "8:WinSTUN" - "Arguments" = "8:" - "Description" = "8:" - "ShowCmd" = "3:1" - "IconIndex" = "3:0" - "Transitive" = "11:FALSE" - "Target" = "8:_F6B936BEEBCC457AA39994BB0B8A53A5" - "Folder" = "8:_9F73FB694078487ABBE751685A98BAE5" - "WorkingFolder" = "8:_1ACFCA01E86242009E7DA340371B556E" - "Icon" = "8:" - "Feature" = "8:" - } - } - "Sequences" - { - } - "Registry" - { - "HKLM" - { - "Keys" - { - "{7DF0CD0A-FF27-11D2-8D6B-00A0C9CFCEE6}:_40E4B8C97A03455C8DF5FA68455B929E" - { - "Name" = "8:Software" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{7DF0CD0A-FF27-11D2-8D6B-00A0C9CFCEE6}:_50DC98EDDEAB4F63A5B6A17D733642C2" - { - "Name" = "8:[Manufacturer]" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - } - } - } - "Values" - { - } - } - } - } - "HKCU" - { - "Keys" - { - "{7DF0CD0A-FF27-11D2-8D6B-00A0C9CFCEE6}:_D404EAC782F44270A6D873736C45FB23" - { - "Name" = "8:Software" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{7DF0CD0A-FF27-11D2-8D6B-00A0C9CFCEE6}:_221FC41A7DD547B182BD9DE45E0E8EB2" - { - "Name" = "8:[Manufacturer]" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - } - } - } - "Values" - { - } - } - } - } - "HKCR" - { - "Keys" - { - } - } - "HKU" - { - "Keys" - { - } - } - "HKPU" - { - "Keys" - { - } - } - } - "ProjectOutput" - { - "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_F6B936BEEBCC457AA39994BB0B8A53A5" - { - "SourcePath" = "8:..\\WinStun\\Release\\WinStun.exe" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_1ACFCA01E86242009E7DA340371B556E" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - "ProjectOutputGroupRegister" = "3:1" - "OutputConfiguration" = "8:" - "OutputGroupCanonicalName" = "8:Built" - "OutputProjectCanonicalName" = "8:WinStun\\WinStun.vcproj" - "OutputProjectGuid" = "8:{717021E7-DCC4-41E7-9CDA-FA7596F18C56}" - "ShowKeyOutput" = "11:TRUE" - "ExcludeFilters" - { - } - } - } - "Product" - { - "Name" = "8:Microsoft Visual Studio" - "ProductName" = "8:WinStun" - "ProductCode" = "8:{8B7B86B7-1FB6-4907-AD02-B5C8D480A324}" - "PackageCode" = "8:{63782D74-DA83-46E2-BBEA-C3448AAF05DA}" - "UpgradeCode" = "8:{2F0F50F5-2556-4068-8E05-1BDCCFBF66D7}" - "RestartWWWService" = "11:FALSE" - "RemovePreviousVersions" = "11:TRUE" - "DetectNewerInstalledVersion" = "11:TRUE" - "ProductVersion" = "8:0.91" - "Manufacturer" = "8:fluffy" - "ARPHELPTELEPHONE" = "8:" - "ARPHELPLINK" = "8:www.vovida.org" - "Title" = "8:WinStun" - "Subject" = "8:" - "ARPCONTACT" = "8:fluffy" - "Keywords" = "8:Stun" - "ARPCOMMENTS" = "8:Stun Test Program" - "ARPURLINFOABOUT" = "8:" - "ARPPRODUCTICON" = "8:" - "ARPIconIndex" = "3:0" - "SearchPath" = "8:" - "UseSystemSearchPath" = "11:TRUE" - } - "MsiBootstrapper" - { - "LangId" = "3:1033" - } - "MergeModule" - { - "{AC8774A4-3E09-11D3-8E14-00C04F6837D0}:_18DB37B1E06F4ECDBE22138D2E3423BA" - { - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:TRUE" - "SourcePath" = "8:vc_mfc.msm" - "ModuleSignature" = "8:VC_User_MFC.BA9B6D6E_0DE0_11D5_A548_0090278A1BB8" - "Properties" - { - "DIR_RETARGET_TARGETDIR" - { - "Name" = "8:DIR_RETARGET_TARGETDIR" - "DisplayName" = "8:Module Retargetable Folder" - "Description" = "8:" - "Type" = "3:10" - "ContextData" = "8:IsolationDir" - "Attributes" = "3:6" - "Setting" = "3:1" - "UsePlugInResources" = "11:FALSE" - } - } - "LanguageId" = "3:0" - "Exclude" = "11:FALSE" - "Folder" = "8:" - "Feature" = "8:" - "IsolateTo" = "8:" - } - "{AC8774A4-3E09-11D3-8E14-00C04F6837D0}:_4B317DFBE5B54D45BA632D40E0B2978C" - { - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:TRUE" - "SourcePath" = "8:vc_stl.msm" - "ModuleSignature" = "8:VC_User_STL.BA9B76E9_0DE0_11D5_A548_0090278A1BB8" - "Properties" - { - "DIR_RETARGET_TARGETDIR" - { - "Name" = "8:DIR_RETARGET_TARGETDIR" - "DisplayName" = "8:Module Retargetable Folder" - "Description" = "8:" - "Type" = "3:10" - "ContextData" = "8:IsolationDir" - "Attributes" = "3:6" - "Setting" = "3:1" - "UsePlugInResources" = "11:FALSE" - } - } - "LanguageId" = "3:0" - "Exclude" = "11:FALSE" - "Folder" = "8:" - "Feature" = "8:" - "IsolateTo" = "8:" - } - "{AC8774A4-3E09-11D3-8E14-00C04F6837D0}:_4D3B42BBD8694AA0A7E8B8681774E515" - { - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:TRUE" - "SourcePath" = "8:vc_crt.msm" - "ModuleSignature" = "8:VC_User_CRT.BA9B6D09_0DE0_11D5_A548_0090278A1BB8" - "Properties" - { - "DIR_RETARGET_TARGETDIR" - { - "Name" = "8:DIR_RETARGET_TARGETDIR" - "DisplayName" = "8:Module Retargetable Folder" - "Description" = "8:" - "Type" = "3:10" - "ContextData" = "8:IsolationDir" - "Attributes" = "3:6" - "Setting" = "3:1" - "UsePlugInResources" = "11:FALSE" - } - } - "LanguageId" = "3:0" - "Exclude" = "11:FALSE" - "Folder" = "8:" - "Feature" = "8:" - "IsolateTo" = "8:" - } - } - "UserInterface" - { - "{E4ECAB26-4AB7-11D3-8D78-00A0C9CFCEE6}:_309D912E287A4301B573A2B8BF79CA47" - { - "UseDynamicProperties" = "11:FALSE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdBasicDialogs.wim" - "ModuleSignature" = "8:VsdDialogs.CE4B864F_F1C1_4B85_98D4_2A2BF5FFB12B" - } - "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_3AAC016866E5446D98CAA124E4E70365" - { - "Name" = "8:#1900" - "Sequence" = "3:2" - "Attributes" = "3:1" - "Dialogs" - { - "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_6453CD704CE541EDB46A6A6F40AD5B11" - { - "Sequence" = "3:100" - "DisplayName" = "8:Welcome" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminWelcomeDlg.wid" - "ModuleSignature" = "8:VsdDialogs.E35A0E2C_F131_4B57_B946_59A1A2A8F45F" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "CopyrightWarning" - { - "Name" = "8:CopyrightWarning" - "DisplayName" = "8:#1002" - "Description" = "8:#1102" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1202" - "DefaultValue" = "8:#1202" - "UsePlugInResources" = "11:TRUE" - } - "Welcome" - { - "Name" = "8:Welcome" - "DisplayName" = "8:#1003" - "Description" = "8:#1103" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1203" - "DefaultValue" = "8:#1203" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_8866EC8182F44659BA8DB0975A01235C" - { - "Sequence" = "3:200" - "DisplayName" = "8:Installation Folder" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminFolderDlg.wid" - "ModuleSignature" = "8:VsdDialogs.2DED2424_5429_4616_A1AD_4D62837C2ADA" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_93025AA9E4EB456B92CEA130A0F3BCF4" - { - "Sequence" = "3:300" - "DisplayName" = "8:Confirm Installation" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminConfirmDlg.wid" - "ModuleSignature" = "8:VsdDialogs.FA58E60A_A1E8_4876_95FC_2AC3B5AAA5F8" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_3EA2C9B465F54D72A7DDDFCC5621F1D0" - { - "Name" = "8:#1902" - "Sequence" = "3:1" - "Attributes" = "3:3" - "Dialogs" - { - "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_16667F6AD73F471591FDCB7F4172769C" - { - "Sequence" = "3:100" - "DisplayName" = "8:Finished" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdFinishedDlg.wid" - "ModuleSignature" = "8:VsdDialogs.1DB77F5A_BA5C_4470_89B6_0B0EC07E3A10" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_91E8D85BC8534AFE80406ED50E981274" - { - "Name" = "8:#1902" - "Sequence" = "3:2" - "Attributes" = "3:3" - "Dialogs" - { - "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_8BD23B7A446C400F965A22995B56653C" - { - "Sequence" = "3:100" - "DisplayName" = "8:Finished" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminFinishedDlg.wid" - "ModuleSignature" = "8:VsdDialogs.83D22742_1B79_46f6_9A99_DF0F2BD4C077" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_A4071551ACF7452A8194ECACD3822A24" - { - "Name" = "8:#1901" - "Sequence" = "3:2" - "Attributes" = "3:2" - "Dialogs" - { - "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_487DF826178549ADAA991554EE93AC62" - { - "Sequence" = "3:100" - "DisplayName" = "8:Progress" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminProgressDlg.wid" - "ModuleSignature" = "8:VsdDialogs.EE9A1AFA_41DD_4514_B727_DF0ACA1D7389" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "ShowProgress" - { - "Name" = "8:ShowProgress" - "DisplayName" = "8:#1009" - "Description" = "8:#1109" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{E4ECAB26-4AB7-11D3-8D78-00A0C9CFCEE6}:_B77D9D04895542BC9E437226DBC206BA" - { - "UseDynamicProperties" = "11:FALSE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdUserInterface.wim" - "ModuleSignature" = "8:VsdUserInterface.524F4245_5254_5341_4C45_534153783400" - } - "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_CB82D982E7E04D1BB99B02029BFF4BB4" - { - "Name" = "8:#1900" - "Sequence" = "3:1" - "Attributes" = "3:1" - "Dialogs" - { - "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_1C9C413826E7442292BDADA01492608D" - { - "Sequence" = "3:200" - "DisplayName" = "8:Installation Folder" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdFolderDlg.wid" - "ModuleSignature" = "8:VsdDialogs.C113BC36_2532_4D45_8099_4818B1133B2F" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_9949CC0ADBD947A7B1C91226942F4FEE" - { - "Sequence" = "3:100" - "DisplayName" = "8:Welcome" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdWelcomeDlg.wid" - "ModuleSignature" = "8:VsdDialogs.68F69290_BB7C_474E_A153_6679845F3DDF" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "CopyrightWarning" - { - "Name" = "8:CopyrightWarning" - "DisplayName" = "8:#1002" - "Description" = "8:#1102" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1202" - "DefaultValue" = "8:#1202" - "UsePlugInResources" = "11:TRUE" - } - "Welcome" - { - "Name" = "8:Welcome" - "DisplayName" = "8:#1003" - "Description" = "8:#1103" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1203" - "DefaultValue" = "8:#1203" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_C35965DAA3654FD188EB3BE51C84178E" - { - "Sequence" = "3:300" - "DisplayName" = "8:Confirm Installation" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdConfirmDlg.wid" - "ModuleSignature" = "8:VsdDialogs.6DBC9783_3677_4D68_8BF5_D749558A0AC1" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{7DFFC192-4ABE-11D3-8D78-00A0C9CFCEE6}:_F18016A4BE774D76B6D7D70741C9C574" - { - "Name" = "8:#1901" - "Sequence" = "3:1" - "Attributes" = "3:2" - "Dialogs" - { - "{E4ECAB24-4AB7-11D3-8D78-00A0C9CFCEE6}:_4CBDFAD72B2541849D7DFA35D5E52B1F" - { - "Sequence" = "3:100" - "DisplayName" = "8:Progress" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdProgressDlg.wid" - "ModuleSignature" = "8:VsdDialogs.4FB12620_0D15_42D0_8677_2766FFA6923F" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "ShowProgress" - { - "Name" = "8:ShowProgress" - "DisplayName" = "8:#1009" - "Description" = "8:#1109" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - } - } -} diff --git a/libs/stund/client.cxx b/libs/stund/client.cxx deleted file mode 100644 index 87b23dfe7172c2e2d30f33aa971568126e820d33..0000000000000000000000000000000000000000 --- a/libs/stund/client.cxx +++ /dev/null @@ -1,399 +0,0 @@ -#include <cassert> -#include <cstring> -#include <iostream> -#include <cstdlib> - -#ifdef WIN32 -#include <time.h> -#else -#include <sys/time.h> -#include <sys/types.h> -#include <unistd.h> -#include <netinet/in.h> -#include <errno.h> -#endif - -#include "udp.h" -#include "stun.h" - -using namespace std; - - -void -usage() -{ - cerr << "Usage:" << endl - << " ./client stunServerHostname [testNumber] [-v] [-p srcPort] [-i nicAddr1] [-i nicAddr2] [-i nicAddr3]" << endl - << "For example, if the STUN server was larry.gloo.net, you could do:" << endl - << " ./client larry.gloo.net" << endl - << "The testNumber is just used for special tests." << endl - << " test 1 runs test 1 from the RFC. For example:" << endl - << " ./client larry.gloo.net 0" << endl << endl - << "Return Values:" << endl - << " -1 Generic Error" << endl << endl - << "low order bits (mask 0x07)" << endl - << " 0 No NAT Present (Open)" << endl - << " 1 Full Cone NAT" << endl - << " 2 Address Restricted Cone NAT" << endl - << " 3 Port Restricted Cone NAT" << endl - << " 4 Symmetric NAT" << endl - << " 5 Symmetric Firewall" << endl - << " 6 Blocked or Network Error" << endl - << "0x08 bit is set if the NAT does NOT supports hairpinning" << endl - << "0x10 bit is set if the NAT tries to preserver port numbers" << endl - << endl; -} - -#define MAX_NIC 3 - -int -main(int argc, char* argv[]) -{ - assert( sizeof(UInt8 ) == 1 ); - assert( sizeof(UInt16) == 2 ); - assert( sizeof(UInt32) == 4 ); - - initNetwork(); - - cout << "STUN client version " << STUN_VERSION << endl; - - int testNum = 0; - bool verbose = false; - - StunAddress4 stunServerAddr; - stunServerAddr.addr=0; - - int srcPort=0; - StunAddress4 sAddr[MAX_NIC]; - int retval[MAX_NIC]; - int numNic=0; - - for ( int i=0; i<MAX_NIC; i++ ) - { - sAddr[i].addr=0; - sAddr[i].port=0; - retval[i]=0; - } - - for ( int arg = 1; arg<argc; arg++ ) - { - if ( !strcmp( argv[arg] , "-v" ) ) - { - verbose = true; - } - else if ( !strcmp( argv[arg] , "-i" ) ) - { - arg++; - if ( argc <= arg ) - { - usage(); - exit(-1); - } - if ( numNic >= MAX_NIC ) - { - cerr << "Can not have more than "<< MAX_NIC <<" -i options" << endl; - usage(); - exit(-1); - } - - stunParseServerName(argv[arg], sAddr[numNic++]); - } - else if ( !strcmp( argv[arg] , "-p" ) ) - { - arg++; - if ( argc <= arg ) - { - usage(); - exit(-1); - } - srcPort = strtol( argv[arg], NULL, 10); - } - else - { - char* ptr; - int t = strtol( argv[arg], &ptr, 10 ); - if ( *ptr == 0 ) - { - // conversion worked - testNum = t; - cout << "running test number " << testNum << endl; - } - else - { - bool ret = stunParseServerName( argv[arg], stunServerAddr); - if ( ret != true ) - { - cerr << argv[arg] << " is not a valid host name " << endl; - usage(); - exit(-1); - } - } - } - } - - if ( numNic == 0 ) - { - // use default - numNic = 1; - } - - for ( int nic=0; nic<numNic; nic++ ) - { - sAddr[nic].port=srcPort; - if ( stunServerAddr.addr == 0 ) - { - usage(); - exit(-1); - } - - if (testNum==0) - { - bool presPort=false; - bool hairpin=false; - - NatType stype = stunNatType( stunServerAddr, verbose, &presPort, &hairpin, - srcPort, &sAddr[nic]); - - if ( nic == 0 ) - { - cout << "Primary: "; - } - else - { - cout << "Secondary: "; - } - - switch (stype) - { - case StunTypeFailure: - cout << "Some error detetecting NAT type"; - retval[nic] = -1; - exit(-1); - break; - case StunTypeUnknown: - cout << "Some error detetecting NAT type"; - retval[nic] = 0x07; - break; - case StunTypeOpen: - cout << "Open"; - retval[nic] = 0; - break; - case StunTypeConeNat: - cout << "Full Cone Nat"; - if ( presPort ) cout << ", preserves ports"; else cout << ", random port"; - if ( hairpin ) cout << ", will hairpin"; else cout << ", no hairpin"; - retval[nic] = 0x01; - break; - case StunTypeRestrictedNat: - cout << "Address Restricted Nat"; - if ( presPort ) cout << ", preserves ports"; else cout << ", random port"; - if ( hairpin ) cout << ", will hairpin"; else cout << ", no hairpin"; - retval[nic] = 0x02; - break; - case StunTypePortRestrictedNat: - cout << "Port Restricted Nat"; - if ( presPort ) cout << ", preserves ports"; else cout << ", random port"; - if ( hairpin ) cout << ", will hairpin"; else cout << ", no hairpin"; - retval[nic] = 0x03; - break; - case StunTypeSymNat: - cout << "Symmetric Nat"; - if ( presPort ) cout << ", preserves ports"; else cout << ", random port"; - if ( hairpin ) cout << ", will hairpin"; else cout << ", no hairpin"; - retval[nic] = 0x04; - break; - case StunTypeSymFirewall: - cout << "Symmetric Firewall"; - if ( hairpin ) cout << ", will hairpin"; else cout << ", no hairpin"; - retval[nic] = 0x05; - break; - case StunTypeBlocked: - cout << "Blocked or could not reach STUN server"; - retval[nic] = 0x06; - break; - default: - cout << stype; - cout << "Unkown NAT type"; - retval[nic] = 0x07; // Unknown NAT type - break; - } - cout << "\t"; cout.flush(); - - if (!hairpin) - { - retval[nic] |= 0x08; - } - - if (presPort) - { - retval[nic] |= 0x10; - } - } - else if (testNum==100) - { - Socket myFd = openPort(srcPort,sAddr[nic].addr,verbose); - - StunMessage req; - memset(&req, 0, sizeof(StunMessage)); - - StunAtrString username; - StunAtrString password; - username.sizeValue = 0; - password.sizeValue = 0; - - stunBuildReqSimple( &req, username, - false , false , - 0x0c ); - - char buf[STUN_MAX_MESSAGE_SIZE]; - int len = STUN_MAX_MESSAGE_SIZE; - - len = stunEncodeMessage( req, buf, len, password,verbose ); - - if ( verbose ) - { - cout << "About to send msg of len " << len - << " to " << stunServerAddr << endl; - } - - while (1) - { - for ( int i=0; i<100; i++ ) - { - sendMessage( myFd, - buf, len, - stunServerAddr.addr, - stunServerAddr.port,verbose ); - } -#ifdef WIN32 // !cj! TODO - should fix this up in windows - clock_t now = clock(); - assert( CLOCKS_PER_SEC == 1000 ); - while ( clock() <= now+10 ) { }; -#else - usleep(10*1000); -#endif - } - } - else if (testNum==-2) - { - const int numPort = 5; - int fd[numPort]; - StunAddress4 mappedAddr; - - for( int i=0; i<numPort; i++ ) - { - fd[i] = stunOpenSocket( stunServerAddr, &mappedAddr, - (srcPort==0)?0:(srcPort+i), &sAddr[nic], - verbose ); - cout << "Got port at " << mappedAddr.port << endl; - } - - for( int i=0; i<numPort; i++ ) - { - closesocket(fd[i]); - } - } - else if (testNum==-1) - { - int fd3,fd4; - StunAddress4 mappedAddr; - - bool ok = stunOpenSocketPair(stunServerAddr, - &mappedAddr, - &fd3, - &fd4, - srcPort, - &sAddr[nic], - verbose); - if ( ok ) - { - closesocket(fd3); - closesocket(fd4); - cout << "Got port pair at " << mappedAddr.port << endl; - } - else - { - cerr << "Opened a stun socket pair FAILED" << endl; - } - } - else - { - stunTest( stunServerAddr,testNum,verbose,&(sAddr[nic]) ); - } - } // end of for loop - cout << endl; - - UInt32 ret=0; - for ( int i=numNic-1; i>=0; i-- ) - { - if ( retval[i] == -1 ) - { - ret = 0xFFFFFFFF; - break; - } - ret = ret << 8; - ret = ret | ( retval[i] & 0xFF ); - } - - cout << "Return value is " << hex << "0x" << ret << dec << endl; - - return ret; -} - - -/* ==================================================================== - * The Vovida Software License, Version 1.0 - * - * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The names "VOCAL", "Vovida Open Communication Application Library", - * and "Vovida Open Communication Application Library (VOCAL)" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact vocal@vovida.org. - * - * 4. Products derived from this software may not be called "VOCAL", nor - * may "VOCAL" appear in their name, without prior written - * permission of Vovida Networks, Inc. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA - * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES - * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * ==================================================================== - * - * This software consists of voluntary contributions made by Vovida - * Networks, Inc. and many individuals on behalf of Vovida Networks, - * Inc. For more information on Vovida Networks, Inc., please see - * <http://www.vovida.org/>. - * - */ - -// Local Variables: -// mode:c++ -// c-file-style:"ellemtel" -// c-file-offsets:((case-label . +)) -// indent-tabs-mode:nil -// End: diff --git a/libs/stund/client.sln b/libs/stund/client.sln deleted file mode 100644 index 007f252883a669ad535fa4593f22e1fc559f53fa..0000000000000000000000000000000000000000 --- a/libs/stund/client.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "client.vcproj", "{76E56991-C964-444B-82A6-AFDA5145E18A}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {76E56991-C964-444B-82A6-AFDA5145E18A}.Debug.ActiveCfg = Debug|Win32 - {76E56991-C964-444B-82A6-AFDA5145E18A}.Debug.Build.0 = Debug|Win32 - {76E56991-C964-444B-82A6-AFDA5145E18A}.Release.ActiveCfg = Release|Win32 - {76E56991-C964-444B-82A6-AFDA5145E18A}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/libs/stund/client.vcproj b/libs/stund/client.vcproj deleted file mode 100644 index d9694121e69efdc4a3d033494304a0ee91d8de7d..0000000000000000000000000000000000000000 --- a/libs/stund/client.vcproj +++ /dev/null @@ -1,134 +0,0 @@ -<?xml version="1.0" encoding = "Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7.00" - Name="client" - ProjectGUID="{76E56991-C964-444B-82A6-AFDA5145E18A}" - Keyword="Win32Proj"> - <Platforms> - <Platform - Name="Win32"/> - </Platforms> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="ClientDebug" - IntermediateDirectory="ClientDebug" - ConfigurationType="1" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" - MinimalRebuild="TRUE" - BasicRuntimeChecks="3" - RuntimeLibrary="5" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="FALSE" - DebugInformationFormat="4"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="Ws2_32.lib" - OutputFile="$(OutDir)/client.exe" - LinkIncremental="2" - GenerateDebugInformation="TRUE" - ProgramDatabaseFile="$(OutDir)/client.pdb" - SubSystem="1" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="ClientRelease" - IntermediateDirectory="ClientRelease" - ConfigurationType="1" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - OmitFramePointers="TRUE" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" - StringPooling="TRUE" - RuntimeLibrary="4" - EnableFunctionLevelLinking="TRUE" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="FALSE" - DebugInformationFormat="3"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="Ws2_32.lib" - OutputFile="$(OutDir)/client.exe" - LinkIncremental="1" - GenerateDebugInformation="TRUE" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - </Configuration> - </Configurations> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> - <File - RelativePath="client.cxx"> - </File> - <File - RelativePath="stun.cxx"> - </File> - <File - RelativePath="udp.cxx"> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc"> - <File - RelativePath="stun.h"> - </File> - <File - RelativePath="udp.h"> - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/libs/stund/id.pem b/libs/stund/id.pem deleted file mode 100644 index 184c4619a4cebd5fdc9e07c84f4d44626f8e228a..0000000000000000000000000000000000000000 --- a/libs/stund/id.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICazCCAdQCAQMwDQYJKoZIhvcNAQEEBQAwgYAxCzAJBgNVBAYTAlVBMQswCQYD -VQQIEwJDQTERMA8GA1UEBxMITWlscGl0YXMxDjAMBgNVBAoTBUZvb0NvMRMwEQYD -VQQLEwp3aWRnZXQgZGl2MRIwEAYDVQQDEwlsb2NhbGhvc3QxGDAWBgkqhkiG9w0B -CQEWCWZvb0Bmb28uYzAeFw0wMjExMDEwMzUyMjhaFw0wMjEyMDEwMzUyMjhaMHsx -CzAJBgNVBAYTAkdCMRIwEAYDVQQIEwlCZXJrc2hpcmUxEDAOBgNVBAcTB05ld2J1 -cnkxFzAVBgNVBAoTDk15IENvbXBhbnkgTHRkMRIwEAYDVQQDEwlsb2NhbGhvc3Qx -GTAXBgkqhkiG9w0BCQEWCnNlcnZlci5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0A -MIGJAoGBAO0DwcHArwHx2XoX3XAcjc9lc/ERveDqFO9NJChtA2R3/b7EaH4FOlv1 -QxL5aaCxiwhqHVo7F/BG2OxcIIBCp8HBLRYwmKnWwta4s4imD3ZI/AAaTPm5r/KJ -GbAh0vpF7WIdtsEOaSYbnLVnQTXTgfswgoH502sM13fVY0qJhjrTAgMBAAEwDQYJ -KoZIhvcNAQEEBQADgYEAUSwhHT7j9ammZBo/VHT8mZylqOzBakMuASiUQNwL40sc -0eb3MtKEg2GLlX8GtB0g2+bieA337XSXe4kyhpQ7j9ClajI3Dpr463ZKLJ43JFH0 -Ynqkfo61d9fQYtxJTXjYIatzLNXpzsxADEQ2MGokQmEMGJcBftLdMfvtOy8Kh7I= ------END CERTIFICATE----- diff --git a/libs/stund/id_key.pem b/libs/stund/id_key.pem deleted file mode 100644 index d8c4973181c6d8920037a9985b068ee1551243b8..0000000000000000000000000000000000000000 --- a/libs/stund/id_key.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDtA8HBwK8B8dl6F91wHI3PZXPxEb3g6hTvTSQobQNkd/2+xGh+ -BTpb9UMS+WmgsYsIah1aOxfwRtjsXCCAQqfBwS0WMJip1sLWuLOIpg92SPwAGkz5 -ua/yiRmwIdL6Re1iHbbBDmkmG5y1Z0E104H7MIKB+dNrDNd31WNKiYY60wIDAQAB -AoGAJt7C2/+5s9vyCq/3RPep2iWNSi/asBQzsrs3/tlCASwclTio2mIJHCOxCF+X -Dx+O6aZdgfrHBkTYNos1WVOVJ0S3K47HQ5gPZgIus855SEmfINzJkTPz0kahjUj9 -hMeKfmtM6uRqkVcs+H35chhXg2rW0uQRP3tlgd5wq+uRjoECQQD30oykMIbA32i6 -nHw1u1zJNZXaABoUsXlu5ylwXZp39FYxQiMmwTzI7AJAKTCf2YiHP4C9YLKnjKMo -8D+HudAxAkEA9NXo91TuOYtxYn3NJi4FCpo+hcrHH33M+ttB8L+lO9ctgzGuvI63 -pNszIVTNnV+RwnSyR+CtO7q/PQOcrK8eQwJAVCXVBYdIqkLxv7OU5XXKKrQcPtqc -AHzGm+a4BmRyJ9r6TV2ErAsfRaYFmZ2i2hQ2LJ5ea29jGktBt4vkNoTccQJBAL49 -dE6ybITEJ+8axwwSmBI79bbp8D0099A4DA2wLAjKUu/s69RRpLpxJFKS3U2aE90f -5eNZ3eFaYvxa0SOQ0pcCQQDEaX+MPPNUlOk4Im7XTaiT/qQDJyIHyl7+UeHOZbvN -X9HHnTnImOk38K3zFpEvCF9LHR3BTUzVcOEIPR/3hTor ------END RSA PRIVATE KEY----- diff --git a/libs/stund/nattest b/libs/stund/nattest deleted file mode 100644 index fb8e71daa8f0ee5ba898832213a032ac31241a54..0000000000000000000000000000000000000000 --- a/libs/stund/nattest +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# nattest shell script - -# set defaults -# Interfaces typically begin eth on Linux, en on Macintosh, le or hme on Solaris -# type ifconfig -a or ifconfig -l to see a list of all interfaces -serverint=eth0 -clientint=eth1 -serverip1=1.1.1.2 -serverip2=1.1.1.3 -servermask=255.255.255.0 -clientip1=192.168.0.2 -clientip2=192.168.0.3 -clientmask=255.255.255.0 - -# print warning, get confirmation -cat nattestwarning.txt -read -p "Are you sure you want to run this? [yes]" confirm -case $confirm in - [nN] ) exit;; - [nN][oO] ) exit;; -esac - -# off we go then.... -# add second IP address to each interface -ifconfig $serverint $serverip2 netmask 255.255.255.255 alias -ifconfig $clientint $clientip2 netmask 255.255.255.255 alias -# for Solaris, use these instead -# ifconfig ${serverint}:1 $serverip2 netmask $servermask -# ifconfig ${clientint}:1 $clientip2 netmask $clientmask - -./stund -h $serverip1 -a $serverip2 -b -# verify server is running - -./stunner $serverip1 -i $clientip1 -i2 $clientip2 -# process results of stunner and print pass/fail -case "$?" in - 10 ) echo "[PASS] (Address) Restricted Cone NAT with Hairpinning";; - 11 ) echo "[PASS] Port Restricted Cone NAT with Hairpinning";; - 8 ) echo "[No NAT] You have open internet access";; - 2 ) echo "[FAIL] Your (Address) Restricted Cone NAT doesn't do hairpinning";; - 3 ) echo "[FAIL] Your Port Restricted Cone NAT doesn't do hairpinning";; - -1 ) echo "ERROR! the STUN test program had an error";; - * ) echo "[FAIL] You have a NAT or Firewall type which is NOT RECOMMENDED.";; -esac - -# cleanup -killall -HUP stund -ifconfig $serverint $serverip2 -alias -ifconfig $clientint $clientip2 -alias -# for Solaris, use these instead -# ifconfig ${serverint}:1 unplumb -# ifconfig ${clientint}:1 unplumb - diff --git a/libs/stund/nattestwarning.txt b/libs/stund/nattestwarning.txt deleted file mode 100644 index 48c536a4a584a717a466ab14ed9071570600566c..0000000000000000000000000000000000000000 --- a/libs/stund/nattestwarning.txt +++ /dev/null @@ -1,47 +0,0 @@ -WARNING: This script runs as "root" and makes changes to your network interface -configuration. This script makes several assumptions about the test environment -you might be using. Several of these assumptions may not hold in your environment -and could cause you to lose all connectivity to this or other computers. -It is designed to be run from the console on two networks which are connected -only to a NAT in a configuration like the one shown below: - - Logical Configuration - - +--------+ - | STUN |192.168.0.2 +-------+ - | Client |---------------| | - +--------+ | |public +--------+ - | |side | STUN | 1.1.1.2 - 192.168.0.1 | NAT |------------| Server | 1.1.1.3 - private side| |1.1.1.1 +--------+ - | | - +--------+ | | - | STUN |---------------| | - | Client |192.168.0.3 +-------+ - +--------+ - -The test actually just requires a single computer with two interfaces which acts -as a STUN server and a pair of cooperating STUN clients. The physical configuration -is shown below. First plug in the NAT and computer and configure the primary IP -interface on each interface. There should be no other computers or networks -connected to the test bed. - - Physical Configuration - - Private Public - or "inside" or "outside" - interface +--------------+ interface - | NAT device | - 192.168.0.1 +-----| under |-----+ 1.1.1.1 - | | test | | - | | | | - | +--------------+ | - | | - | | - | +--------------+ | - | | test | | - 192.168.0.2 +-----| computer |-----+ 1.1.1.2 - 192.168.0.3 eth1| |eth0 1.1.1.3 - | | - +--------------+ - diff --git a/libs/stund/rfc3489.txt b/libs/stund/rfc3489.txt deleted file mode 100644 index 226b4a633c8e3a5da5de62cf5ece793bf0741723..0000000000000000000000000000000000000000 --- a/libs/stund/rfc3489.txt +++ /dev/null @@ -1,2635 +0,0 @@ - - - - - - -Network Working Group J. Rosenberg -Request for Comments: 3489 J. Weinberger -Category: Standards Track dynamicsoft - C. Huitema - Microsoft - R. Mahy - Cisco - March 2003 - - - STUN - Simple Traversal of User Datagram Protocol (UDP) - Through Network Address Translators (NATs) - -Status of this Memo - - This document specifies an Internet standards track protocol for the - Internet community, and requests discussion and suggestions for - improvements. Please refer to the current edition of the "Internet - Official Protocol Standards" (STD 1) for the standardization state - and status of this protocol. Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (2003). All Rights Reserved. - -Abstract - - Simple Traversal of User Datagram Protocol (UDP) Through Network - Address Translators (NATs) (STUN) is a lightweight protocol that - allows applications to discover the presence and types of NATs and - firewalls between them and the public Internet. It also provides the - ability for applications to determine the public Internet Protocol - (IP) addresses allocated to them by the NAT. STUN works with many - existing NATs, and does not require any special behavior from them. - As a result, it allows a wide variety of applications to work through - existing NAT infrastructure. - -Table of Contents - - 1. Applicability Statement ................................... 3 - 2. Introduction .............................................. 3 - 3. Terminology ............................................... 4 - 4. Definitions ............................................... 5 - 5. NAT Variations ............................................ 5 - 6. Overview of Operation ..................................... 6 - 7. Message Overview .......................................... 8 - 8. Server Behavior ........................................... 10 - 8.1 Binding Requests .................................... 10 - - - -Rosenberg, et al. Standards Track [Page 1] - -RFC 3489 STUN March 2003 - - - 8.2 Shared Secret Requests .............................. 13 - 9. Client Behavior ........................................... 14 - 9.1 Discovery ........................................... 15 - 9.2 Obtaining a Shared Secret ........................... 15 - 9.3 Formulating the Binding Request ..................... 17 - 9.4 Processing Binding Responses ........................ 17 - 10. Use Cases ................................................. 19 - 10.1 Discovery Process ................................... 19 - 10.2 Binding Lifetime Discovery .......................... 21 - 10.3 Binding Acquisition ................................. 23 - 11. Protocol Details .......................................... 24 - 11.1 Message Header ...................................... 25 - 11.2 Message Attributes .................................. 26 - 11.2.1 MAPPED-ADDRESS .............................. 27 - 11.2.2 RESPONSE-ADDRESS ............................ 27 - 11.2.3 CHANGED-ADDRESS ............................. 28 - 11.2.4 CHANGE-REQUEST .............................. 28 - 11.2.5 SOURCE-ADDRESS .............................. 28 - 11.2.6 USERNAME .................................... 28 - 11.2.7 PASSWORD .................................... 29 - 11.2.8 MESSAGE-INTEGRITY ........................... 29 - 11.2.9 ERROR-CODE .................................. 29 - 11.2.10 UNKNOWN-ATTRIBUTES .......................... 31 - 11.2.11 REFLECTED-FROM .............................. 31 - 12. Security Considerations ................................... 31 - 12.1 Attacks on STUN ..................................... 31 - 12.1.1 Attack I: DDOS Against a Target ............. 32 - 12.1.2 Attack II: Silencing a Client ............... 32 - 12.1.3 Attack III: Assuming the Identity of a Client 32 - 12.1.4 Attack IV: Eavesdropping .................... 33 - 12.2 Launching the Attacks ............................... 33 - 12.2.1 Approach I: Compromise a Legitimate - STUN Server ................................. 33 - 12.2.2 Approach II: DNS Attacks .................... 34 - 12.2.3 Approach III: Rogue Router or NAT ........... 34 - 12.2.4 Approach IV: MITM ........................... 35 - 12.2.5 Approach V: Response Injection Plus DoS ..... 35 - 12.2.6 Approach VI: Duplication .................... 35 - 12.3 Countermeasures ..................................... 36 - 12.4 Residual Threats .................................... 37 - 13. IANA Considerations ....................................... 38 - 14. IAB Considerations ........................................ 38 - 14.1 Problem Definition .................................. 38 - 14.2 Exit Strategy ....................................... 39 - 14.3 Brittleness Introduced by STUN ...................... 40 - 14.4 Requirements for a Long Term Solution ............... 42 - 14.5 Issues with Existing NAPT Boxes ..................... 43 - 14.6 In Closing .......................................... 43 - - - -Rosenberg, et al. Standards Track [Page 2] - -RFC 3489 STUN March 2003 - - - 15. Acknowledgments ........................................... 44 - 16. Normative References ...................................... 44 - 17. Informative References .................................... 44 - 18. Authors' Addresses ........................................ 46 - 19. Full Copyright Statement................................... 47 - -1. Applicability Statement - - This protocol is not a cure-all for the problems associated with NAT. - It does not enable incoming TCP connections through NAT. It allows - incoming UDP packets through NAT, but only through a subset of - existing NAT types. In particular, STUN does not enable incoming UDP - packets through symmetric NATs (defined below), which are common in - large enterprises. STUN's discovery procedures are based on - assumptions on NAT treatment of UDP; such assumptions may prove - invalid down the road as new NAT devices are deployed. STUN does not - work when it is used to obtain an address to communicate with a peer - which happens to be behind the same NAT. STUN does not work when the - STUN server is not in a common shared address realm. For a more - complete discussion of the limitations of STUN, see Section 14. - -2. Introduction - - Network Address Translators (NATs), while providing many benefits, - also come with many drawbacks. The most troublesome of those - drawbacks is the fact that they break many existing IP applications, - and make it difficult to deploy new ones. Guidelines have been - developed [8] that describe how to build "NAT friendly" protocols, - but many protocols simply cannot be constructed according to those - guidelines. Examples of such protocols include almost all peer-to- - peer protocols, such as multimedia communications, file sharing and - games. - - To combat this problem, Application Layer Gateways (ALGs) have been - embedded in NATs. ALGs perform the application layer functions - required for a particular protocol to traverse a NAT. Typically, - this involves rewriting application layer messages to contain - translated addresses, rather than the ones inserted by the sender of - the message. ALGs have serious limitations, including scalability, - reliability, and speed of deploying new applications. To resolve - these problems, the Middlebox Communications (MIDCOM) protocol is - being developed [9]. MIDCOM allows an application entity, such as an - end client or network server of some sort (like a Session Initiation - Protocol (SIP) proxy [10]) to control a NAT (or firewall), in order - to obtain NAT bindings and open or close pinholes. In this way, NATs - and applications can be separated once more, eliminating the need for - embedding ALGs in NATs, and resolving the limitations imposed by - current architectures. - - - -Rosenberg, et al. Standards Track [Page 3] - -RFC 3489 STUN March 2003 - - - Unfortunately, MIDCOM requires upgrades to existing NAT and - firewalls, in addition to application components. Complete upgrades - of these NAT and firewall products will take a long time, potentially - years. This is due, in part, to the fact that the deployers of NAT - and firewalls are not the same people who are deploying and using - applications. As a result, the incentive to upgrade these devices - will be low in many cases. Consider, for example, an airport - Internet lounge that provides access with a NAT. A user connecting - to the NATed network may wish to use a peer-to-peer service, but - cannot, because the NAT doesn't support it. Since the administrators - of the lounge are not the ones providing the service, they are not - motivated to upgrade their NAT equipment to support it, using either - an ALG, or MIDCOM. - - Another problem is that the MIDCOM protocol requires that the agent - controlling the middleboxes know the identity of those middleboxes, - and have a relationship with them which permits control. In many - configurations, this will not be possible. For example, many cable - access providers use NAT in front of their entire access network. - This NAT could be in addition to a residential NAT purchased and - operated by the end user. The end user will probably not have a - control relationship with the NAT in the cable access network, and - may not even know of its existence. - - Many existing proprietary protocols, such as those for online games - (such as the games described in RFC 3027 [11]) and Voice over IP, - have developed tricks that allow them to operate through NATs without - changing those NATs. This document is an attempt to take some of - those ideas, and codify them into an interoperable protocol that can - meet the needs of many applications. - - The protocol described here, Simple Traversal of UDP Through NAT - (STUN), allows entities behind a NAT to first discover the presence - of a NAT and the type of NAT, and then to learn the addresses - bindings allocated by the NAT. STUN requires no changes to NATs, and - works with an arbitrary number of NATs in tandem between the - application entity and the public Internet. - -3. Terminology - - In this document, the key words "MUST", "MUST NOT", "REQUIRED", - "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", - and "OPTIONAL" are to be interpreted as described in BCP 14, RFC 2119 - [1] and indicate requirement levels for compliant STUN - implementations. - - - - - - -Rosenberg, et al. Standards Track [Page 4] - -RFC 3489 STUN March 2003 - - -4. Definitions - - STUN Client: A STUN client (also just referred to as a client) - is an entity that generates STUN requests. A STUN client can - execute on an end system, such as a user's PC, or can run in a - network element, such as a conferencing server. - - STUN Server: A STUN Server (also just referred to as a server) - is an entity that receives STUN requests, and sends STUN - responses. STUN servers are generally attached to the public - Internet. - -5. NAT Variations - - It is assumed that the reader is familiar with NATs. It has been - observed that NAT treatment of UDP varies among implementations. The - four treatments observed in implementations are: - - Full Cone: A full cone NAT is one where all requests from the - same internal IP address and port are mapped to the same external - IP address and port. Furthermore, any external host can send a - packet to the internal host, by sending a packet to the mapped - external address. - - Restricted Cone: A restricted cone NAT is one where all requests - from the same internal IP address and port are mapped to the same - external IP address and port. Unlike a full cone NAT, an external - host (with IP address X) can send a packet to the internal host - only if the internal host had previously sent a packet to IP - address X. - - Port Restricted Cone: A port restricted cone NAT is like a - restricted cone NAT, but the restriction includes port numbers. - Specifically, an external host can send a packet, with source IP - address X and source port P, to the internal host only if the - internal host had previously sent a packet to IP address X and - port P. - - Symmetric: A symmetric NAT is one where all requests from the - same internal IP address and port, to a specific destination IP - address and port, are mapped to the same external IP address and - port. If the same host sends a packet with the same source - address and port, but to a different destination, a different - mapping is used. Furthermore, only the external host that - receives a packet can send a UDP packet back to the internal host. - - - - - - -Rosenberg, et al. Standards Track [Page 5] - -RFC 3489 STUN March 2003 - - - Determining the type of NAT is important in many cases. Depending on - what the application wants to do, it may need to take the particular - behavior into account. - -6. Overview of Operation - - This section is descriptive only. Normative behavior is described in - Sections 8 and 9. - - /-----\ - // STUN \\ - | Server | - \\ // - \-----/ - - - +--------------+ Public Internet - ................| NAT 2 |....................... - +--------------+ - - - +--------------+ Private NET 2 - ................| NAT 1 |....................... - +--------------+ - - /-----\ - // STUN \\ - | Client | - \\ // Private NET 1 - \-----/ - - Figure 1: STUN Configuration - - The typical STUN configuration is shown in Figure 1. A STUN client - is connected to private network 1. This network connects to private - network 2 through NAT 1. Private network 2 connects to the public - Internet through NAT 2. The STUN server resides on the public - Internet. - - STUN is a simple client-server protocol. A client sends a request to - a server, and the server returns a response. There are two types of - requests - Binding Requests, sent over UDP, and Shared Secret - Requests, sent over TLS [2] over TCP. Shared Secret Requests ask the - server to return a temporary username and password. This username - and password are used in a subsequent Binding Request and Binding - Response, for the purposes of authentication and message integrity. - - - - - -Rosenberg, et al. Standards Track [Page 6] - -RFC 3489 STUN March 2003 - - - Binding requests are used to determine the bindings allocated by - NATs. The client sends a Binding Request to the server, over UDP. - The server examines the source IP address and port of the request, - and copies them into a response that is sent back to the client. - There are some parameters in the request that allow the client to ask - that the response be sent elsewhere, or that the server send the - response from a different address and port. There are attributes for - providing message integrity and authentication. - - The trick is using STUN to discover the presence of NAT, and to learn - and use the bindings they allocate. - - The STUN client is typically embedded in an application which needs - to obtain a public IP address and port that can be used to receive - data. For example, it might need to obtain an IP address and port to - receive Real Time Transport Protocol (RTP) [12] traffic. When the - application starts, the STUN client within the application sends a - STUN Shared Secret Request to its server, obtains a username and - password, and then sends it a Binding Request. STUN servers can be - discovered through DNS SRV records [3], and it is generally assumed - that the client is configured with the domain to use to find the STUN - server. Generally, this will be the domain of the provider of the - service the application is using (such a provider is incented to - deploy STUN servers in order to allow its customers to use its - application through NAT). Of course, a client can determine the - address or domain name of a STUN server through other means. A STUN - server can even be embedded within an end system. - - The STUN Binding Request is used to discover the presence of a NAT, - and to discover the public IP address and port mappings generated by - the NAT. Binding Requests are sent to the STUN server using UDP. - When a Binding Request arrives at the STUN server, it may have passed - through one or more NATs between the STUN client and the STUN server. - As a result, the source address of the request received by the server - will be the mapped address created by the NAT closest to the server. - The STUN server copies that source IP address and port into a STUN - Binding Response, and sends it back to the source IP address and port - of the STUN request. For all of the NAT types above, this response - will arrive at the STUN client. - - When the STUN client receives the STUN Binding Response, it compares - the IP address and port in the packet with the local IP address and - port it bound to when the request was sent. If these do not match, - the STUN client is behind one or more NATs. In the case of a full- - cone NAT, the IP address and port in the body of the STUN response - are public, and can be used by any host on the public Internet to - send packets to the application that sent the STUN request. An - application need only listen on the IP address and port from which - - - -Rosenberg, et al. Standards Track [Page 7] - -RFC 3489 STUN March 2003 - - - the STUN request was sent. Any packets sent by a host on the public - Internet to the public address and port learned by STUN will be - received by the application. - - Of course, the host may not be behind a full-cone NAT. Indeed, it - doesn't yet know what type of NAT it is behind. To determine that, - the client uses additional STUN Binding Requests. The exact - procedure is flexible, but would generally work as follows. The - client would send a second STUN Binding Request, this time to a - different IP address, but from the same source IP address and port. - If the IP address and port in the response are different from those - in the first response, the client knows it is behind a symmetric NAT. - To determine if it's behind a full-cone NAT, the client can send a - STUN Binding Request with flags that tell the STUN server to send a - response from a different IP address and port than the request was - received on. In other words, if the client sent a Binding Request to - IP address/port A/B using a source IP address/port of X/Y, the STUN - server would send the Binding Response to X/Y using source IP - address/port C/D. If the client receives this response, it knows it - is behind a full cone NAT. - - STUN also allows the client to ask the server to send the Binding - Response from the same IP address the request was received on, but - with a different port. This can be used to detect whether the client - is behind a port restricted cone NAT or just a restricted cone NAT. - - It should be noted that the configuration in Figure 1 is not the only - permissible configuration. The STUN server can be located anywhere, - including within another client. The only requirement is that the - STUN server is reachable by the client, and if the client is trying - to obtain a publicly routable address, that the server reside on the - public Internet. - -7. Message Overview - - STUN messages are TLV (type-length-value) encoded using big endian - (network ordered) binary. All STUN messages start with a STUN - header, followed by a STUN payload. The payload is a series of STUN - attributes, the set of which depends on the message type. The STUN - header contains a STUN message type, transaction ID, and length. The - message type can be Binding Request, Binding Response, Binding Error - Response, Shared Secret Request, Shared Secret Response, or Shared - Secret Error Response. The transaction ID is used to correlate - requests and responses. The length indicates the total length of the - STUN payload, not including the header. This allows STUN to run over - TCP. Shared Secret Requests are always sent over TCP (indeed, using - TLS over TCP). - - - - -Rosenberg, et al. Standards Track [Page 8] - -RFC 3489 STUN March 2003 - - - Several STUN attributes are defined. The first is a MAPPED-ADDRESS - attribute, which is an IP address and port. It is always placed in - the Binding Response, and it indicates the source IP address and port - the server saw in the Binding Request. There is also a RESPONSE- - ADDRESS attribute, which contains an IP address and port. The - RESPONSE-ADDRESS attribute can be present in the Binding Request, and - indicates where the Binding Response is to be sent. It's optional, - and when not present, the Binding Response is sent to the source IP - address and port of the Binding Request. - - The third attribute is the CHANGE-REQUEST attribute, and it contains - two flags to control the IP address and port used to send the - response. These flags are called "change IP" and "change port" - flags. The CHANGE-REQUEST attribute is allowed only in the Binding - Request. The "change IP" and "change port" flags are useful for - determining whether the client is behind a restricted cone NAT or - restricted port cone NAT. They instruct the server to send the - Binding Responses from a different source IP address and port. The - CHANGE-REQUEST attribute is optional in the Binding Request. - - The fourth attribute is the CHANGED-ADDRESS attribute. It is present - in Binding Responses. It informs the client of the source IP address - and port that would be used if the client requested the "change IP" - and "change port" behavior. - - The fifth attribute is the SOURCE-ADDRESS attribute. It is only - present in Binding Responses. It indicates the source IP address and - port where the response was sent from. It is useful for detecting - twice NAT configurations. - - The sixth attribute is the USERNAME attribute. It is present in a - Shared Secret Response, which provides the client with a temporary - username and password (encoded in the PASSWORD attribute). The - USERNAME is also present in Binding Requests, serving as an index to - the shared secret used for the integrity protection of the Binding - Request. The seventh attribute, PASSWORD, is only found in Shared - Secret Response messages. The eight attribute is the MESSAGE- - INTEGRITY attribute, which contains a message integrity check over - the Binding Request or Binding Response. - - The ninth attribute is the ERROR-CODE attribute. This is present in - the Binding Error Response and Shared Secret Error Response. It - indicates the error that has occurred. The tenth attribute is the - UNKNOWN-ATTRIBUTES attribute, which is present in either the Binding - Error Response or Shared Secret Error Response. It indicates the - mandatory attributes from the request which were unknown. The - eleventh attribute is the REFLECTED-FROM attribute, which is present - in Binding Responses. It indicates the IP address and port of the - - - -Rosenberg, et al. Standards Track [Page 9] - -RFC 3489 STUN March 2003 - - - sender of a Binding Request, used for traceability purposes to - prevent certain denial-of-service attacks. - -8. Server Behavior - - The server behavior depends on whether the request is a Binding - Request or a Shared Secret Request. - -8.1 Binding Requests - - A STUN server MUST be prepared to receive Binding Requests on four - address/port combinations - (A1, P1), (A2, P1), (A1, P2), and (A2, - P2). (A1, P1) represent the primary address and port, and these are - the ones obtained through the client discovery procedures below. - Typically, P1 will be port 3478, the default STUN port. A2 and P2 - are arbitrary. A2 and P2 are advertised by the server through the - CHANGED-ADDRESS attribute, as described below. - - It is RECOMMENDED that the server check the Binding Request for a - MESSAGE-INTEGRITY attribute. If not present, and the server requires - integrity checks on the request, it generates a Binding Error - Response with an ERROR-CODE attribute with response code 401. If the - MESSAGE-INTEGRITY attribute was present, the server computes the HMAC - over the request as described in Section 11.2.8. The key to use - depends on the shared secret mechanism. If the STUN Shared Secret - Request was used, the key MUST be the one associated with the - USERNAME attribute present in the request. If the USERNAME attribute - was not present, the server MUST generate a Binding Error Response. - The Binding Error Response MUST include an ERROR-CODE attribute with - response code 432. If the USERNAME is present, but the server - doesn't remember the shared secret for that USERNAME (because it - timed out, for example), the server MUST generate a Binding Error - Response. The Binding Error Response MUST include an ERROR-CODE - attribute with response code 430. If the server does know the shared - secret, but the computed HMAC differs from the one in the request, - the server MUST generate a Binding Error Response with an ERROR-CODE - attribute with response code 431. The Binding Error Response is sent - to the IP address and port the Binding Request came from, and sent - from the IP address and port the Binding Request was sent to. - - Assuming the message integrity check passed, processing continues. - The server MUST check for any attributes in the request with values - less than or equal to 0x7fff which it does not understand. If it - encounters any, the server MUST generate a Binding Error Response, - and it MUST include an ERROR-CODE attribute with a 420 response code. - - - - - - -Rosenberg, et al. Standards Track [Page 10] - -RFC 3489 STUN March 2003 - - - That response MUST contain an UNKNOWN-ATTRIBUTES attribute listing - the attributes with values less than or equal to 0x7fff which were - not understood. The Binding Error Response is sent to the IP address - and port the Binding Request came from, and sent from the IP address - and port the Binding Request was sent to. - - Assuming the request was correctly formed, the server MUST generate a - single Binding Response. The Binding Response MUST contain the same - transaction ID contained in the Binding Request. The length in the - message header MUST contain the total length of the message in bytes, - excluding the header. The Binding Response MUST have a message type - of "Binding Response". - - The server MUST add a MAPPED-ADDRESS attribute to the Binding - Response. The IP address component of this attribute MUST be set to - the source IP address observed in the Binding Request. The port - component of this attribute MUST be set to the source port observed - in the Binding Request. - - If the RESPONSE-ADDRESS attribute was absent from the Binding - Request, the destination address and port of the Binding Response - MUST be the same as the source address and port of the Binding - Request. Otherwise, the destination address and port of the Binding - Response MUST be the value of the IP address and port in the - RESPONSE-ADDRESS attribute. - - The source address and port of the Binding Response depend on the - value of the CHANGE-REQUEST attribute and on the address and port the - Binding Request was received on, and are summarized in Table 1. - - Let Da represent the destination IP address of the Binding Request - (which will be either A1 or A2), and Dp represent the destination - port of the Binding Request (which will be either P1 or P2). Let Ca - represent the other address, so that if Da is A1, Ca is A2. If Da is - A2, Ca is A1. Similarly, let Cp represent the other port, so that if - Dp is P1, Cp is P2. If Dp is P2, Cp is P1. If the "change port" - flag was set in CHANGE-REQUEST attribute of the Binding Request, and - the "change IP" flag was not set, the source IP address of the - Binding Response MUST be Da and the source port of the Binding - Response MUST be Cp. If the "change IP" flag was set in the Binding - Request, and the "change port" flag was not set, the source IP - address of the Binding Response MUST be Ca and the source port of the - Binding Response MUST be Dp. When both flags are set, the source IP - address of the Binding Response MUST be Ca and the source port of the - Binding Response MUST be Cp. If neither flag is set, or if the - CHANGE-REQUEST attribute is absent entirely, the source IP address of - the Binding Response MUST be Da and the source port of the Binding - Response MUST be Dp. - - - -Rosenberg, et al. Standards Track [Page 11] - -RFC 3489 STUN March 2003 - - - Flags Source Address Source Port CHANGED-ADDRESS - none Da Dp Ca:Cp - Change IP Ca Dp Ca:Cp - Change port Da Cp Ca:Cp - Change IP and - Change port Ca Cp Ca:Cp - - Table 1: Impact of Flags on Packet Source and CHANGED-ADDRESS - - The server MUST add a SOURCE-ADDRESS attribute to the Binding - Response, containing the source address and port used to send the - Binding Response. - - The server MUST add a CHANGED-ADDRESS attribute to the Binding - Response. This contains the source IP address and port that would be - used if the client had set the "change IP" and "change port" flags in - the Binding Request. As summarized in Table 1, these are Ca and Cp, - respectively, regardless of the value of the CHANGE-REQUEST flags. - - If the Binding Request contained both the USERNAME and MESSAGE- - INTEGRITY attributes, the server MUST add a MESSAGE-INTEGRITY - attribute to the Binding Response. The attribute contains an HMAC - [13] over the response, as described in Section 11.2.8. The key to - use depends on the shared secret mechanism. If the STUN Shared - Secret Request was used, the key MUST be the one associated with the - USERNAME attribute present in the Binding Request. - - If the Binding Request contained a RESPONSE-ADDRESS attribute, the - server MUST add a REFLECTED-FROM attribute to the response. If the - Binding Request was authenticated using a username obtained from a - Shared Secret Request, the REFLECTED-FROM attribute MUST contain the - source IP address and port where that Shared Secret Request came - from. If the username present in the request was not allocated using - a Shared Secret Request, the REFLECTED-FROM attribute MUST contain - the source address and port of the entity which obtained the - username, as best can be verified with the mechanism used to allocate - the username. If the username was not present in the request, and - the server was willing to process the request, the REFLECTED-FROM - attribute SHOULD contain the source IP address and port where the - request came from. - - The server SHOULD NOT retransmit the response. Reliability is - achieved by having the client periodically resend the request, each - of which triggers a response from the server. - - - - - - - -Rosenberg, et al. Standards Track [Page 12] - -RFC 3489 STUN March 2003 - - -8.2 Shared Secret Requests - - Shared Secret Requests are always received on TLS connections. When - the server receives a request from the client to establish a TLS - connection, it MUST proceed with TLS, and SHOULD present a site - certificate. The TLS ciphersuite TLS_RSA_WITH_AES_128_CBC_SHA [4] - SHOULD be used. Client TLS authentication MUST NOT be done, since - the server is not allocating any resources to clients, and the - computational burden can be a source of attacks. - - If the server receives a Shared Secret Request, it MUST verify that - the request arrived on a TLS connection. If it did not receive the - request over TLS, it MUST generate a Shared Secret Error Response, - and it MUST include an ERROR-CODE attribute with a 433 response code. - The destination for the error response depends on the transport on - which the request was received. If the Shared Secret Request was - received over TCP, the Shared Secret Error Response is sent over the - same connection the request was received on. If the Shared Secret - Request was receive over UDP, the Shared Secret Error Response is - sent to the source IP address and port that the request came from. - - The server MUST check for any attributes in the request with values - less than or equal to 0x7fff which it does not understand. If it - encounters any, the server MUST generate a Shared Secret Error - Response, and it MUST include an ERROR-CODE attribute with a 420 - response code. That response MUST contain an UNKNOWN-ATTRIBUTES - attribute listing the attributes with values less than or equal to - 0x7fff which were not understood. The Shared Secret Error Response - is sent over the TLS connection. - - All Shared Secret Error Responses MUST contain the same transaction - ID contained in the Shared Secret Request. The length in the message - header MUST contain the total length of the message in bytes, - excluding the header. The Shared Secret Error Response MUST have a - message type of "Shared Secret Error Response" (0x0112). - - Assuming the request was properly constructed, the server creates a - Shared Secret Response. The Shared Secret Response MUST contain the - same transaction ID contained in the Shared Secret Request. The - length in the message header MUST contain the total length of the - message in bytes, excluding the header. The Shared Secret Response - MUST have a message type of "Shared Secret Response". The Shared - Secret Response MUST contain a USERNAME attribute and a PASSWORD - attribute. The USERNAME attribute serves as an index to the - password, which is contained in the PASSWORD attribute. The server - can use any mechanism it chooses to generate the username. However, - the username MUST be valid for a period of at least 10 minutes. - Validity means that the server can compute the password for that - - - -Rosenberg, et al. Standards Track [Page 13] - -RFC 3489 STUN March 2003 - - - username. There MUST be a single password for each username. In - other words, the server cannot, 10 minutes later, assign a different - password to the same username. The server MUST hand out a different - username for each distinct Shared Secret Request. Distinct, in this - case, implies a different transaction ID. It is RECOMMENDED that the - server explicitly invalidate the username after ten minutes. It MUST - invalidate the username after 30 minutes. The PASSWORD contains the - password bound to that username. The password MUST have at least 128 - bits. The likelihood that the server assigns the same password for - two different usernames MUST be vanishingly small, and the passwords - MUST be unguessable. In other words, they MUST be a - cryptographically random function of the username. - - These requirements can still be met using a stateless server, by - intelligently computing the USERNAME and PASSWORD. One approach is - to construct the USERNAME as: - - USERNAME = <prefix,rounded-time,clientIP,hmac> - - Where prefix is some random text string (different for each shared - secret request), rounded-time is the current time modulo 20 minutes, - clientIP is the source IP address where the Shared Secret Request - came from, and hmac is an HMAC [13] over the prefix, rounded-time, - and client IP, using a server private key. - - The password is then computed as: - - password = <hmac(USERNAME,anotherprivatekey)> - - With this structure, the username itself, which will be present in - the Binding Request, contains the source IP address where the Shared - Secret Request came from. That allows the server to meet the - requirements specified in Section 8.1 for constructing the - REFLECTED-FROM attribute. The server can verify that the username - was not tampered with, using the hmac present in the username. - - The Shared Secret Response is sent over the same TLS connection the - request was received on. The server SHOULD keep the connection open, - and let the client close it. - -9. Client Behavior - - The behavior of the client is very straightforward. Its task is to - discover the STUN server, obtain a shared secret, formulate the - Binding Request, handle request reliability, and process the Binding - Responses. - - - - - -Rosenberg, et al. Standards Track [Page 14] - -RFC 3489 STUN March 2003 - - -9.1 Discovery - - Generally, the client will be configured with a domain name of the - provider of the STUN servers. This domain name is resolved to an IP - address and port using the SRV procedures specified in RFC 2782 [3]. - - Specifically, the service name is "stun". The protocol is "udp" for - sending Binding Requests, or "tcp" for sending Shared Secret - Requests. The procedures of RFC 2782 are followed to determine the - server to contact. RFC 2782 spells out the details of how a set of - SRV records are sorted and then tried. However, it only states that - the client should "try to connect to the (protocol, address, - service)" without giving any details on what happens in the event of - failure. Those details are described here for STUN. - - For STUN requests, failure occurs if there is a transport failure of - some sort (generally, due to fatal ICMP errors in UDP or connection - failures in TCP). Failure also occurs if the transaction fails due - to timeout. This occurs 9.5 seconds after the first request is sent, - for both Shared Secret Requests and Binding Requests. See Section - 9.3 for details on transaction timeouts for Binding Requests. If a - failure occurs, the client SHOULD create a new request, which is - identical to the previous, but has a different transaction ID and - MESSAGE INTEGRITY attribute (the HMAC will change because the - transaction ID has changed). That request is sent to the next - element in the list as specified by RFC 2782. - - The default port for STUN requests is 3478, for both TCP and UDP. - Administrators SHOULD use this port in their SRV records, but MAY use - others. - - If no SRV records were found, the client performs an A record lookup - of the domain name. The result will be a list of IP addresses, each - of which can be contacted at the default port. - - This would allow a firewall admin to open the STUN port, so hosts - within the enterprise could access new applications. Whether they - will or won't do this is a good question. - -9.2 Obtaining a Shared Secret - - As discussed in Section 12, there are several attacks possible on - STUN systems. Many of these are prevented through integrity of - requests and responses. To provide that integrity, STUN makes use of - a shared secret between client and server, used as the keying - material for an HMAC used in both the Binding Request and Binding - Response. STUN allows for the shared secret to be obtained in any - way (for example, Kerberos [14]). However, it MUST have at least 128 - - - -Rosenberg, et al. Standards Track [Page 15] - -RFC 3489 STUN March 2003 - - - bits of randomness. In order to ensure interoperability, this - specification describes a TLS-based mechanism. This mechanism, - described in this section, MUST be implemented by clients and - servers. - - First, the client determines the IP address and port that it will - open a TCP connection to. This is done using the discovery - procedures in Section 9.1. The client opens up the connection to - that address and port, and immediately begins TLS negotiation [2]. - The client MUST verify the identity of the server. To do that, it - follows the identification procedures defined in Section 3.1 of RFC - 2818 [5]. Those procedures assume the client is dereferencing a URI. - For purposes of usage with this specification, the client treats the - domain name or IP address used in Section 9.1 as the host portion of - the URI that has been dereferenced. - - Once the connection is opened, the client sends a Shared Secret - request. This request has no attributes, just the header. The - transaction ID in the header MUST meet the requirements outlined for - the transaction ID in a binding request, described in Section 9.3 - below. The server generates a response, which can either be a Shared - Secret Response or a Shared Secret Error Response. - - If the response was a Shared Secret Error Response, the client checks - the response code in the ERROR-CODE attribute. Interpretation of - those response codes is identical to the processing of Section 9.4 - for the Binding Error Response. - - If a client receives a Shared Secret Response with an attribute whose - type is greater than 0x7fff, the attribute MUST be ignored. If the - client receives a Shared Secret Response with an attribute whose type - is less than or equal to 0x7fff, the response is ignored. - - If the response was a Shared Secret Response, it will contain a short - lived username and password, encoded in the USERNAME and PASSWORD - attributes, respectively. - - The client MAY generate multiple Shared Secret Requests on the - connection, and it MAY do so before receiving Shared Secret Responses - to previous Shared Secret Requests. The client SHOULD close the - connection as soon as it has finished obtaining usernames and - passwords. - - Section 9.3 describes how these passwords are used to provide - integrity protection over Binding Requests, and Section 8.1 describes - how it is used in Binding Responses. - - - - - -Rosenberg, et al. Standards Track [Page 16] - -RFC 3489 STUN March 2003 - - -9.3 Formulating the Binding Request - - A Binding Request formulated by the client follows the syntax rules - defined in Section 11. Any two requests that are not bit-wise - identical, and not sent to the same server from the same IP address - and port, MUST carry different transaction IDs. The transaction ID - MUST be uniformly and randomly distributed between 0 and 2**128 - 1. - The large range is needed because the transaction ID serves as a form - of randomization, helping to prevent replays of previously signed - responses from the server. The message type of the request MUST be - "Binding Request". - - The RESPONSE-ADDRESS attribute is optional in the Binding Request. - It is used if the client wishes the response to be sent to a - different IP address and port than the one the request was sent from. - This is useful for determining whether the client is behind a - firewall, and for applications that have separated control and data - components. See Section 10.3 for more details. The CHANGE-REQUEST - attribute is also optional. Whether it is present depends on what - the application is trying to accomplish. See Section 10 for some - example uses. - - The client SHOULD add a MESSAGE-INTEGRITY and USERNAME attribute to - the Binding Request. This MESSAGE-INTEGRITY attribute contains an - HMAC [13]. The value of the username, and the key to use in the - MESSAGE-INTEGRITY attribute depend on the shared secret mechanism. - If the STUN Shared Secret Request was used, the USERNAME must be a - valid username obtained from a Shared Secret Response within the last - nine minutes. The shared secret for the HMAC is the value of the - PASSWORD attribute obtained from the same Shared Secret Response. - - Once formulated, the client sends the Binding Request. Reliability - is accomplished through client retransmissions. Clients SHOULD - retransmit the request starting with an interval of 100ms, doubling - every retransmit until the interval reaches 1.6s. Retransmissions - continue with intervals of 1.6s until a response is received, or a - total of 9 requests have been sent. If no response is received by 1.6 - seconds after the last request has been sent, the client SHOULD - consider the transaction to have failed. In other words, requests - would be sent at times 0ms, 100ms, 300ms, 700ms, 1500ms, 3100ms, - 4700ms, 6300ms, and 7900ms. At 9500ms, the client considers the - transaction to have failed if no response has been received. - -9.4 Processing Binding Responses - - The response can either be a Binding Response or Binding Error - Response. Binding Error Responses are always received on the source - address and port the request was sent from. A Binding Response will - - - -Rosenberg, et al. Standards Track [Page 17] - -RFC 3489 STUN March 2003 - - - be received on the address and port placed in the RESPONSE-ADDRESS - attribute of the request. If none was present, the Binding Responses - will be received on the source address and port the request was sent - from. - - If the response is a Binding Error Response, the client checks the - response code from the ERROR-CODE attribute of the response. For a - 400 response code, the client SHOULD display the reason phrase to the - user. For a 420 response code, the client SHOULD retry the request, - this time omitting any attributes listed in the UNKNOWN-ATTRIBUTES - attribute of the response. For a 430 response code, the client - SHOULD obtain a new shared secret, and retry the Binding Request with - a new transaction. For 401 and 432 response codes, if the client had - omitted the USERNAME or MESSAGE-INTEGRITY attribute as indicated by - the error, it SHOULD try again with those attributes. For a 431 - response code, the client SHOULD alert the user, and MAY try the - request again after obtaining a new username and password. For a 500 - response code, the client MAY wait several seconds and then retry the - request. For a 600 response code, the client MUST NOT retry the - request, and SHOULD display the reason phrase to the user. Unknown - attributes between 400 and 499 are treated like a 400, unknown - attributes between 500 and 599 are treated like a 500, and unknown - attributes between 600 and 699 are treated like a 600. Any response - between 100 and 399 MUST result in the cessation of request - retransmissions, but otherwise is discarded. - - If a client receives a response with an attribute whose type is - greater than 0x7fff, the attribute MUST be ignored. If the client - receives a response with an attribute whose type is less than or - equal to 0x7fff, request retransmissions MUST cease, but the entire - response is otherwise ignored. - - If the response is a Binding Response, the client SHOULD check the - response for a MESSAGE-INTEGRITY attribute. If not present, and the - client placed a MESSAGE-INTEGRITY attribute into the request, it MUST - discard the response. If present, the client computes the HMAC over - the response as described in Section 11.2.8. The key to use depends - on the shared secret mechanism. If the STUN Shared Secret Request - was used, the key MUST be same as used to compute the MESSAGE- - INTEGRITY attribute in the request. If the computed HMAC differs - from the one in the response, the client MUST discard the response, - and SHOULD alert the user about a possible attack. If the computed - HMAC matches the one from the response, processing continues. - - Reception of a response (either Binding Error Response or Binding - Response) to a Binding Request will terminate retransmissions of that - request. However, clients MUST continue to listen for responses to a - Binding Request for 10 seconds after the first response. If it - - - -Rosenberg, et al. Standards Track [Page 18] - -RFC 3489 STUN March 2003 - - - receives any responses in this interval with different message types - (Binding Responses and Binding Error Responses, for example) or - different MAPPED-ADDRESSes, it is an indication of a possible attack. - The client MUST NOT use the MAPPED-ADDRESS from any of the responses - it received (either the first or the additional ones), and SHOULD - alert the user. - - Furthermore, if a client receives more than twice as many Binding - Responses as the number of Binding Requests it sent, it MUST NOT use - the MAPPED-ADDRESS from any of those responses, and SHOULD alert the - user about a potential attack. - - If the Binding Response is authenticated, and the MAPPED-ADDRESS was - not discarded because of a potential attack, the CLIENT MAY use the - MAPPED-ADDRESS and SOURCE-ADDRESS attributes. - -10. Use Cases - - The rules of Sections 8 and 9 describe exactly how a client and - server interact to send requests and get responses. However, they do - not dictate how the STUN protocol is used to accomplish useful tasks. - That is at the discretion of the client. Here, we provide some - useful scenarios for applying STUN. - -10.1 Discovery Process - - In this scenario, a user is running a multimedia application which - needs to determine which of the following scenarios applies to it: - - o On the open Internet - - o Firewall that blocks UDP - - o Firewall that allows UDP out, and responses have to come back to - the source of the request (like a symmetric NAT, but no - translation. We call this a symmetric UDP Firewall) - - o Full-cone NAT - - o Symmetric NAT - - o Restricted cone or restricted port cone NAT - - Which of the six scenarios applies can be determined through the flow - chart described in Figure 2. The chart refers only to the sequence - of Binding Requests; Shared Secret Requests will, of course, be - needed to authenticate each Binding Request used in the sequence. - - - - -Rosenberg, et al. Standards Track [Page 19] - -RFC 3489 STUN March 2003 - - - The flow makes use of three tests. In test I, the client sends a - STUN Binding Request to a server, without any flags set in the - CHANGE-REQUEST attribute, and without the RESPONSE-ADDRESS attribute. - This causes the server to send the response back to the address and - port that the request came from. In test II, the client sends a - Binding Request with both the "change IP" and "change port" flags - from the CHANGE-REQUEST attribute set. In test III, the client sends - a Binding Request with only the "change port" flag set. - - The client begins by initiating test I. If this test yields no - response, the client knows right away that it is not capable of UDP - connectivity. If the test produces a response, the client examines - the MAPPED-ADDRESS attribute. If this address and port are the same - as the local IP address and port of the socket used to send the - request, the client knows that it is not natted. It executes test - II. - - If a response is received, the client knows that it has open access - to the Internet (or, at least, its behind a firewall that behaves - like a full-cone NAT, but without the translation). If no response - is received, the client knows its behind a symmetric UDP firewall. - - In the event that the IP address and port of the socket did not match - the MAPPED-ADDRESS attribute in the response to test I, the client - knows that it is behind a NAT. It performs test II. If a response - is received, the client knows that it is behind a full-cone NAT. If - no response is received, it performs test I again, but this time, - does so to the address and port from the CHANGED-ADDRESS attribute - from the response to test I. If the IP address and port returned in - the MAPPED-ADDRESS attribute are not the same as the ones from the - first test I, the client knows its behind a symmetric NAT. If the - address and port are the same, the client is either behind a - restricted or port restricted NAT. To make a determination about - which one it is behind, the client initiates test III. If a response - is received, its behind a restricted NAT, and if no response is - received, its behind a port restricted NAT. - - This procedure yields substantial information about the operating - condition of the client application. In the event of multiple NATs - between the client and the Internet, the type that is discovered will - be the type of the most restrictive NAT between the client and the - Internet. The types of NAT, in order of restrictiveness, from most - to least, are symmetric, port restricted cone, restricted cone, and - full cone. - - Typically, a client will re-do this discovery process periodically to - detect changes, or look for inconsistent results. It is important to - note that when the discovery process is redone, it should not - - - -Rosenberg, et al. Standards Track [Page 20] - -RFC 3489 STUN March 2003 - - - generally be done from the same local address and port used in the - previous discovery process. If the same local address and port are - reused, bindings from the previous test may still be in existence, - and these will invalidate the results of the test. Using a different - local address and port for subsequent tests resolves this problem. - An alternative is to wait sufficiently long to be confident that the - old bindings have expired (half an hour should more than suffice). - -10.2 Binding Lifetime Discovery - - STUN can also be used to discover the lifetimes of the bindings - created by the NAT. In many cases, the client will need to refresh - the binding, either through a new STUN request, or an application - packet, in order for the application to continue to use the binding. - By discovering the binding lifetime, the client can determine how - frequently it needs to refresh. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Rosenberg, et al. Standards Track [Page 21] - -RFC 3489 STUN March 2003 - - - +--------+ - | Test | - | I | - +--------+ - | - | - V - /\ /\ - N / \ Y / \ Y +--------+ - UDP <-------/Resp\--------->/ IP \------------->| Test | - Blocked \ ? / \Same/ | II | - \ / \? / +--------+ - \/ \/ | - | N | - | V - V /\ - +--------+ Sym. N / \ - | Test | UDP <---/Resp\ - | II | Firewall \ ? / - +--------+ \ / - | \/ - V |Y - /\ /\ | - Symmetric N / \ +--------+ N / \ V - NAT <--- / IP \<-----| Test |<--- /Resp\ Open - \Same/ | I | \ ? / Internet - \? / +--------+ \ / - \/ \/ - | |Y - | | - | V - | Full - | Cone - V /\ - +--------+ / \ Y - | Test |------>/Resp\---->Restricted - | III | \ ? / - +--------+ \ / - \/ - |N - | Port - +------>Restricted - - Figure 2: Flow for type discovery process - - - - - - - -Rosenberg, et al. Standards Track [Page 22] - -RFC 3489 STUN March 2003 - - - To determine the binding lifetime, the client first sends a Binding - Request to the server from a particular socket, X. This creates a - binding in the NAT. The response from the server contains a MAPPED- - ADDRESS attribute, providing the public address and port on the NAT. - Call this Pa and Pp, respectively. The client then starts a timer - with a value of T seconds. When this timer fires, the client sends - another Binding Request to the server, using the same destination - address and port, but from a different socket, Y. This request - contains a RESPONSE-ADDRESS address attribute, set to (Pa,Pp). This - will create a new binding on the NAT, and cause the STUN server to - send a Binding Response that would match the old binding, if it still - exists. If the client receives the Binding Response on socket X, it - knows that the binding has not expired. If the client receives the - Binding Response on socket Y (which is possible if the old binding - expired, and the NAT allocated the same public address and port to - the new binding), or receives no response at all, it knows that the - binding has expired. - - The client can find the value of the binding lifetime by doing a - binary search through T, arriving eventually at the value where the - response is not received for any timer greater than T, but is - received for any timer less than T. - - This discovery process takes quite a bit of time, and is something - that will typically be run in the background on a device once it - boots. - - It is possible that the client can get inconsistent results each time - this process is run. For example, if the NAT should reboot, or be - reset for some reason, the process may discover a lifetime than is - shorter than the actual one. For this reason, implementations are - encouraged to run the test numerous times, and be prepared to get - inconsistent results. - -10.3 Binding Acquisition - - Consider once more the case of a VoIP phone. It used the discovery - process above when it started up, to discover its environment. Now, - it wants to make a call. As part of the discovery process, it - determined that it was behind a full-cone NAT. - - Consider further that this phone consists of two logically separated - components - a control component that handles signaling, and a media - component that handles the audio, video, and RTP [12]. Both are - behind the same NAT. Because of this separation of control and - media, we wish to minimize the communication required between them. - In fact, they may not even run on the same host. - - - - -Rosenberg, et al. Standards Track [Page 23] - -RFC 3489 STUN March 2003 - - - In order to make a voice call, the phone needs to obtain an IP - address and port that it can place in the call setup message as the - destination for receiving audio. - - To obtain an address, the control component sends a Shared Secret - Request to the server, obtains a shared secret, and then sends a - Binding Request to the server. No CHANGE-REQUEST attribute is - present in the Binding Request, and neither is the RESPONSE-ADDRESS - attribute. The Binding Response contains a mapped address. The - control component then formulates a second Binding Request. This - request contains a RESPONSE-ADDRESS, which is set to the mapped - address learned from the previous Binding Response. This Binding - Request is passed to the media component, along with the IP address - and port of the STUN server. The media component sends the Binding - Request. The request goes to the STUN server, which sends the - Binding Response back to the control component. The control - component receives this, and now has learned an IP address and port - that will be routed back to the media component that sent the - request. - - The client will be able to receive media from anywhere on this mapped - address. - - In the case of silence suppression, there may be periods where the - client receives no media. In this case, the UDP bindings could - timeout (UDP bindings in NATs are typically short; 30 seconds is - common). To deal with this, the application can periodically - retransmit the query in order to keep the binding fresh. - - It is possible that both participants in the multimedia session are - behind the same NAT. In that case, both will repeat this procedure - above, and both will obtain public address bindings. When one sends - media to the other, the media is routed to the NAT, and then turns - right back around to come back into the enterprise, where it is - translated to the private address of the recipient. This is not - particularly efficient, and unfortunately, does not work in many - commercial NATs. In such cases, the clients may need to retry using - private addresses. - -11. Protocol Details - - This section presents the detailed encoding of a STUN message. - - STUN is a request-response protocol. Clients send a request, and the - server sends a response. There are two requests, Binding Request, - and Shared Secret Request. The response to a Binding Request can - - - - - -Rosenberg, et al. Standards Track [Page 24] - -RFC 3489 STUN March 2003 - - - either be the Binding Response or Binding Error Response. The - response to a Shared Secret Request can either be a Shared Secret - Response or a Shared Secret Error Response. - - STUN messages are encoded using binary fields. All integer fields - are carried in network byte order, that is, most significant byte - (octet) first. This byte order is commonly known as big-endian. The - transmission order is described in detail in Appendix B of RFC 791 - [6]. Unless otherwise noted, numeric constants are in decimal (base - 10). - -11.1 Message Header - - All STUN messages consist of a 20 byte header: - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | STUN Message Type | Message Length | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - Transaction ID - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - The Message Types can take on the following values: - - 0x0001 : Binding Request - 0x0101 : Binding Response - 0x0111 : Binding Error Response - 0x0002 : Shared Secret Request - 0x0102 : Shared Secret Response - 0x0112 : Shared Secret Error Response - - The message length is the count, in bytes, of the size of the - message, not including the 20 byte header. - - The transaction ID is a 128 bit identifier. It also serves as salt - to randomize the request and the response. All responses carry the - same identifier as the request they correspond to. - - - - - - - -Rosenberg, et al. Standards Track [Page 25] - -RFC 3489 STUN March 2003 - - -11.2 Message Attributes - - After the header are 0 or more attributes. Each attribute is TLV - encoded, with a 16 bit type, 16 bit length, and variable value: - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Type | Length | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Value .... - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - The following types are defined: - - 0x0001: MAPPED-ADDRESS - 0x0002: RESPONSE-ADDRESS - 0x0003: CHANGE-REQUEST - 0x0004: SOURCE-ADDRESS - 0x0005: CHANGED-ADDRESS - 0x0006: USERNAME - 0x0007: PASSWORD - 0x0008: MESSAGE-INTEGRITY - 0x0009: ERROR-CODE - 0x000a: UNKNOWN-ATTRIBUTES - 0x000b: REFLECTED-FROM - - To allow future revisions of this specification to add new attributes - if needed, the attribute space is divided into optional and mandatory - ones. Attributes with values greater than 0x7fff are optional, which - means that the message can be processed by the client or server even - though the attribute is not understood. Attributes with values less - than or equal to 0x7fff are mandatory to understand, which means that - the client or server cannot process the message unless it understands - the attribute. - - The MESSAGE-INTEGRITY attribute MUST be the last attribute within a - message. Any attributes that are known, but are not supposed to be - present in a message (MAPPED-ADDRESS in a request, for example) MUST - be ignored. - - Table 2 indicates which attributes are present in which messages. An - M indicates that inclusion of the attribute in the message is - mandatory, O means its optional, C means it's conditional based on - some other aspect of the message, and N/A means that the attribute is - not applicable to that message type. - - - - - -Rosenberg, et al. Standards Track [Page 26] - -RFC 3489 STUN March 2003 - - - Binding Shared Shared Shared - Binding Binding Error Secret Secret Secret - Att. Req. Resp. Resp. Req. Resp. Error - Resp. - _____________________________________________________________________ - MAPPED-ADDRESS N/A M N/A N/A N/A N/A - RESPONSE-ADDRESS O N/A N/A N/A N/A N/A - CHANGE-REQUEST O N/A N/A N/A N/A N/A - SOURCE-ADDRESS N/A M N/A N/A N/A N/A - CHANGED-ADDRESS N/A M N/A N/A N/A N/A - USERNAME O N/A N/A N/A M N/A - PASSWORD N/A N/A N/A N/A M N/A - MESSAGE-INTEGRITY O O N/A N/A N/A N/A - ERROR-CODE N/A N/A M N/A N/A M - UNKNOWN-ATTRIBUTES N/A N/A C N/A N/A C - REFLECTED-FROM N/A C N/A N/A N/A N/A - - Table 2: Summary of Attributes - - The length refers to the length of the value element, expressed as an - unsigned integral number of bytes. - -11.2.1 MAPPED-ADDRESS - - The MAPPED-ADDRESS attribute indicates the mapped IP address and - port. It consists of an eight bit address family, and a sixteen bit - port, followed by a fixed length value representing the IP address. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |x x x x x x x x| Family | Port | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Address | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - The port is a network byte ordered representation of the mapped port. - The address family is always 0x01, corresponding to IPv4. The first - 8 bits of the MAPPED-ADDRESS are ignored, for the purposes of - aligning parameters on natural boundaries. The IPv4 address is 32 - bits. - -11.2.2 RESPONSE-ADDRESS - - The RESPONSE-ADDRESS attribute indicates where the response to a - Binding Request should be sent. Its syntax is identical to MAPPED- - ADDRESS. - - - - -Rosenberg, et al. Standards Track [Page 27] - -RFC 3489 STUN March 2003 - - -11.2.3 CHANGED-ADDRESS - - The CHANGED-ADDRESS attribute indicates the IP address and port where - responses would have been sent from if the "change IP" and "change - port" flags had been set in the CHANGE-REQUEST attribute of the - Binding Request. The attribute is always present in a Binding - Response, independent of the value of the flags. Its syntax is - identical to MAPPED-ADDRESS. - -11.2.4 CHANGE-REQUEST - - The CHANGE-REQUEST attribute is used by the client to request that - the server use a different address and/or port when sending the - response. The attribute is 32 bits long, although only two bits (A - and B) are used: - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A B 0| - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - The meaning of the flags is: - - A: This is the "change IP" flag. If true, it requests the server - to send the Binding Response with a different IP address than the - one the Binding Request was received on. - - B: This is the "change port" flag. If true, it requests the - server to send the Binding Response with a different port than the - one the Binding Request was received on. - -11.2.5 SOURCE-ADDRESS - - The SOURCE-ADDRESS attribute is present in Binding Responses. It - indicates the source IP address and port that the server is sending - the response from. Its syntax is identical to that of MAPPED- - ADDRESS. - -11.2.6 USERNAME - - The USERNAME attribute is used for message integrity. It serves as a - means to identify the shared secret used in the message integrity - check. The USERNAME is always present in a Shared Secret Response, - along with the PASSWORD. It is optionally present in a Binding - Request when message integrity is used. - - - - - -Rosenberg, et al. Standards Track [Page 28] - -RFC 3489 STUN March 2003 - - - The value of USERNAME is a variable length opaque value. Its length - MUST be a multiple of 4 (measured in bytes) in order to guarantee - alignment of attributes on word boundaries. - -11.2.7 PASSWORD - - The PASSWORD attribute is used in Shared Secret Responses. It is - always present in a Shared Secret Response, along with the USERNAME. - - The value of PASSWORD is a variable length value that is to be used - as a shared secret. Its length MUST be a multiple of 4 (measured in - bytes) in order to guarantee alignment of attributes on word - boundaries. - -11.2.8 MESSAGE-INTEGRITY - - The MESSAGE-INTEGRITY attribute contains an HMAC-SHA1 [13] of the - STUN message. It can be present in Binding Requests or Binding - Responses. Since it uses the SHA1 hash, the HMAC will be 20 bytes. - The text used as input to HMAC is the STUN message, including the - header, up to and including the attribute preceding the MESSAGE- - INTEGRITY attribute. That text is then padded with zeroes so as to be - a multiple of 64 bytes. As a result, the MESSAGE-INTEGRITY attribute - MUST be the last attribute in any STUN message. The key used as - input to HMAC depends on the context. - -11.2.9 ERROR-CODE - - The ERROR-CODE attribute is present in the Binding Error Response and - Shared Secret Error Response. It is a numeric value in the range of - 100 to 699 plus a textual reason phrase encoded in UTF-8, and is - consistent in its code assignments and semantics with SIP [10] and - HTTP [15]. The reason phrase is meant for user consumption, and can - be anything appropriate for the response code. The lengths of the - reason phrases MUST be a multiple of 4 (measured in bytes). This can - be accomplished by added spaces to the end of the text, if necessary. - Recommended reason phrases for the defined response codes are - presented below. - - To facilitate processing, the class of the error code (the hundreds - digit) is encoded separately from the rest of the code. - - - - - - - - - - -Rosenberg, et al. Standards Track [Page 29] - -RFC 3489 STUN March 2003 - - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | 0 |Class| Number | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Reason Phrase (variable) .. - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - The class represents the hundreds digit of the response code. The - value MUST be between 1 and 6. The number represents the response - code modulo 100, and its value MUST be between 0 and 99. - - The following response codes, along with their recommended reason - phrases (in brackets) are defined at this time: - - 400 (Bad Request): The request was malformed. The client should not - retry the request without modification from the previous - attempt. - - 401 (Unauthorized): The Binding Request did not contain a MESSAGE- - INTEGRITY attribute. - - 420 (Unknown Attribute): The server did not understand a mandatory - attribute in the request. - - 430 (Stale Credentials): The Binding Request did contain a MESSAGE- - INTEGRITY attribute, but it used a shared secret that has - expired. The client should obtain a new shared secret and try - again. - - 431 (Integrity Check Failure): The Binding Request contained a - MESSAGE-INTEGRITY attribute, but the HMAC failed verification. - This could be a sign of a potential attack, or client - implementation error. - - 432 (Missing Username): The Binding Request contained a MESSAGE- - INTEGRITY attribute, but not a USERNAME attribute. Both must be - present for integrity checks. - - 433 (Use TLS): The Shared Secret request has to be sent over TLS, but - was not received over TLS. - - 500 (Server Error): The server has suffered a temporary error. The - client should try again. - - 600 (Global Failure:) The server is refusing to fulfill the request. - The client should not retry. - - - - -Rosenberg, et al. Standards Track [Page 30] - -RFC 3489 STUN March 2003 - - -11.2.10 UNKNOWN-ATTRIBUTES - - The UNKNOWN-ATTRIBUTES attribute is present only in a Binding Error - Response or Shared Secret Error Response when the response code in - the ERROR-CODE attribute is 420. - - The attribute contains a list of 16 bit values, each of which - represents an attribute type that was not understood by the server. - If the number of unknown attributes is an odd number, one of the - attributes MUST be repeated in the list, so that the total length of - the list is a multiple of 4 bytes. - - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Attribute 1 Type | Attribute 2 Type | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Attribute 3 Type | Attribute 4 Type ... - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - -11.2.11 REFLECTED-FROM - - The REFLECTED-FROM attribute is present only in Binding Responses, - when the Binding Request contained a RESPONSE-ADDRESS attribute. The - attribute contains the identity (in terms of IP address) of the - source where the request came from. Its purpose is to provide - traceability, so that a STUN server cannot be used as a reflector for - denial-of-service attacks. - - Its syntax is identical to the MAPPED-ADDRESS attribute. - -12. Security Considerations - -12.1 Attacks on STUN - - Generally speaking, attacks on STUN can be classified into denial of - service attacks and eavesdropping attacks. Denial of service attacks - can be launched against a STUN server itself, or against other - elements using the STUN protocol. - - STUN servers create state through the Shared Secret Request - mechanism. To prevent being swamped with traffic, a STUN server - SHOULD limit the number of simultaneous TLS connections it will hold - open by dropping an existing connection when a new connection request - arrives (based on an Least Recently Used (LRU) policy, for example). - Similarly, it SHOULD limit the number of shared secrets it will - store, in the event that the server is storing the shared secrets. - - - - -Rosenberg, et al. Standards Track [Page 31] - -RFC 3489 STUN March 2003 - - - The attacks of greater interest are those in which the STUN server - and client are used to launch DOS attacks against other entities, - including the client itself. - - Many of the attacks require the attacker to generate a response to a - legitimate STUN request, in order to provide the client with a faked - MAPPED-ADDRESS. The attacks that can be launched using such a - technique include: - -12.1.1 Attack I: DDOS Against a Target - - In this case, the attacker provides a large number of clients with - the same faked MAPPED-ADDRESS that points to the intended target. - This will trick all the STUN clients into thinking that their - addresses are equal to that of the target. The clients then hand out - that address in order to receive traffic on it (for example, in SIP - or H.323 messages). However, all of that traffic becomes focused at - the intended target. The attack can provide substantial - amplification, especially when used with clients that are using STUN - to enable multimedia applications. - -12.1.2 Attack II: Silencing a Client - - In this attack, the attacker seeks to deny a client access to - services enabled by STUN (for example, a client using STUN to enable - SIP-based multimedia traffic). To do that, the attacker provides - that client with a faked MAPPED-ADDRESS. The MAPPED-ADDRESS it - provides is an IP address that routes to nowhere. As a result, the - client won't receive any of the packets it expects to receive when it - hands out the MAPPED-ADDRESS. - - This exploitation is not very interesting for the attacker. It - impacts a single client, which is frequently not the desired target. - Moreover, any attacker that can mount the attack could also deny - service to the client by other means, such as preventing the client - from receiving any response from the STUN server, or even a DHCP - server. - -12.1.3 Attack III: Assuming the Identity of a Client - - This attack is similar to attack II. However, the faked MAPPED- - ADDRESS points to the attacker themself. This allows the attacker to - receive traffic which was destined for the client. - - - - - - - - -Rosenberg, et al. Standards Track [Page 32] - -RFC 3489 STUN March 2003 - - -12.1.4 Attack IV: Eavesdropping - - In this attack, the attacker forces the client to use a MAPPED- - ADDRESS that routes to itself. It then forwards any packets it - receives to the client. This attack would allow the attacker to - observe all packets sent to the client. However, in order to launch - the attack, the attacker must have already been able to observe - packets from the client to the STUN server. In most cases (such as - when the attack is launched from an access network), this means that - the attacker could already observe packets sent to the client. This - attack is, as a result, only useful for observing traffic by - attackers on the path from the client to the STUN server, but not - generally on the path of packets being routed towards the client. - -12.2 Launching the Attacks - - It is important to note that attacks of this nature (injecting - responses with fake MAPPED-ADDRESSes) require that the attacker be - capable of eavesdropping requests sent from the client to the server - (or to act as a MITM for such attacks). This is because STUN - requests contain a transaction identifier, selected by the client, - which is random with 128 bits of entropy. The server echoes this - value in the response, and the client ignores any responses that - don't have a matching transaction ID. Therefore, in order for an - attacker to provide a faked response that is accepted by the client, - the attacker needs to know what the transaction ID in the request - was. The large amount of randomness, combined with the need to know - when the client sends a request, precludes attacks that involve - guessing the transaction ID. - - Since all of the above attacks rely on this one primitive - injecting - a response with a faked MAPPED-ADDRESS - preventing the attacks is - accomplished by preventing this one operation. To prevent it, we - need to consider the various ways in which it can be accomplished. - There are several: - -12.2.1 Approach I: Compromise a Legitimate STUN Server - - In this attack, the attacker compromises a legitimate STUN server - through a virus or Trojan horse. Presumably, this would allow the - attacker to take over the STUN server, and control the types of - responses it generates. - - Compromise of a STUN server can also lead to discovery of open ports. - Knowledge of an open port creates an opportunity for DoS attacks on - those ports (or DDoS attacks if the traversed NAT is a full cone - NAT). Discovering open ports is already fairly trivial using port - probing, so this does not represent a major threat. - - - -Rosenberg, et al. Standards Track [Page 33] - -RFC 3489 STUN March 2003 - - -12.2.2 Approach II: DNS Attacks - - STUN servers are discovered using DNS SRV records. If an attacker - can compromise the DNS, it can inject fake records which map a domain - name to the IP address of a STUN server run by the attacker. This - will allow it to inject fake responses to launch any of the attacks - above. - -12.2.3 Approach III: Rogue Router or NAT - - Rather than compromise the STUN server, an attacker can cause a STUN - server to generate responses with the wrong MAPPED-ADDRESS by - compromising a router or NAT on the path from the client to the STUN - server. When the STUN request passes through the rogue router or - NAT, it rewrites the source address of the packet to be that of the - desired MAPPED-ADDRESS. This address cannot be arbitrary. If the - attacker is on the public Internet (that is, there are no NATs - between it and the STUN server), and the attacker doesn't modify the - STUN request, the address has to have the property that packets sent - from the STUN server to that address would route through the - compromised router. This is because the STUN server will send the - responses back to the source address of the request. With a modified - source address, the only way they can reach the client is if the - compromised router directs them there. If the attacker is on the - public Internet, but they can modify the STUN request, they can - insert a RESPONSE-ADDRESS attribute into the request, containing the - actual source address of the STUN request. This will cause the - server to send the response to the client, independent of the source - address the STUN server sees. This gives the attacker the ability to - forge an arbitrary source address when it forwards the STUN request. - - If the attacker is on a private network (that is, there are NATs - between it and the STUN server), the attacker will not be able to - force the server to generate arbitrary MAPPED-ADRESSes in responses. - They will only be able force the STUN server to generate MAPPED- - ADDRESSes which route to the private network. This is because the - NAT between the attacker and the STUN server will rewrite the source - address of the STUN request, mapping it to a public address that - routes to the private network. Because of this, the attacker can - only force the server to generate faked mapped addresses that route - to the private network. Unfortunately, it is possible that a low - quality NAT would be willing to map an allocated public address to - another public address (as opposed to an internal private address), - in which case the attacker could forge the source address in a STUN - request to be an arbitrary public address. This kind of behavior - from NATs does appear to be rare. - - - - - -Rosenberg, et al. Standards Track [Page 34] - -RFC 3489 STUN March 2003 - - -12.2.4 Approach IV: MITM - - As an alternative to approach III, if the attacker can place an - element on the path from the client to the server, the element can - act as a man-in-the-middle. In that case, it can intercept a STUN - request, and generate a STUN response directly with any desired value - of the MAPPED-ADDRESS field. Alternatively, it can forward the STUN - request to the server (after potential modification), receive the - response, and forward it to the client. When forwarding the request - and response, this attack is subject to the same limitations on the - MAPPED-ADDRESS described in Section 12.2.3. - -12.2.5 Approach V: Response Injection Plus DoS - - In this approach, the attacker does not need to be a MITM (as in - approaches III and IV). Rather, it only needs to be able to - eavesdrop onto a network segment that carries STUN requests. This is - easily done in multiple access networks such as ethernet or - unprotected 802.11. To inject the fake response, the attacker - listens on the network for a STUN request. When it sees one, it - simultaneously launches a DoS attack on the STUN server, and - generates its own STUN response with the desired MAPPED-ADDRESS - value. The STUN response generated by the attacker will reach the - client, and the DoS attack against the server is aimed at preventing - the legitimate response from the server from reaching the client. - Arguably, the attacker can do without the DoS attack on the server, - so long as the faked response beats the real response back to the - client, and the client uses the first response, and ignores the - second (even though it's different). - -12.2.6 Approach VI: Duplication - - This approach is similar to approach V. The attacker listens on the - network for a STUN request. When it sees it, it generates its own - STUN request towards the server. This STUN request is identical to - the one it saw, but with a spoofed source IP address. The spoofed - address is equal to the one that the attacker desires to have placed - in the MAPPED-ADDRESS of the STUN response. In fact, the attacker - generates a flood of such packets. The STUN server will receive the - one original request, plus a flood of duplicate fake ones. It - generates responses to all of them. If the flood is sufficiently - large for the responses to congest routers or some other equipment, - there is a reasonable probability that the one real response is lost - (along with many of the faked ones), but the net result is that only - the faked responses are received by the STUN client. These responses - are all identical and all contain the MAPPED-ADDRESS that the - attacker wanted the client to use. - - - - -Rosenberg, et al. Standards Track [Page 35] - -RFC 3489 STUN March 2003 - - - The flood of duplicate packets is not needed (that is, only one faked - request is sent), so long as the faked response beats the real - response back to the client, and the client uses the first response, - and ignores the second (even though it's different). - - Note that, in this approach, launching a DoS attack against the STUN - server or the IP network, to prevent the valid response from being - sent or received, is problematic. The attacker needs the STUN server - to be available to handle its own request. Due to the periodic - retransmissions of the request from the client, this leaves a very - tiny window of opportunity. The attacker must start the DoS attack - immediately after the actual request from the client, causing the - correct response to be discarded, and then cease the DoS attack in - order to send its own request, all before the next retransmission - from the client. Due to the close spacing of the retransmits (100ms - to a few seconds), this is very difficult to do. - - Besides DoS attacks, there may be other ways to prevent the actual - request from the client from reaching the server. Layer 2 - manipulations, for example, might be able to accomplish it. - - Fortunately, Approach IV is subject to the same limitations - documented in Section 12.2.3, which limit the range of MAPPED- - ADDRESSes the attacker can cause the STUN server to generate. - -12.3 Countermeasures - - STUN provides mechanisms to counter the approaches described above, - and additional, non-STUN techniques can be used as well. - - First off, it is RECOMMENDED that networks with STUN clients - implement ingress source filtering (RFC 2827 [7]). This is - particularly important for the NATs themselves. As Section 12.2.3 - explains, NATs which do not perform this check can be used as - "reflectors" in DDoS attacks. Most NATs do perform this check as a - default mode of operation. We strongly advise people that purchase - NATs to ensure that this capability is present and enabled. - - Secondly, it is RECOMMENDED that STUN servers be run on hosts - dedicated to STUN, with all UDP and TCP ports disabled except for the - STUN ports. This is to prevent viruses and Trojan horses from - infecting STUN servers, in order to prevent their compromise. This - helps mitigate Approach I (Section 12.2.1). - - Thirdly, to prevent the DNS attack of Section 12.2.2, Section 9.2 - recommends that the client verify the credentials provided by the - server with the name used in the DNS lookup. - - - - -Rosenberg, et al. Standards Track [Page 36] - -RFC 3489 STUN March 2003 - - - Finally, all of the attacks above rely on the client taking the - mapped address it learned from STUN, and using it in application - layer protocols. If encryption and message integrity are provided - within those protocols, the eavesdropping and identity assumption - attacks can be prevented. As such, applications that make use of - STUN addresses in application protocols SHOULD use integrity and - encryption, even if a SHOULD level strength is not specified for that - protocol. For example, multimedia applications using STUN addresses - to receive RTP traffic would use secure RTP [16]. - - The above three techniques are non-STUN mechanisms. STUN itself - provides several countermeasures. - - Approaches IV (Section 12.2.4), when generating the response locally, - and V (Section 12.2.5) require an attacker to generate a faked - response. This attack is prevented using the message integrity - mechanism provided in STUN, described in Section 8.1. - - Approaches III (Section 12.2.3) IV (Section 12.2.4), when using the - relaying technique, and VI (12.2.6), however, are not preventable - through server signatures. Both approaches are most potent when the - attacker can modify the request, inserting a RESPONSE-ADDRESS that - routes to the client. Fortunately, such modifications are - preventable using the message integrity techniques described in - Section 9.3. However, these three approaches are still functional - when the attacker modifies nothing but the source address of the STUN - request. Sadly, this is the one thing that cannot be protected - through cryptographic means, as this is the change that STUN itself - is seeking to detect and report. It is therefore an inherent - weakness in NAT, and not fixable in STUN. To help mitigate these - attacks, Section 9.4 provides several heuristics for the client to - follow. The client looks for inconsistent or extra responses, both - of which are signs of the attacks described above. However, these - heuristics are just that - heuristics, and cannot be guaranteed to - prevent attacks. The heuristics appear to prevent the attacks as we - know how to launch them today. Implementors should stay posted for - information on new heuristics that might be required in the future. - Such information will be distributed on the IETF MIDCOM mailing list, - midcom@ietf.org. - -12.4 Residual Threats - - None of the countermeasures listed above can prevent the attacks - described in Section 12.2.3 if the attacker is in the appropriate - network paths. Specifically, consider the case in which the attacker - wishes to convince client C that it has address V. The attacker - needs to have a network element on the path between A and the server - (in order to modify the request) and on the path between the server - - - -Rosenberg, et al. Standards Track [Page 37] - -RFC 3489 STUN March 2003 - - - and V so that it can forward the response to C. Furthermore, if - there is a NAT between the attacker and the server, V must also be - behind the same NAT. In such a situation, the attacker can either - gain access to all the application-layer traffic or mount the DDOS - attack described in Section 12.1.1. Note that any host which exists - in the correct topological relationship can be DDOSed. It need not - be using STUN. - -13. IANA Considerations - - STUN cannot be extended. Changes to the protocol are made through a - standards track revision of this specification. As a result, no IANA - registries are needed. Any future extensions will establish any - needed registries. - -14. IAB Considerations - - The IAB has studied the problem of "Unilateral Self Address Fixing", - which is the general process by which a client attempts to determine - its address in another realm on the other side of a NAT through a - collaborative protocol reflection mechanism (RFC 3424 [17]). STUN is - an example of a protocol that performs this type of function. The - IAB has mandated that any protocols developed for this purpose - document a specific set of considerations. This section meets those - requirements. - -14.1 Problem Definition - - From RFC 3424 [17], any UNSAF proposal must provide: - - Precise definition of a specific, limited-scope problem that is to - be solved with the UNSAF proposal. A short term fix should not be - generalized to solve other problems; this is why "short term fixes - usually aren't". - - The specific problems being solved by STUN are: - - o Provide a means for a client to detect the presence of one or more - NATs between it and a server run by a service provider on the - public Internet. The purpose of such detection is to determine - additional steps that might be necessary in order to receive - service from that particular provider. - - o Provide a means for a client to detect the presence of one or more - NATs between it and another client, where the second client is - reachable from the first, but it is not known whether the second - client resides on the public Internet. - - - - -Rosenberg, et al. Standards Track [Page 38] - -RFC 3489 STUN March 2003 - - - o Provide a means for a client to obtain an address on the public - Internet from a non-symmetric NAT, for the express purpose of - receiving incoming UDP traffic from another host, targeted to that - address. - - STUN does not address TCP, either incoming or outgoing, and does not - address outgoing UDP communications. - -14.2 Exit Strategy - - From [17], any UNSAF proposal must provide: - - Description of an exit strategy/transition plan. The better short - term fixes are the ones that will naturally see less and less use - as the appropriate technology is deployed. - - STUN comes with its own built in exit strategy. This strategy is the - detection operation that is performed as a precursor to the actual - UNSAF address-fixing operation. This discovery operation, documented - in Section 10.1, attempts to discover the existence of, and type of, - any NATS between the client and the service provider network. Whilst - the detection of the specific type of NAT may be brittle, the - discovery of the existence of NAT is itself quite robust. As NATs - are phased out through the deployment of IPv6, the discovery - operation will return immediately with the result that there is no - NAT, and no further operations are required. Indeed, the discovery - operation itself can be used to help motivate deployment of IPv6; if - a user detects a NAT between themselves and the public Internet, they - can call up their access provider and complain about it. - - STUN can also help facilitate the introduction of midcom. As - midcom-capable NATs are deployed, applications will, instead of using - STUN (which also resides at the application layer), first allocate an - address binding using midcom. However, it is a well-known limitation - of midcom that it only works when the agent knows the middleboxes - through which its traffic will flow. Once bindings have been - allocated from those middleboxes, a STUN detection procedure can - validate that there are no additional middleboxes on the path from - the public Internet to the client. If this is the case, the - application can continue operation using the address bindings - allocated from midcom. If it is not the case, STUN provides a - mechanism for self-address fixing through the remaining midcom- - unaware middleboxes. Thus, STUN provides a way to help transition to - full midcom-aware networks. - - - - - - - -Rosenberg, et al. Standards Track [Page 39] - -RFC 3489 STUN March 2003 - - -14.3 Brittleness Introduced by STUN - - From [17], any UNSAF proposal must provide: - - Discussion of specific issues that may render systems more - "brittle". For example, approaches that involve using data at - multiple network layers create more dependencies, increase - debugging challenges, and make it harder to transition. - - STUN introduces brittleness into the system in several ways: - - o The discovery process assumes a certain classification of devices - based on their treatment of UDP. There could be other types of - NATs that are deployed that would not fit into one of these molds. - Therefore, future NATs may not be properly detected by STUN. STUN - clients (but not servers) would need to change to accommodate - that. - - o The binding acquisition usage of STUN does not work for all NAT - types. It will work for any application for full cone NATs only. - For restricted cone and port restricted cone NAT, it will work for - some applications depending on the application. Application - specific processing will generally be needed. For symmetric NATs, - the binding acquisition will not yield a usable address. The - tight dependency on the specific type of NAT makes the protocol - brittle. - - o STUN assumes that the server exists on the public Internet. If - the server is located in another private address realm, the user - may or may not be able to use its discovered address to - communicate with other users. There is no way to detect such a - condition. - - o The bindings allocated from the NAT need to be continuously - refreshed. Since the timeouts for these bindings is very - implementation specific, the refresh interval cannot easily be - determined. When the binding is not being actively used to - receive traffic, but to wait for an incoming message, the binding - refresh will needlessly consume network bandwidth. - - o The use of the STUN server as an additional network element - introduces another point of potential security attack. These - attacks are largely prevented by the security measures provided by - STUN, but not entirely. - - - - - - - -Rosenberg, et al. Standards Track [Page 40] - -RFC 3489 STUN March 2003 - - - o The use of the STUN server as an additional network element - introduces another point of failure. If the client cannot locate - a STUN server, or if the server should be unavailable due to - failure, the application cannot function. - - o The use of STUN to discover address bindings will result in an - increase in latency for applications. For example, a Voice over - IP application will see an increase of call setup delays equal to - at least one RTT to the STUN server. - - o The discovery of binding lifetimes is prone to error. It assumes - that the same lifetime will exist for all bindings. This may not - be true if the NAT uses dynamic binding lifetimes to handle - overload, or if the NAT itself reboots during the discovery - process. - - o STUN imposes some restrictions on the network topologies for - proper operation. If client A obtains an address from STUN server - X, and sends it to client B, B may not be able to send to A using - that IP address. The address will not work if any of the - following is true: - - - The STUN server is not in an address realm that is a common - ancestor (topologically) of both clients A and B. For example, - consider client A and B, both of which have residential NAT - devices. Both devices connect them to their cable operators, - but both clients have different providers. Each provider has a - NAT in front of their entire network, connecting it to the - public Internet. If the STUN server used by A is in A's cable - operator's network, an address obtained by it will not be - usable by B. The STUN server must be in the network which is a - common ancestor to both - in this case, the public Internet. - - - The STUN server is in an address realm that is a common - ancestor to both clients, but both clients are behind the same - NAT connecting to that address realm. For example, if the two - clients in the previous example had the same cable operator, - that cable operator had a single NAT connecting their network - to the public Internet, and the STUN server was on the public - Internet, the address obtained by A would not be usable by B. - That is because some NATs will not accept an internal packet - sent to a public IP address which is mapped back to an internal - address. To deal with this, additional protocol mechanisms or - configuration parameters need to be introduced which detect - this case. - - - - - - -Rosenberg, et al. Standards Track [Page 41] - -RFC 3489 STUN March 2003 - - - o Most significantly, STUN introduces potential security threats - which cannot be eliminated. This specification describes - heuristics that can be used to mitigate the problem, but it is - provably unsolvable given what STUN is trying to accomplish. - These security problems are described fully in Section 12. - -14.4 Requirements for a Long Term Solution - - From [17], any UNSAF proposal must provide: - - Identify requirements for longer term, sound technical solutions - -- contribute to the process of finding the right longer term - solution. - - Our experience with STUN has led to the following requirements for a - long term solution to the NAT problem: - - Requests for bindings and control of other resources in a NAT - need to be explicit. Much of the brittleness in STUN derives from - its guessing at the parameters of the NAT, rather than telling the - NAT what parameters to use. - - Control needs to be "in-band". There are far too many scenarios - in which the client will not know about the location of - middleboxes ahead of time. Instead, control of such boxes needs - to occur in-band, traveling along the same path as the data will - itself travel. This guarantees that the right set of middleboxes - are controlled. This is only true for first-party controls; - third-party controls are best handled using the midcom framework. - - Control needs to be limited. Users will need to communicate - through NATs which are outside of their administrative control. - In order for providers to be willing to deploy NATs which can be - controlled by users in different domains, the scope of such - controls needs to be extremely limited - typically, allocating a - binding to reach the address where the control packets are coming - from. - - Simplicity is Paramount. The control protocol will need to be - implement in very simple clients. The servers will need to - support extremely high loads. The protocol will need to be - extremely robust, being the precursor to a host of application - protocols. As such, simplicity is key. - - - - - - - - -Rosenberg, et al. Standards Track [Page 42] - -RFC 3489 STUN March 2003 - - -14.5 Issues with Existing NAPT Boxes - - From [17], any UNSAF proposal must provide: - - Discussion of the impact of the noted practical issues with - existing, deployed NA[P]Ts and experience reports. - - Several of the practical issues with STUN involve future proofing - - breaking the protocol when new NAT types get deployed. Fortunately, - this is not an issue at the current time, since most of the deployed - NATs are of the types assumed by STUN. The primary usage STUN has - found is in the area of VoIP, to facilitate allocation of addresses - for receiving RTP [12] traffic. In that application, the periodic - keepalives are provided by the RTP traffic itself. However, several - practical problems arise for RTP. First, RTP assumes that RTCP - traffic is on a port one higher than the RTP traffic. This pairing - property cannot be guaranteed through NATs that are not directly - controllable. As a result, RTCP traffic may not be properly - received. Protocol extensions to SDP have been proposed which - mitigate this by allowing the client to signal a different port for - RTCP [18]. However, there will be interoperability problems for some - time. - - For VoIP, silence suppression can cause a gap in the transmission of - RTP packets. This could result in the loss of a binding in the - middle of a call, if that silence period exceeds the binding timeout. - This can be mitigated by sending occasional silence packets to keep - the binding alive. However, the result is additional brittleness; - proper operation depends on the silence suppression algorithm in use, - the usage of a comfort noise codec, the duration of the silence - period, and the binding lifetime in the NAT. - -14.6 In Closing - - The problems with STUN are not design flaws in STUN. The problems in - STUN have to do with the lack of standardized behaviors and controls - in NATs. The result of this lack of standardization has been a - proliferation of devices whose behavior is highly unpredictable, - extremely variable, and uncontrollable. STUN does the best it can in - such a hostile environment. Ultimately, the solution is to make the - environment less hostile, and to introduce controls and standardized - behaviors into NAT. However, until such time as that happens, STUN - provides a good short term solution given the terrible conditions - under which it is forced to operate. - - - - - - - -Rosenberg, et al. Standards Track [Page 43] - -RFC 3489 STUN March 2003 - - -15. Acknowledgments - - The authors would like to thank Cedric Aoun, Pete Cordell, Cullen - Jennings, Bob Penfield and Chris Sullivan for their comments, and - Baruch Sterman and Alan Hawrylyshen for initial implementations. - Thanks for Leslie Daigle, Allison Mankin, Eric Rescorla, and Henning - Schulzrinne for IESG and IAB input on this work. - -16. Normative References - - [1] Bradner, S., "Key words for use in RFCs to indicate requirement - levels", BCP 14, RFC 2119, March 1997. - - [2] Dierks, T. and C. Allen, "The TLS protocol Version 1.0", RFC - 2246, January 1999. - - [3] Gulbrandsen, A., Vixie, P. and L. Esibov, "A DNS RR for - specifying the location of services (DNS SRV)", RFC 2782, - February 2000. - - [4] Chown, P., "Advanced Encryption Standard (AES) Ciphersuites for - Transport Layer Security (TLS)", RFC 3268, June 2002. - - [5] Rescorla, E., "HTTP over TLS", RFC 2818, May 2000. - - [6] Postel, J., "Internet Protocol", STD 5, RFC 791, September 1981. - - [7] Ferguson, P. and D. Senie, "Network Ingress Filtering: Defeating - Denial of Service Attacks which employ IP Source Address - Spoofing", BCP 38, RFC 2827, May 2000. - -17. Informative References - - [8] Senie, D., "Network Address Translator (NAT)-Friendly - Application Design Guidelines", RFC 3235, January 2002. - - [9] Srisuresh, P., Kuthan, J., Rosenberg, J., Molitor, A. and A. - Rayhan, "Middlebox Communication Architecture and Framework", - RFC 3303, August 2002. - - [10] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., - Peterson, J., Sparks, R., Handley, M. and E. Schooler, "SIP: - Session Initiation Protocol", RFC 3261, June 2002. - - [11] Holdrege, M. and P. Srisuresh, "Protocol Complications with the - IP Network Address Translator", RFC 3027, January 2001. - - - - - -Rosenberg, et al. Standards Track [Page 44] - -RFC 3489 STUN March 2003 - - - [12] Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson, - "RTP: A Transport Protocol for Real-Time Applications", RFC - 1889, January 1996. - - [13] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: Keyed-Hashing - for Message Authentication", RFC 2104, February 1997. - - [14] Kohl, J. and C. Neuman, "The kerberos Network Authentication - Service (V5)", RFC 1510, September 1993. - - [15] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., - Leach, P. and T. Berners-Lee, "Hypertext Transfer Protocol -- - HTTP/1.1", RFC 2616, June 1999. - - [16] Baugher M., et al., "The secure real-time transport protocol", - Work in Progress. - - [17] Daigle, L., Editor, "IAB Considerations for UNilateral Self- - Address Fixing (UNSAF) Across Network Address Translation", RFC - 3424, November 2002. - - [18] Huitema, C., "RTCP attribute in SDP", Work in Progress. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Rosenberg, et al. Standards Track [Page 45] - -RFC 3489 STUN March 2003 - - -18. Authors' Addresses - - Jonathan Rosenberg - dynamicsoft - 72 Eagle Rock Avenue - First Floor - East Hanover, NJ 07936 - - EMail: jdrosen@dynamicsoft.com - - - Joel Weinberger - dynamicsoft - 72 Eagle Rock Avenue - First Floor - East Hanover, NJ 07936 - - EMail: jweinberger@dynamicsoft.com - - - Christian Huitema - Microsoft Corporation - One Microsoft Way - Redmond, WA 98052-6399 - - EMail: huitema@microsoft.com - - - Rohan Mahy - Cisco Systems - 101 Cooper St - Santa Cruz, CA 95060 - - EMail: rohan@cisco.com - - - - - - - - - - - - - - - - - -Rosenberg, et al. Standards Track [Page 46] - -RFC 3489 STUN March 2003 - - -19. Full Copyright Statement - - Copyright (C) The Internet Society (2003). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -Acknowledgement - - Funding for the RFC Editor function is currently provided by the - Internet Society. - - - - - - - - - - - - - - - - - - - -Rosenberg, et al. Standards Track [Page 47] - diff --git a/libs/stund/root.pem b/libs/stund/root.pem deleted file mode 100644 index 3495f58c7c75cc36101bf0860f8403dd28a5ec3e..0000000000000000000000000000000000000000 --- a/libs/stund/root.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDWTCCAsKgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBgDELMAkGA1UEBhMCVUEx -CzAJBgNVBAgTAkNBMREwDwYDVQQHEwhNaWxwaXRhczEOMAwGA1UEChMFRm9vQ28x -EzARBgNVBAsTCndpZGdldCBkaXYxEjAQBgNVBAMTCWxvY2FsaG9zdDEYMBYGCSqG -SIb3DQEJARYJZm9vQGZvby5jMB4XDTAyMTEwMTAzMDUwOFoXDTAyMTIwMTAzMDUw -OFowgYAxCzAJBgNVBAYTAlVBMQswCQYDVQQIEwJDQTERMA8GA1UEBxMITWlscGl0 -YXMxDjAMBgNVBAoTBUZvb0NvMRMwEQYDVQQLEwp3aWRnZXQgZGl2MRIwEAYDVQQD -Ewlsb2NhbGhvc3QxGDAWBgkqhkiG9w0BCQEWCWZvb0Bmb28uYzCBnzANBgkqhkiG -9w0BAQEFAAOBjQAwgYkCgYEAwgvATkHnZzuN3poEtJ+l3p8rWlRVN4QnT4hW/pxI -kZgs+U3/2QX2HZtGBcm+YJCfAICWdsnMDwhPlyp/YXdpyhe2wkl1LdukvMav8j+H -shEQdcO+qPrjUZ8VLkMsMxM56b+UNT1m3CEoQ3qnIGuIb0DjvwfJRaiTo15LZv5j -1wkCAwEAAaOB4DCB3TAdBgNVHQ4EFgQUlnqNTIdfldOWBuAsqXVxr8OB4p4wga0G -A1UdIwSBpTCBooAUlnqNTIdfldOWBuAsqXVxr8OB4p6hgYakgYMwgYAxCzAJBgNV -BAYTAlVBMQswCQYDVQQIEwJDQTERMA8GA1UEBxMITWlscGl0YXMxDjAMBgNVBAoT -BUZvb0NvMRMwEQYDVQQLEwp3aWRnZXQgZGl2MRIwEAYDVQQDEwlsb2NhbGhvc3Qx -GDAWBgkqhkiG9w0BCQEWCWZvb0Bmb28uY4IBADAMBgNVHRMEBTADAQH/MA0GCSqG -SIb3DQEBBAUAA4GBAC0j/qC+PRfpIRwISxQALNm/HPtIFbQDNFwYBfVgxxQOm9cT -gP1S9zRU8Z6K7E0ZYu6VvZAzuY9qOJK4M6X0gdGlx60QqR7poAnFiWtUtrWzs6YS -M6ZGUjSXnnqMkP1vauvbmV72CdYLR9dIQ6OMQqJ6GKznOGJd0hW8nHzhvBUh ------END CERTIFICATE----- diff --git a/libs/stund/server.cxx b/libs/stund/server.cxx deleted file mode 100644 index 2319592db515daf61cb832bea4e8ea7f0aada444..0000000000000000000000000000000000000000 --- a/libs/stund/server.cxx +++ /dev/null @@ -1,292 +0,0 @@ -#include <cassert> -#include <cstring> -#include <iostream> -#include <cstdlib> - -#ifndef WIN32 -#include <sys/time.h> -#include <sys/types.h> -#include <unistd.h> -#include <netinet/in.h> -#include <errno.h> -#include <stdlib.h> -#endif - -#include "udp.h" -#include "stun.h" - - -using namespace std; - - -void -usage() -{ - cerr << "Usage: " << endl - << " ./server [-v] [-h] [-h IP_Address] [-a IP_Address] [-p port] [-o port] [-m mediaport]" << endl - << " " << endl - << " If the IP addresses of your NIC are 10.0.1.150 and 10.0.1.151, run this program with" << endl - << " ./server -v -h 10.0.1.150 -a 10.0.1.151" << endl - << " STUN servers need two IP addresses and two ports, these can be specified with:" << endl - << " -h sets the primary IP" << endl - << " -a sets the secondary IP" << endl - << " -p sets the primary port and defaults to 3478" << endl - << " -o sets the secondary port and defaults to 3479" << endl - << " -b makes the program run in the backgroud" << endl - << " -m sets up a STERN server starting at port m" << endl - << " -v runs in verbose mode" << endl - // in makefile too - << endl; -} - - -int -main(int argc, char* argv[]) -{ - assert( sizeof(UInt8 ) == 1 ); - assert( sizeof(UInt16) == 2 ); - assert( sizeof(UInt32) == 4 ); - - initNetwork(); - - clog << "STUN server version " << STUN_VERSION << endl; - - StunAddress4 myAddr; - StunAddress4 altAddr; - bool verbose=false; - bool background=false; - - myAddr.addr = 0; - altAddr.addr = 0; - myAddr.port = STUN_PORT; - altAddr.port = STUN_PORT+1; - int myPort = 0; - int altPort = 0; - int myMediaPort = 0; - - UInt32 interfaces[10]; - int numInterfaces = stunFindLocalInterfaces(interfaces,10); - - if (numInterfaces == 2) - { - myAddr.addr = interfaces[0]; - myAddr.port = STUN_PORT; - altAddr.addr = interfaces[1]; - altAddr.port = STUN_PORT+1; - } - - for ( int arg = 1; arg<argc; arg++ ) - { - if ( !strcmp( argv[arg] , "-v" ) ) - { - verbose = true; - } - else if ( !strcmp( argv[arg] , "-b" ) ) - { - background = true; - } - else if ( !strcmp( argv[arg] , "-h" ) ) - { - arg++; - if ( argc <= arg ) - { - usage(); - exit(-1); - } - stunParseServerName(argv[arg], myAddr); - } - else if ( !strcmp( argv[arg] , "-a" ) ) - { - arg++; - if ( argc <= arg ) - { - usage(); - exit(-1); - } - stunParseServerName(argv[arg], altAddr); - } - else if ( !strcmp( argv[arg] , "-p" ) ) - { - arg++; - if ( argc <= arg ) - { - usage(); - exit(-1); - } - myPort = UInt16(strtol( argv[arg], NULL, 10)); - } - else if ( !strcmp( argv[arg] , "-o" ) ) - { - arg++; - if ( argc <= arg ) - { - usage(); - exit(-1); - } - altPort = UInt16(strtol( argv[arg], NULL, 10)); - } - else if ( !strcmp( argv[arg] , "-m" ) ) - { - arg++; - if ( argc <= arg ) - { - usage(); - exit(-1); - } - myMediaPort = UInt16(strtol( argv[arg], NULL, 10)); - } - else - { - usage(); - exit(-1); - } - } - - if ( myPort != 0 ) - { - myAddr.port = myPort; - } - if ( altPort != 0 ) - { - altAddr.port = altPort; - } - - if ( (myAddr.addr == 0) || (altAddr.addr == 0) ) - { - clog << "If your machine does not have exactly two ethernet interfaces, " - << "you must specify the server and alt server" << endl; - //usage(); - //exit(-1); - } - - if ( myAddr.port == altAddr.port ) - { - altAddr.port = myAddr.port+1; - } - - if ( verbose ) - { - clog << "Running with on interface " - << myAddr << " with alternate " - << altAddr << endl; - } - - if ( - ( myAddr.addr == 0 ) || - ( myAddr.port == 0 ) || - //( altAddr.addr == 0 ) || - ( altAddr.port == 0 ) - ) - { - cerr << "Bad command line" << endl; - exit(1); - } - - if ( altAddr.addr == 0 ) - { - cerr << "Warning - no alternate ip address STUN will not work" << endl; - //exit(1); - } - -#if defined(WIN32) - int pid=0; - - if ( background ) - { - cerr << "The -b background option does not work in windows" << endl; - exit(-1); - } -#else - pid_t pid=0; - - if ( background ) - { - pid = fork(); - - if (pid < 0) - { - cerr << "fork: unable to fork" << endl; - exit(-1); - } - } -#endif - - if (pid == 0) //child or not using background - { - StunServerInfo info; - bool ok = stunInitServer(info, myAddr, altAddr, myMediaPort, verbose); - - int c=0; - while (ok) - { - ok = stunServerProcess(info, verbose); - c++; - if ( c%1000 == 0 ) - { - clog << "*"; - } - } - // Notreached - } - - return 0; -} - - -/* ==================================================================== - * The Vovida Software License, Version 1.0 - * - * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The names "VOCAL", "Vovida Open Communication Application Library", - * and "Vovida Open Communication Application Library (VOCAL)" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact vocal@vovida.org. - * - * 4. Products derived from this software may not be called "VOCAL", nor - * may "VOCAL" appear in their name, without prior written - * permission of Vovida Networks, Inc. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA - * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES - * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * ==================================================================== - * - * This software consists of voluntary contributions made by Vovida - * Networks, Inc. and many individuals on behalf of Vovida Networks, - * Inc. For more information on Vovida Networks, Inc., please see - * <http://www.vovida.org/>. - * - */ - - -// Local Variables: -// mode:c++ -// c-file-style:"ellemtel" -// c-file-offsets:((case-label . +)) -// indent-tabs-mode:nil -// End: diff --git a/libs/stund/server.sln b/libs/stund/server.sln deleted file mode 100644 index d943a29e6ba437a17795830496854f394bee7b61..0000000000000000000000000000000000000000 --- a/libs/stund/server.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "server.vcproj", "{2011B7B6-6932-431D-83A3-E825A271F8A8}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {2011B7B6-6932-431D-83A3-E825A271F8A8}.Debug.ActiveCfg = Debug|Win32 - {2011B7B6-6932-431D-83A3-E825A271F8A8}.Debug.Build.0 = Debug|Win32 - {2011B7B6-6932-431D-83A3-E825A271F8A8}.Release.ActiveCfg = Release|Win32 - {2011B7B6-6932-431D-83A3-E825A271F8A8}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/libs/stund/server.vcproj b/libs/stund/server.vcproj deleted file mode 100644 index 8fb6e97a9bc732a5aab6ff9841b06d5984b66830..0000000000000000000000000000000000000000 --- a/libs/stund/server.vcproj +++ /dev/null @@ -1,134 +0,0 @@ -<?xml version="1.0" encoding = "Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7.00" - Name="server" - ProjectGUID="{2011B7B6-6932-431D-83A3-E825A271F8A8}" - Keyword="Win32Proj"> - <Platforms> - <Platform - Name="Win32"/> - </Platforms> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="ServerDebug" - IntermediateDirectory="ServerDebug" - ConfigurationType="1" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" - MinimalRebuild="TRUE" - BasicRuntimeChecks="3" - RuntimeLibrary="5" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="FALSE" - DebugInformationFormat="4"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="Ws2_32.lib" - OutputFile="$(OutDir)/server.exe" - LinkIncremental="2" - GenerateDebugInformation="TRUE" - ProgramDatabaseFile="$(OutDir)/server.pdb" - SubSystem="1" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="ServerRelease" - IntermediateDirectory="ServerRelease" - ConfigurationType="1" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - OmitFramePointers="TRUE" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" - StringPooling="TRUE" - RuntimeLibrary="4" - EnableFunctionLevelLinking="TRUE" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="FALSE" - DebugInformationFormat="3"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="Ws2_32.lib" - OutputFile="$(OutDir)/server.exe" - LinkIncremental="1" - GenerateDebugInformation="TRUE" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - </Configuration> - </Configurations> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> - <File - RelativePath="server.cxx"> - </File> - <File - RelativePath="stun.cxx"> - </File> - <File - RelativePath="udp.cxx"> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc"> - <File - RelativePath="stun.h"> - </File> - <File - RelativePath="udp.h"> - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/libs/stund/tlsServer.cxx b/libs/stund/tlsServer.cxx deleted file mode 100644 index c1b819b9c0fc1f546dcbd35abafa6c893cb8ec35..0000000000000000000000000000000000000000 --- a/libs/stund/tlsServer.cxx +++ /dev/null @@ -1,502 +0,0 @@ - -/* - This program takes no arguments. It opens the STUN tcp port and rus a tls server - on it. -*/ - -#include <sys/types.h> -#include <string.h> -#include <openssl/e_os2.h> -#include <openssl/evp.h> -#include <openssl/crypto.h> -#include <openssl/err.h> -#include <openssl/pem.h> -#include <openssl/pkcs7.h> -#include <openssl/x509.h> -#include <openssl/x509v3.h> -#include <openssl/ssl.h> -#ifdef WIN32 -#include <errno.h> -#include <winsock2.h> -#include <io.h> -#endif - -#ifndef WIN32 -#include <sys/types.h> -#include <sys/time.h> -#include <sys/socket.h> -#include <sys/select.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <unistd.h> -#endif - -#ifdef WIN32 -# include <windows.h> -# include <winbase.h> -# include <errno.h> -# include <winsock2.h> -# include <io.h> -typedef unsigned int u_int32_t; -#endif - -#include <cassert> -#include <fcntl.h> - -#include <iostream> -#include <cstdlib> -#include <stdio.h> - -#ifdef __MACH__ -typedef int socklen_t; -#endif - -#include "stun.h" - -using namespace std; - - - -#define MAX_CONNECTIONS 64 - - -#ifdef WIN32 -typedef int socklen_t; -//#define errno WSAGetLastError() -typedef SOCKET Socket; -#else -typedef int Socket; -static const Socket INVALID_SOCKET = -1; -static const int SOCKET_ERROR = -1; -#endif - - - -// TODO - !cj! - need to deal with closing connections - - -void -makeSocketNonBlocking(Socket fd) -{ -#if WIN32 - unsigned long noBlock = 1; - int errNoBlock = ioctlsocket( fd, FIONBIO , &noBlock ); - if ( errNoBlock != 0 ) - { - assert(0); - } -#else - int flags = fcntl( fd, F_GETFL, 0); - int errNoBlock = fcntl(fd, F_SETFL, flags | O_NONBLOCK ); - if ( errNoBlock != 0 ) // !cj! I may have messed up this line - { - assert(0); - } -#endif -} - - -int -main() -{ -#ifdef WIN32 - WORD wVersionRequested = MAKEWORD( 2, 2 ); - WSADATA wsaData; - int err; - - err = WSAStartup( wVersionRequested, &wsaData ); - if ( err != 0 ) - { - // could not find a usable WinSock DLL - //cerr << "Could not load winsock" << endl; - assert(0); // is this is failing, try a different version that 2.2, 1.0 or later will likely work - exit(1); - } -#endif - - // contexts for each connection - SSL* ssl[MAX_CONNECTIONS]; - - // buffers for each connection - BIO* bio[MAX_CONNECTIONS]; - - // file descriptors for each connection - Socket fd[MAX_CONNECTIONS]; - - // ip address of other side of connection - int peerip[MAX_CONNECTIONS]; - - // root cert list - X509_STORE* certAuthorities; - // my public cert - X509* publicCert; - // my private key - EVP_PKEY* privateKey; - // SSL Context - SSL_CTX* ctx; - - Socket mFd; - - char* password = "password"; - - - for ( int i=0; i<MAX_CONNECTIONS; i++ ) - { - fd[i]=-1; - bio[i]=0; - ssl[i]=0; - } - - - // load public cert - FILE* fp = fopen("id.pem","rb"); - if ( !fp ) - { - cerr << "Could not read public cert" <<endl; exit(1); - } - publicCert = PEM_read_X509(fp,NULL,NULL,NULL); - if (!publicCert) - { - cerr << "Error reading contents of public cert"<<endl; exit(1); - } - cerr << "Loaded public cert"<<endl; - - - // load private key - fp = fopen("id_key.pem","rb"); - if ( !fp ) - { - cerr << "Could not read private key"<<endl; exit(1); - } - privateKey = PEM_read_PrivateKey(fp,NULL,NULL,password); - if (!privateKey) - { - cerr << "Error reading contents of private key file "<<endl;exit(1); - } - cerr << "Loaded private key "<<endl; - - // load root certs - certAuthorities = X509_STORE_new(); - assert( certAuthorities ); - if ( X509_STORE_load_locations(certAuthorities,"root.pem",NULL) != 1 ) - { - cerr << "Error reading contents of root cert file "<<endl; - } - cerr << "Loaded public CAs"<<endl; - - - // set up main security context - SSL_library_init(); - - SSL_load_error_strings(); - - OpenSSL_add_all_ciphers(); - OpenSSL_add_all_digests(); - - ERR_load_crypto_strings(); - - ctx=SSL_CTX_new( TLSv1_method() ); - assert( ctx ); - - int ok; - ok = SSL_CTX_use_certificate(ctx, publicCert); - assert( ok == 1); - - ok = SSL_CTX_use_PrivateKey(ctx,privateKey); - assert( ok == 1); - - assert( certAuthorities ); - SSL_CTX_set_cert_store(ctx, certAuthorities); - - - // open a socket to listen for requests on - mFd = socket(PF_INET, SOCK_STREAM, 0); - - sockaddr_in addr; - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = htonl(INADDR_ANY); - addr.sin_port = htons(STUN_PORT); - - if ( bind( mFd, (struct sockaddr*) &addr, sizeof(addr)) == SOCKET_ERROR ) - { - int err = errno; - if ( err == EADDRINUSE ) - { - cerr << "Port already in use"<<endl; - } - else - { - cerr << "Could not bind to port"<<endl; - } - - exit(0); - } - - makeSocketNonBlocking(mFd); - - int e = listen(mFd,64 ); - if (e != 0 ) - { - assert(0); - } - - - cerr << "Ready for requests" << endl; - - while ( true ) - { - // set up the read fd set for select - fd_set read; - FD_ZERO(&read); - int size=0; - - FD_SET(mFd, &read); - size = mFd+1; - - for ( int i=0; i<MAX_CONNECTIONS; i++ ) - { - if ( fd[i] > 0 ) - { - FD_SET(fd[i], &read); - size = ( int(fd[i]+1) > size) ? int(fd[i]+1) : size; - } - - } - - - // do a select - unsigned long ms = 500; - struct timeval tv; - tv.tv_sec = (ms/1000); - tv.tv_usec = (ms%1000)*1000; - int e = select(size, &read, NULL, NULL, &tv); - - cerr << "." ; - - // process any new connections - if ( FD_ISSET(mFd, &read)) - { - cerr << "Got a new connection" << endl; - - // find an unused connection - int i=0; - for ( ; i<MAX_CONNECTIONS; i++ ) - { - if ( fd[i] == -1 ) - { - break; - } - } - - if ( i >= MAX_CONNECTIONS ) - { - cerr << "Ran out of connections to use "<<endl; - break; - } - - struct sockaddr_in peer; - int peerLen=sizeof(peer); - fd[i] = accept( mFd, (struct sockaddr*)&peer,(socklen_t*)&peerLen); - if ( fd[i] == -1 ) - { - int err = errno; - cerr << "Error on accept: " << strerror(err)<<endl; - break; - } - - int* ptr = (int*)( &peer.sin_addr ); - peerip[i] = *ptr; - - ssl[i] = NULL; - - ssl[i] = SSL_new(ctx); - assert(ssl[i]); - - bio[i] = BIO_new_socket(fd[i],0/*close flag*/); - assert( bio[i] ); - - SSL_set_bio( ssl[i], bio[i], bio[i] ); - - int ok=0; - ok = SSL_accept(ssl[i]); - - if ( ok != 1 ) - { - int err = SSL_get_error(ssl[i],ok); - char buf[256]; - ERR_error_string_n(err,buf,sizeof(buf)); - - cerr << "ssl connection failed "<<endl; - - bio[i] = NULL; - } - - makeSocketNonBlocking(fd[i]); - } - - - // process reads and writes - for (int i=0; i<MAX_CONNECTIONS; i++) - { - if ( ssl[i] ) - if ( FD_ISSET( fd[i], &read) || SSL_pending(ssl[i]) ) - { - cerr << "got a message on connection " << i << endl; - - char buf[STUN_MAX_MESSAGE_SIZE]; - - int ret = SSL_read(ssl[i],buf,sizeof(buf)); - if (ret < 0 ) - { - int err = SSL_get_error(ssl[i],ret); - switch (err) - { - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - case SSL_ERROR_NONE: - { - cerr << "Got TLS read got condition of " << err <<endl; - } - break; - default: - { - char buf[256]; - ERR_error_string_n(err,buf,sizeof(buf)); - cerr << "Got TLS read error " << err << " " << buf <<endl; - } - break; - } - // !cj! - big mem leak here - need to close and cleanup - closesocket( fd[i] ); - fd[i] = -1; - ssl[i]=0; - } - - cerr << "Received message with " << ret << " bytes"<<endl; - - StunAddress4 from; - StunAddress4 myAddr; - StunAddress4 altAddr; - StunMessage resp; - StunAddress4 destination; - StunAtrString hmacPassword; - bool changePort; - bool changeIp; - - from.addr = peerip[i]; - - bool ok = stunServerProcessMsg( buf,ret, - from, - myAddr, - altAddr, - &resp, - &destination, - &hmacPassword, - &changePort, - &changeIp, - true /*verbose*/ ); - - if (!ok ) - { - cerr << "Message did not parse - closeing conneciton " << i <<endl; - closesocket( fd[i] ); - fd[i] = -1; - ssl[i]=0; - } - - if (ok) - { - int len = stunEncodeMessage( resp, buf, sizeof(buf), hmacPassword ); - - ret = SSL_write(ssl[i],(const char*)buf,len); - - if (ret < 0 ) - { - int err = SSL_get_error(ssl[i],ret); - switch (err) - { - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - case SSL_ERROR_NONE: - { - cerr << "Got TLS write got codition of " << err <<endl; - } - break; - default: - { - cerr << "Got TLS write error " << err <<endl; - } - break; - } - // !cj! big mem leak - need to cleanup - closesocket( fd[i] ); - fd[i] = -1; - ssl[i]=0; - } - } - } - } - } - - return 0; -} - - -/* ==================================================================== - * The Vovida Software License, Version 1.0 - * - * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The names "VOCAL", "Vovida Open Communication Application Library", - * and "Vovida Open Communication Application Library (VOCAL)" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact vocal@vovida.org. - * - * 4. Products derived from this software may not be called "VOCAL", nor - * may "VOCAL" appear in their name, without prior written - * permission of Vovida Networks, Inc. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA - * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES - * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * ==================================================================== - * - * This software consists of voluntary contributions made by Vovida - * Networks, Inc. and many individuals on behalf of Vovida Networks, - * Inc. For more information on Vovida Networks, Inc., please see - * <http://www.vovida.org/>. - * - */ - -// Local Variables: -// mode:c++ -// c-file-style:"ellemtel" -// c-file-offsets:((case-label . +)) -// indent-tabs-mode:nil -// End: - - diff --git a/libs/stund/wnattest.bat b/libs/stund/wnattest.bat deleted file mode 100644 index edd9fdef34cf6c668f54236e1d1acc8a8c24d436..0000000000000000000000000000000000000000 --- a/libs/stund/wnattest.bat +++ /dev/null @@ -1,40 +0,0 @@ -@echo off -rem wnattest.bat -if defined %4 ( - goto usage -) else if defined %3 ( - goto start -) else ( - goto usage -) -:start -stunner %1 -i %2 -i2 %3 -if %errorlevel% == -1 ( - echo "ERROR! the STUN test program had an error" ( -) else if %errorlevel% == 10 ( - echo "[PASS] (Address) Restricted Cone NAT with Hairpinning" -) else if %errorlevel% == 21 ( - echo "[PASS] Port Restricted Cone NAT with Hairpinning" -) else if %errorlevel% == 8 ( - echo "[No NAT] You have open internet access" -) else if %errorlevel% == 2 ( - echo "[FAIL] Your (Address) Restricted Cone NAT doesn't do hairpinning" -) else if %errorlevel% == 3 ( - echo "[FAIL] Your Port Restricted Cone NAT doesn't do hairpinning" -) else ( - echo "[FAIL] You have a NAT or Firewall type which is NOT RECOMMENDED. " - if %errorlevel% LSS 8 ( - echo "It also does not support hairpinning" - ) else ( - each "it does at least support hairpinning" - ) -) -goto end -:usage -echo Usage: -echo wnattest <server-ip> <client-primary-ip> <client-secondary-ip> -echo. -echo Example: wnattest 1.1.1.2 192.168.0.2 192.168.0.3 -echo. -:end - diff --git a/man/Makefile.am b/man/Makefile.am index 3ad0a09bcf4e00d077da853b3ffd57fb3858157e..eea40c658df557431676f40c702192ef4a5f0a11 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,5 +1,4 @@ SECTION="1" -RELEASE_VERSION="0.9.2" TEMPLATES=\ sflphone-gtk.pod \ @@ -18,7 +17,7 @@ all: $(MANPAGES) SUFFIXES=.pod .1 .pod.1: - $(POD2MAN) --section=$(SECTION) --release=$(RELEASE_VERSION) --center "" $< > $@ + $(POD2MAN) --section=$(SECTION) --release=@VERSION@ --center "" $< > $@ #install-data-local: diff --git a/platform/fedora.spec b/platform/fedora.spec deleted file mode 100644 index 65e07034a533b7780f4f5641e7e1c04f39b11da7..0000000000000000000000000000000000000000 --- a/platform/fedora.spec +++ /dev/null @@ -1,106 +0,0 @@ -%define name sflphone -%define version -Autoreq: 0 - -Name: %name -Summary: A VoIP daemon with SIP protocol and IAX protocol -Version: %version -Release: 2fedora -License: GPL -Group: System Environment/Daemons -URL: http://www.sflphone.org/ -Packager: Emmanuel Milou <emmanuel.milouu@savoirfairelinux.com> -Source0: %{name}-%{version}.tar.gz -Source1: libpj-sfl.pc -BuildRoot: %{_tmppath}/%{name}-%{version} -Requires: commoncpp2 ccrtp cppunit libsamplerate pulseaudio-libs-zeroconf pulseaudio-libs-devel gsm speex libgcc dbus-glib expat gtk2 glibc glib2 dbus-libs dbus-glib libsexy libnotify perl - -%description -SFLphoned is a VoIP daeamon with SIP protocol and IAX protocol. - -%prep -%setup -q -cd libs/pjproject-1.0.1 -./configure --prefix=/usr -make dep -make clean -make -cd ../dbus-c++ -./configure --prefix=/usr -make -cd ../libiax2 -./gen.sh -./configure --prefix=/usr -make -cd ../.. - -%build -./autogen.sh --prefix=/usr -make -cd sflphone-gtk/ -./autogen.sh --prefix=/usr -make -cd .. - -%install -%makeinstall - -cd sflphone-gtk/ -%makeinstall - -cd ../libs/pjproject-1.0.1 -%makeinstall - -cd ../dbus-c++ -%makeinstall - -cd ../libiax2 -%makeinstall - -cd ../.. -cd %{buildroot}/usr/bin/ -ln -sf ./sflphone-gtk sflphone -cd - -cp %{SOURCE1} %{buildroot}/usr/lib/pkgconfig/ -f - -rm -rf %{buildroot}/usr/lib/debug -rm -rf %{buildroot}/usr/include/ - -%files -%defattr(-, root, root) -/usr/bin/* -/usr/lib/* -/usr/share/applications/* -/usr/share/dbus-1/services/* -/usr/share/locale/* -/usr/share/pixmaps/* -/usr/share/sflphone/* -/usr/share/man/* - -%clean -rm -rf %{buildroot} - - - -%changelog -* Mon Feb 16 2009 Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> 2fedora - - Packaging 0.9.3-2 sflphone version on Fedora 10 - -* Mon Jan 26 2009 Yun Liu <yun.liu@savoirfairelinux.com> 6 - - Packaging sflphone for Fedora 10 - -* Mon Jan 5 2009 Yun Liu <yun.liu@savoirfairelinux.com> - - Fix bug ticket #107, #108, #109, #110, #111, #117, #129 - -* Thu Nov 6 2008 Yun Liu <yun.liu@savoirfairelinux.com> - - Packaging sflphone for Fedora 9 - -* Thu Nov 30 2006 Yan Morin <yan.morin@savoirfairelinux.com> - Packaging sflphone for Fedora Core 6 - -* Wed Sep 6 2006 Yan Morin <yan.morin@savoirfairelinux.com> - Packaging sflphone, sflphone-qt and sflphone-cli - -* Mon Nov 21 2005 Yan Morin <yan.morin@savoirfairelinux.com> -- Final 0.6.0 version (Release / Source without alphatag) - diff --git a/platform/suse.spec b/platform/suse.spec deleted file mode 100644 index 82a3412cce7835698c1e052b2c9ffd1a8f89c6eb..0000000000000000000000000000000000000000 --- a/platform/suse.spec +++ /dev/null @@ -1,104 +0,0 @@ -%define name sflphone -%define version -Autoreq: 0 - -Name: %name -Summary: A VoIP daemon with SIP protocol and IAX protocol -Version: %version -Release: 2suse -License: GPL -Group: System Environment/Daemons -URL: http://www.sflphone.org/ -Packager: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> -Source0: %{name}-%{version}.tar.gz -Source1: libpj-sfl.pc -BuildRoot: %{_tmppath}/%{name}-%{version} -Requires: commoncpp2 ccrtp cppunit libsamplerate pulseaudio-libs-zeroconf pulseaudio-libs-devel gsm speex libgcc dbus-glib expat gtk2 glibc glib2 dbus-libs dbus-glib libsexy libnotify perl - -%description -SFLphoned is a VoIP daeamon with SIP protocol and IAX protocol. - -%prep -%setup -q -cd libs/pjproject-1.0.1 -./configure --prefix=/usr -make dep -make clean -make -cd ../dbus-c++ -./configure --prefix=/usr -make -cd ../libiax2 -./gen.sh -./configure --prefix=/usr -make -cd ../.. - -%build -./autogen.sh --prefix=/usr -make -cd sflphone-gtk/ -./autogen.sh --prefix=/usr -make -cd .. - -%install -make prefix=%{buildroot}/usr install - -cd sflphone-gtk/ -make prefix=%{buildroot}/usr install - -cd ../libs/pjproject-1.0.1 -make prefix=%{buildroot}/usr install - -cd ../dbus-c++ -make prefix=%{buildroot}/usr install - -cd ../libiax2 -make prefix=%{buildroot}/usr install - -cd ../.. -cd %{buildroot}/usr/bin/ -ln -sf ./sflphone-gtk sflphone -cd - -cp %{SOURCE1} %{buildroot}/usr/lib/pkgconfig/ -f - -rm -rf %{buildroot}/usr/lib/debug -rm -rf %{buildroot}/usr/include - -%files -%defattr(-, root, root) -/usr/bin/* -/usr/lib/* -/usr/share/applications/* -/usr/share/dbus-1/services/* -/usr/share/locale/* -/usr/share/pixmaps/* -/usr/share/sflphone/* -/usr/share/man/* - -%clean -rm -rf %{buildroot} - -%changelog -* Mon Feb 16 2009 Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> 2suse - - Packaging 0.9.3-2 sflphone version on openSUSE 11 - -* Mon Jan 26 2009 Yun Liu <yun.liu@savoirfairelinux.com> 6suse - - Packaging sflphone on openSUSE 11 - -* Mon Jan 5 2009 Yun Liu <yun.liu@savoirfairelinux.com> - - Fix bug ticket #107, #108, #109, #110, #111, #117, #129 - -* Thu Nov 6 2008 Yun Liu <yun.liu@savoirfairelinux.com> - - Packaging sflphone for Fedora 9 - -* Thu Nov 30 2006 Yan Morin <yan.morin@savoirfairelinux.com> - Packaging sflphone for Fedora Core 6 - -* Wed Sep 6 2006 Yan Morin <yan.morin@savoirfairelinux.com> - Packaging sflphone, sflphone-qt and sflphone-cli - -* Mon Nov 21 2005 Yan Morin <yan.morin@savoirfairelinux.com> -- Final 0.6.0 version (Release / Source without alphatag) - diff --git a/platform/suse.spec.in b/platform/suse.spec.in index 74e1ae85efd920a53996244457c8197ebacbe9d8..272c155f237bd923c94e5dfd9e25b5beb930eac1 100644 --- a/platform/suse.spec.in +++ b/platform/suse.spec.in @@ -5,7 +5,7 @@ Autoreq: 0 Name: %name Summary: A VoIP daemon with SIP protocol and IAX protocol Version: %version -Release: 2suse +Release: 1suse License: GPL Group: System Environment/Daemons URL: http://www.sflphone.org/ @@ -13,7 +13,7 @@ Packager: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> Source0: %{name}-%{version}.tar.gz Source1: libpj-sfl.pc BuildRoot: %{_tmppath}/%{name}-%{version} -Requires: commoncpp2 ccrtp cppunit libsamplerate pulseaudio-libs-zeroconf pulseaudio-libs-devel gsm speex libgcc dbus-glib expat gtk2 glibc glib2 dbus-libs dbus-glib libsexy libnotify perl +Requires: commoncpp2 libccrtp1 libsamplerate pulseaudio libgsm1 libspeex dbus-1-glib expat gtk2 glibc glib2 dbus-1 libsexy libnotify perl %description SFLphoned is a VoIP daeamon with SIP protocol and IAX protocol. @@ -22,15 +22,8 @@ SFLphoned is a VoIP daeamon with SIP protocol and IAX protocol. %setup -q cd libs/pjproject-1.0.1 ./configure --prefix=/usr -make dep make clean -make -cd ../dbus-c++ -./configure --prefix=/usr -make -cd ../libiax2 -./gen.sh -./configure --prefix=/usr +make dep make cd ../.. @@ -51,12 +44,6 @@ make prefix=%{buildroot}/usr install cd ../libs/pjproject-1.0.1 make prefix=%{buildroot}/usr install -cd ../dbus-c++ -make prefix=%{buildroot}/usr install - -cd ../libiax2 -make prefix=%{buildroot}/usr install - cd ../.. cd %{buildroot}/usr/bin/ ln -sf ./sflphone-gtk sflphone @@ -81,6 +68,9 @@ rm -rf %{buildroot}/usr/include rm -rf %{buildroot} %changelog +* Fri Apr 10 2009 Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> 1suse + - Packaging 0.9.4-2 sflphone version on openSUSE 11 + * Mon Feb 16 2009 Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> 2suse - Packaging 0.9.3-2 sflphone version on openSUSE 11 diff --git a/po/de.po b/po/de.po index c815b378745ec1045af85a0e3909f91957d045ed..1125d763740b4042d206836a41ca66513474aa4e 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: sflphone\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-02-10 15:24-0500\n" +"POT-Creation-Date: 2009-04-02 11:15-0400\n" "PO-Revision-Date: 2009-01-08 10:46-0500\n" "Last-Translator: Sven Werlen <sven.werlen@savoirfairelinux.com>\n" "Language-Team: SavoirFaire Linux Inc <sflphoneteam@savoirfairelinux.com>\n" @@ -30,7 +30,7 @@ msgid "Trying..." msgstr "Am versuchen..." #: ../sflphone-gtk/src/accountlist.c:167 ../sflphone-gtk/src/sflnotify.c:171 -#: ../sflphone-gtk/src/sflnotify.c:210 +#: ../sflphone-gtk/src/sflnotify.c:212 msgid "Error" msgstr "Fehler" @@ -58,66 +58,22 @@ msgstr "Ungültiger Stun Server" msgid "Invalid" msgstr "Ungültig" -#: ../sflphone-gtk/src/accountwindow.c:109 -msgid "Account settings" -msgstr "Kontoeinstellungen" - -#: ../sflphone-gtk/src/accountwindow.c:121 -msgid "Account parameters" -msgstr "Kontoparameter" - -#: ../sflphone-gtk/src/accountwindow.c:143 -msgid "_Enabled" -msgstr "_Aktiv" - -#: ../sflphone-gtk/src/accountwindow.c:149 ../sflphone-gtk/src/assistant.c:238 -#: ../sflphone-gtk/src/assistant.c:292 -msgid "_Alias" -msgstr "_Alias" - -#: ../sflphone-gtk/src/accountwindow.c:157 -msgid "_Protocol" -msgstr "_Protokoll" - -#: ../sflphone-gtk/src/accountwindow.c:175 -msgid "Unknown" -msgstr "unbekannt" - -#: ../sflphone-gtk/src/accountwindow.c:185 ../sflphone-gtk/src/assistant.c:246 -#: ../sflphone-gtk/src/assistant.c:300 -msgid "_Host name" -msgstr "_Hostname" - -#: ../sflphone-gtk/src/accountwindow.c:193 ../sflphone-gtk/src/assistant.c:254 -#: ../sflphone-gtk/src/assistant.c:308 -msgid "_User name" -msgstr "_Benutzername" - -#: ../sflphone-gtk/src/accountwindow.c:204 ../sflphone-gtk/src/assistant.c:264 -#: ../sflphone-gtk/src/assistant.c:318 -msgid "_Password" -msgstr "_Passwort" - -#: ../sflphone-gtk/src/accountwindow.c:215 -msgid "_Voicemail box #" -msgstr "_Voicemail Boxnummer" - -#: ../sflphone-gtk/src/actions.c:57 ../sflphone-gtk/src/sflnotify.c:103 +#: ../sflphone-gtk/src/actions.c:55 ../sflphone-gtk/src/sflnotify.c:103 #, c-format msgid "%d voice mails" msgstr "%d Voice Nachrichten" -#: ../sflphone-gtk/src/actions.c:59 +#: ../sflphone-gtk/src/actions.c:57 #, c-format msgid "%d voice mail" msgstr "%d Voice Nachricht" -#: ../sflphone-gtk/src/actions.c:80 +#: ../sflphone-gtk/src/actions.c:81 #, c-format msgid "%s account- %s" msgstr "%s Konto- %s" -#: ../sflphone-gtk/src/actions.c:224 +#: ../sflphone-gtk/src/actions.c:225 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -125,7 +81,12 @@ msgstr "" "SFLphone Server kann nicht verbunden werden. Stellen Sie sicher, dass der " "Dämon läuft." -#: ../sflphone-gtk/src/actions.c:798 +#: ../sflphone-gtk/src/actions.c:764 +#, c-format +msgid "%s account- %s %s" +msgstr "%s Konto- %s %s" + +#: ../sflphone-gtk/src/actions.c:861 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -138,44 +99,62 @@ msgstr "" "</b> SFL Audio-Codecs müssen in <i>%s</i> oder <b>.sflphone</b> Ihres HOME-" "Verzeichniss ( <i>%s</i> ) gespeichert werden." -#: ../sflphone-gtk/src/assistant.c:148 +#: ../sflphone-gtk/src/assistant.c:31 +#, c-format +msgid "" +"This assistant is now finished.\n" +"You can at any time check your registration state or modify your accounts " +"parameters in the Options/Accounts window.\n" +"\n" +"Alias : %s\n" +"Server : %s\n" +"Username : %s\n" +"Password : %s" +msgstr "" +"Assistent vollendet.\n" +"\n" +"Sie können jederzeit Ihres Registrierungsstatus überprüfen oder Ihre " +"Kontoparameter ändern (Optionen/Konten).\n" +"\n" +"Alias : %s\n" +"Server : %s\n" +"Benutzername : %s\n" +"Passwort : %s" + +#: ../sflphone-gtk/src/assistant.c:154 msgid "SFLphone account configuration wizard" msgstr "SFLphone Konto (Konfigurationsassistent)" -#: ../sflphone-gtk/src/assistant.c:176 -msgid "SFLphone 0.9.2" -msgstr "SFLphone 0.9.2" - -#: ../sflphone-gtk/src/assistant.c:176 +#: ../sflphone-gtk/src/assistant.c:180 msgid "Welcome to SFLphone!" msgstr "Wilkommen zu SFLphone!" -#: ../sflphone-gtk/src/assistant.c:178 +#: ../sflphone-gtk/src/assistant.c:181 msgid "This installation wizard will help you configure an account." msgstr "" "The Installationsassistent wird Ihnen helfen, ein Konto zu konfigurieren." -#: ../sflphone-gtk/src/assistant.c:193 +#: ../sflphone-gtk/src/assistant.c:195 msgid "VoIP Protocols" msgstr "VoIP Protokoll" -#: ../sflphone-gtk/src/assistant.c:193 +#: ../sflphone-gtk/src/assistant.c:195 msgid "Select an account type:" msgstr "Kontotyp auswählen:" -#: ../sflphone-gtk/src/assistant.c:211 +#: ../sflphone-gtk/src/assistant.c:213 msgid "Account" msgstr "Konto" -#: ../sflphone-gtk/src/assistant.c:211 +#: ../sflphone-gtk/src/assistant.c:213 msgid "Please select one of the following option:" msgstr "Bitte eine Option auswählen:" -#: ../sflphone-gtk/src/assistant.c:213 +#: ../sflphone-gtk/src/assistant.c:215 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "" -#: ../sflphone-gtk/src/assistant.c:215 +#: ../sflphone-gtk/src/assistant.c:217 msgid "Register an existing SIP or IAX2 account" msgstr "" @@ -183,461 +162,577 @@ msgstr "" msgid "SIP account configuration" msgstr "Konfiguration des SIP-Konto" -#: ../sflphone-gtk/src/assistant.c:230 ../sflphone-gtk/src/assistant.c:284 +#: ../sflphone-gtk/src/assistant.c:230 ../sflphone-gtk/src/assistant.c:305 msgid "Please fill the following information:" msgstr "Folgende Informationen bitte ausfühlen:" -#: ../sflphone-gtk/src/assistant.c:284 +#: ../sflphone-gtk/src/assistant.c:238 ../sflphone-gtk/src/assistant.c:313 +#: ../sflphone-gtk/src/config/accountwindow.c:143 +msgid "_Alias" +msgstr "_Alias" + +#: ../sflphone-gtk/src/assistant.c:246 ../sflphone-gtk/src/assistant.c:321 +#: ../sflphone-gtk/src/config/accountwindow.c:179 +msgid "_Host name" +msgstr "_Hostname" + +#: ../sflphone-gtk/src/assistant.c:254 ../sflphone-gtk/src/assistant.c:329 +#: ../sflphone-gtk/src/config/accountwindow.c:187 +msgid "_User name" +msgstr "_Benutzername" + +#: ../sflphone-gtk/src/assistant.c:264 ../sflphone-gtk/src/assistant.c:339 +#: ../sflphone-gtk/src/config/accountwindow.c:198 +msgid "_Password" +msgstr "_Passwort" + +#: ../sflphone-gtk/src/assistant.c:282 +msgid "Optional Email Address " +msgstr "" + +#: ../sflphone-gtk/src/assistant.c:282 +msgid "This email address will be use to send your voicemail messages" +msgstr "" + +#: ../sflphone-gtk/src/assistant.c:290 +msgid "_Email" +msgstr "_Email" + +#: ../sflphone-gtk/src/assistant.c:305 msgid "IAX2 account configuration" msgstr "Konfiguration des IAX2 Konto" -#: ../sflphone-gtk/src/assistant.c:341 ../sflphone-gtk/src/configwindow.c:821 +#: ../sflphone-gtk/src/assistant.c:360 +#: ../sflphone-gtk/src/config/configwindow.c:837 msgid "Network Address Translation" msgstr "Network Address Translation (NAT)" -#: ../sflphone-gtk/src/assistant.c:341 +#: ../sflphone-gtk/src/assistant.c:360 msgid "You should probably enable this if you are behind a firewall." msgstr "Sie sollten dieses einschalten, falls Sie hinter einer Firewall sind." -#: ../sflphone-gtk/src/assistant.c:350 ../sflphone-gtk/src/configwindow.c:496 +#: ../sflphone-gtk/src/assistant.c:369 +#: ../sflphone-gtk/src/config/configwindow.c:499 msgid "E_nable STUN" msgstr "STUN Ei_nschalten" -#: ../sflphone-gtk/src/assistant.c:357 +#: ../sflphone-gtk/src/assistant.c:376 msgid "_STUN server" msgstr "_STUN Server" -#: ../sflphone-gtk/src/assistant.c:374 +#: ../sflphone-gtk/src/assistant.c:390 msgid "Account Registration" msgstr "Konto Registrierung" -#: ../sflphone-gtk/src/assistant.c:374 +#: ../sflphone-gtk/src/assistant.c:390 msgid "Congratulations!" msgstr "Gratulation!" -#: ../sflphone-gtk/src/assistant.c:376 +#: ../sflphone-gtk/src/context-menu.c:296 ../sflphone-gtk/src/menus.c:308 +#: ../sflphone-gtk/src/menus.c:791 +msgid "_Pick up" +msgstr "_Abnehmen" + +#: ../sflphone-gtk/src/context-menu.c:308 ../sflphone-gtk/src/menus.c:318 +#: ../sflphone-gtk/src/menus.c:803 +msgid "_Hang up" +msgstr "A_uflegen" + +#: ../sflphone-gtk/src/context-menu.c:320 ../sflphone-gtk/src/menus.c:328 +#: ../sflphone-gtk/src/menus.c:815 +msgid "On _Hold" +msgstr "in _Warteschleife" + +#: ../sflphone-gtk/src/context-menu.c:332 ../sflphone-gtk/src/menus.c:340 +#: ../sflphone-gtk/src/menus.c:827 +msgid "_Record" +msgstr "_Gespräch aufzeichnen" + +#: ../sflphone-gtk/src/errors.c:28 msgid "" -"This assistant is now finished.\n" +"<b>ALSA notification</b>\n" "\n" -" You can at any time check your registration state or modify your accounts " -"parameters in the Options/Accounts window." +"Error while opening playback device" msgstr "" -"Assistent vollendet.\n" +"<b>ALSA Benachrichtigung</b>\n" "\n" -"Sie können jederzeit Ihres Registrierungsstatus überprüfen oder Ihre " -"Kontoparameter ändern (Optionen/Konten)." +"Fehler während Öffnen des \"playback device\"" + +#: ../sflphone-gtk/src/errors.c:31 +msgid "" +"<b>ALSA notification</b>\n" +"\n" +"Error while opening capture device" +msgstr "" +"<b>ALSA Benachrichtigung</b>\n" +"\n" +"Fehler während Öffnen des \"capture device\"" + +#: ../sflphone-gtk/src/errors.c:34 +msgid "" +"<b>Pulseaudio notification</b>\n" +"\n" +"Pulseaudio is not running" +msgstr "" +"<b>Pulseaudio Benachrichtigung</b>\n" +"\n" +"Pulseaudio nicht gestartet" + +#: ../sflphone-gtk/src/mainwindow.c:70 +msgid "There is one call in progress." +msgstr "Laufender Anruf." + +#: ../sflphone-gtk/src/mainwindow.c:74 +msgid "There are calls in progress." +msgstr "Laufende Anrufe." + +#: ../sflphone-gtk/src/mainwindow.c:83 +msgid "Do you still want to quit?" +msgstr "" + +#: ../sflphone-gtk/src/menus.c:131 +msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." +msgstr "SFLphone ist ein VoIP Client (kompatibel mit SIP und IAX2 Protokolle)" + +#: ../sflphone-gtk/src/menus.c:134 +msgid "About SFLphone" +msgstr "Über SFLphone" + +#: ../sflphone-gtk/src/menus.c:157 +msgid "_Help" +msgstr "_Hilfe" + +#: ../sflphone-gtk/src/menus.c:296 ../sflphone-gtk/src/menus.c:949 +msgid "_New call" +msgstr "_Neuer Anruf" + +#: ../sflphone-gtk/src/menus.c:354 +msgid "_Account Assistant" +msgstr "_Konto Setup Assistent" + +#: ../sflphone-gtk/src/menus.c:384 +msgid "_Call" +msgstr "_Anruf" + +#: ../sflphone-gtk/src/menus.c:557 +msgid "_Clear history" +msgstr "Liste der vorherigen Anrufen _leeren" + +#: ../sflphone-gtk/src/menus.c:569 +msgid "_Accounts" +msgstr "_Konten" + +#: ../sflphone-gtk/src/menus.c:584 +msgid "_Edit" +msgstr "_Editieren" + +#: ../sflphone-gtk/src/menus.c:644 +msgid "_Dialpad" +msgstr "_Wählscheibe" + +#: ../sflphone-gtk/src/menus.c:656 +msgid "_Volume controls" +msgstr "Lautstärke Kontrollen" + +#: ../sflphone-gtk/src/menus.c:665 +msgid "_Search contact" +msgstr "Adressbuch _Suche" + +#: ../sflphone-gtk/src/menus.c:673 +msgid "_View" +msgstr "_Anzeigen" + +#: ../sflphone-gtk/src/menus.c:885 +msgid "_Call back" +msgstr "_zurückrufen" + +#: ../sflphone-gtk/src/sflnotify.c:34 ../sflphone-gtk/src/sflnotify.c:100 +#, c-format +msgid "%s account: %s" +msgstr "%s Konto: %s" + +#: ../sflphone-gtk/src/sflnotify.c:37 +#, c-format +msgid "<i>From:</i> %s" +msgstr "<i>Von:</i> %s" + +#: ../sflphone-gtk/src/sflnotify.c:52 +msgid "Accept" +msgstr "Annehmen" + +#: ../sflphone-gtk/src/sflnotify.c:53 +msgid "Refuse" +msgstr "Ablehnen" + +#: ../sflphone-gtk/src/sflnotify.c:54 ../sflphone-gtk/src/sflnotify.c:117 +#: ../sflphone-gtk/src/sflnotify.c:154 +msgid "Ignore" +msgstr "Ignorieren" + +#: ../sflphone-gtk/src/sflnotify.c:136 +#, c-format +msgid "Calling with %s account <i>%s</i>" +msgstr "Mit %s Konto <i>%s</i> anrufen" + +#: ../sflphone-gtk/src/sflnotify.c:140 +msgid "Current account" +msgstr "Aktuelles Konto" + +#: ../sflphone-gtk/src/sflnotify.c:169 +msgid "You haven't setup any accounts" +msgstr "Sie haben noch kein Konto eingestellt" + +#: ../sflphone-gtk/src/sflnotify.c:209 +msgid "You have no registered accounts" +msgstr "Sie haben noch kein registriertes Konto" + +#: ../sflphone-gtk/src/sliders.c:161 +msgid "Speakers volume" +msgstr "Lautsprecher Lautstärke" + +#: ../sflphone-gtk/src/sliders.c:163 +msgid "Mic volume" +msgstr "Mikro Lautstärke" + +#: ../sflphone-gtk/src/statusicon.c:91 +msgid "_Show main window" +msgstr "_Hauptfenster anzeigen" + +#: ../sflphone-gtk/src/statusicon.c:124 +#, c-format +msgid "SFLphone - %i accounts registered" +msgstr "SFLphone - %i Konten registriert" + +#: ../sflphone-gtk/src/timestamp.c:46 +msgid "<small>Missed call</small>" +msgstr "<small>Anruf verpasst</small>" + +#: ../sflphone-gtk/src/timestamp.c:64 +#, c-format +msgid "<small>Duration:</small> %s" +msgstr "<small>Dauer:</small> %s" + +#: ../sflphone-gtk/src/toolbar.c:49 +#, c-format +msgid "\"Voicemail\" <%s>" +msgstr "\"Voicemail\" <%s>" + +#: ../sflphone-gtk/src/toolbar.c:175 ../sflphone-gtk/src/toolbar.c:177 +msgid "Place a call" +msgstr "Anrufen" + +#: ../sflphone-gtk/src/toolbar.c:184 ../sflphone-gtk/src/toolbar.c:186 +msgid "Pick up" +msgstr "Abnehmen" + +#: ../sflphone-gtk/src/toolbar.c:194 ../sflphone-gtk/src/toolbar.c:196 +msgid "Hang up" +msgstr "Auflegen" + +#: ../sflphone-gtk/src/toolbar.c:204 ../sflphone-gtk/src/toolbar.c:206 +msgid "Off Hold" +msgstr "Aus Warteschleife" -#: ../sflphone-gtk/src/audioconf.c:154 +#: ../sflphone-gtk/src/toolbar.c:215 ../sflphone-gtk/src/toolbar.c:217 +msgid "On Hold" +msgstr "In Warteschleife" + +#: ../sflphone-gtk/src/toolbar.c:228 ../sflphone-gtk/src/toolbar.c:230 +msgid "Transfer" +msgstr "Weiterleiten" + +#: ../sflphone-gtk/src/toolbar.c:240 ../sflphone-gtk/src/toolbar.c:242 +msgid "History" +msgstr "Vorherige Anrufe" + +#: ../sflphone-gtk/src/toolbar.c:251 ../sflphone-gtk/src/toolbar.c:253 +msgid "Address book" +msgstr "" + +#: ../sflphone-gtk/src/toolbar.c:258 ../sflphone-gtk/src/toolbar.c:262 +msgid "Voicemail" +msgstr "Voicemail" + +#: ../sflphone-gtk/src/toolbar.c:270 +msgid "Record a call" +msgstr "Gespräch aufzeichnen" + +#: ../sflphone-gtk/src/contacts/history.c:75 +#: ../sflphone-gtk/src/contacts/searchbar.c:39 +#: ../sflphone-gtk/src/contacts/searchbar.c:65 +msgid "Search" +msgstr "Suchen" + +#: ../sflphone-gtk/src/config/accountwindow.c:103 +msgid "Account settings" +msgstr "Kontoeinstellungen" + +#: ../sflphone-gtk/src/config/accountwindow.c:115 +msgid "Account parameters" +msgstr "Kontoparameter" + +#: ../sflphone-gtk/src/config/accountwindow.c:137 +msgid "_Enabled" +msgstr "_Aktiv" + +#: ../sflphone-gtk/src/config/accountwindow.c:151 +msgid "_Protocol" +msgstr "_Protokoll" + +#: ../sflphone-gtk/src/config/accountwindow.c:169 +msgid "Unknown" +msgstr "unbekannt" + +#: ../sflphone-gtk/src/config/accountwindow.c:209 +msgid "_Voicemail box #" +msgstr "_Voicemail Boxnummer" + +#: ../sflphone-gtk/src/config/addressbook-config.c:105 +msgid "Search Parameters" +msgstr "Parametersuche" + +#: ../sflphone-gtk/src/config/addressbook-config.c:116 +msgid "Maximum result number for a request: " +msgstr "Maximale Anzahl der Resultaten per Abfrage: " + +#: ../sflphone-gtk/src/config/addressbook-config.c:127 +msgid "_Display contact photo if available" +msgstr "" + +#: ../sflphone-gtk/src/config/addressbook-config.c:132 +msgid "Search for and display: " +msgstr "" + +#: ../sflphone-gtk/src/config/addressbook-config.c:135 +msgid "_Business phone" +msgstr "" + +#: ../sflphone-gtk/src/config/addressbook-config.c:140 +msgid "_Home phone" +msgstr "" + +#: ../sflphone-gtk/src/config/addressbook-config.c:145 +msgid "_Mobile phone" +msgstr "" + +#: ../sflphone-gtk/src/config/audioconf.c:154 #, c-format msgid "audio device index for output = %d\n" msgstr "\"Audio device index\" für Ausgabe = %d\n" -#: ../sflphone-gtk/src/audioconf.c:562 +#: ../sflphone-gtk/src/config/audioconf.c:562 msgid "Name" msgstr "Name" -#: ../sflphone-gtk/src/audioconf.c:567 +#: ../sflphone-gtk/src/config/audioconf.c:567 msgid "Frequency" msgstr "Frequenz" -#: ../sflphone-gtk/src/audioconf.c:572 +#: ../sflphone-gtk/src/config/audioconf.c:572 msgid "Bitrate" msgstr "Bitrate" -#: ../sflphone-gtk/src/audioconf.c:577 +#: ../sflphone-gtk/src/config/audioconf.c:577 msgid "Bandwidth" msgstr "Bandbreite" -#: ../sflphone-gtk/src/audioconf.c:637 +#: ../sflphone-gtk/src/config/audioconf.c:637 msgid "Pulseaudio" msgstr "Pulseaudio" -#: ../sflphone-gtk/src/audioconf.c:640 +#: ../sflphone-gtk/src/config/audioconf.c:640 msgid "ALSA" msgstr "ALSA" -#: ../sflphone-gtk/src/audioconf.c:666 +#: ../sflphone-gtk/src/config/audioconf.c:666 msgid "ALSA plugin" msgstr "ALSA Plugin" -#: ../sflphone-gtk/src/audioconf.c:688 +#: ../sflphone-gtk/src/config/audioconf.c:688 msgid "Output" msgstr "Ausgabe" -#: ../sflphone-gtk/src/audioconf.c:710 +#: ../sflphone-gtk/src/config/audioconf.c:710 msgid "Input" msgstr "Eingabe" -#: ../sflphone-gtk/src/audioconf.c:743 +#: ../sflphone-gtk/src/config/audioconf.c:743 msgid "_Enable ringtones" msgstr "Klingeltöne _einschalten" -#: ../sflphone-gtk/src/audioconf.c:748 +#: ../sflphone-gtk/src/config/audioconf.c:748 msgid "Choose a ringtone" msgstr "Klingelton auswählen" -#: ../sflphone-gtk/src/audioconf.c:753 +#: ../sflphone-gtk/src/config/audioconf.c:753 msgid "Audio Files" msgstr "Audio Dateien" -#: ../sflphone-gtk/src/audioconf.c:770 +#: ../sflphone-gtk/src/config/audioconf.c:770 msgid "_Activate silence detection" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:798 +#: ../sflphone-gtk/src/config/audioconf.c:798 msgid "Sound Manager" msgstr "Sound Manager" -#: ../sflphone-gtk/src/audioconf.c:805 +#: ../sflphone-gtk/src/config/audioconf.c:805 msgid "ALSA configuration" msgstr "ALSA Konfiguration" -#: ../sflphone-gtk/src/audioconf.c:815 +#: ../sflphone-gtk/src/config/audioconf.c:815 msgid "Codecs" msgstr "Codecs" -#: ../sflphone-gtk/src/audioconf.c:823 +#: ../sflphone-gtk/src/config/audioconf.c:823 msgid "Noise reduction" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:830 +#: ../sflphone-gtk/src/config/audioconf.c:830 msgid "Ringtones" msgstr "Klingeltöne" -#: ../sflphone-gtk/src/calltree.c:209 -#, c-format -msgid "\"Voicemail\" <%s>" -msgstr "\"Voicemail\" <%s>" - -#: ../sflphone-gtk/src/calltree.c:431 ../sflphone-gtk/src/calltree.c:433 -msgid "Place a call" -msgstr "Anrufen" - -#: ../sflphone-gtk/src/calltree.c:440 ../sflphone-gtk/src/calltree.c:442 -msgid "Pick up" -msgstr "Abnehmen" - -#: ../sflphone-gtk/src/calltree.c:450 ../sflphone-gtk/src/calltree.c:452 -msgid "Hang up" -msgstr "Auflegen" - -#: ../sflphone-gtk/src/calltree.c:460 ../sflphone-gtk/src/calltree.c:462 -msgid "Off Hold" -msgstr "Aus Warteschleife" - -#: ../sflphone-gtk/src/calltree.c:471 ../sflphone-gtk/src/calltree.c:473 -msgid "On Hold" -msgstr "In Warteschleife" - -#: ../sflphone-gtk/src/calltree.c:484 ../sflphone-gtk/src/calltree.c:486 -msgid "Transfer" -msgstr "Weiterleiten" - -#: ../sflphone-gtk/src/calltree.c:496 ../sflphone-gtk/src/calltree.c:498 -msgid "History" -msgstr "Vorherige Anrufe" - -#: ../sflphone-gtk/src/calltree.c:506 ../sflphone-gtk/src/calltree.c:510 -msgid "Voicemail" -msgstr "Voicemail" - -#: ../sflphone-gtk/src/calltree.c:521 -msgid "Record a call" -msgstr "Gespräch aufzeichnen" - -#: ../sflphone-gtk/src/configwindow.c:382 +#: ../sflphone-gtk/src/config/configwindow.c:385 msgid "Protocol" msgstr "Protokoll" -#: ../sflphone-gtk/src/configwindow.c:389 +#: ../sflphone-gtk/src/config/configwindow.c:392 msgid "Status" msgstr "Status" -#: ../sflphone-gtk/src/configwindow.c:492 +#: ../sflphone-gtk/src/config/configwindow.c:495 msgid "Stun parameters will apply to each SIP account created." msgstr "" -#: ../sflphone-gtk/src/configwindow.c:500 +#: ../sflphone-gtk/src/config/configwindow.c:503 msgid "Enable it if you are behind a firewall" msgstr "Einschalten falls Sie hinter einer Firewall sind" -#: ../sflphone-gtk/src/configwindow.c:508 +#: ../sflphone-gtk/src/config/configwindow.c:511 msgid "Format: name.server:port" msgstr "Format: Name.Server:Port" -#: ../sflphone-gtk/src/configwindow.c:558 +#: ../sflphone-gtk/src/config/configwindow.c:561 msgid "Desktop Notification" msgstr "Desktopbenachrichtigung" -#: ../sflphone-gtk/src/configwindow.c:566 +#: ../sflphone-gtk/src/config/configwindow.c:569 msgid "_Enable" msgstr "_Einschalten" -#: ../sflphone-gtk/src/configwindow.c:571 +#: ../sflphone-gtk/src/config/configwindow.c:574 msgid "_Notify voice mails" msgstr "_Benachrichtigung für Voice Nachrichten" -#: ../sflphone-gtk/src/configwindow.c:577 +#: ../sflphone-gtk/src/config/configwindow.c:580 msgid "System Tray Icon" msgstr "Benachrichtigungsfeld (\"System Tray\") Icon" -#: ../sflphone-gtk/src/configwindow.c:585 +#: ../sflphone-gtk/src/config/configwindow.c:588 msgid "_Popup main window on incoming call" msgstr "Hauptfenster anzeigen wenn eingehendes Gespräch" -#: ../sflphone-gtk/src/configwindow.c:590 +#: ../sflphone-gtk/src/config/configwindow.c:593 msgid "Ne_ver popup main window" msgstr "_Hauptfenster nie anzeigen" -#: ../sflphone-gtk/src/configwindow.c:594 +#: ../sflphone-gtk/src/config/configwindow.c:597 msgid "_Start hidden" msgstr "_Unsichtbar beim Start" -#: ../sflphone-gtk/src/configwindow.c:600 +#: ../sflphone-gtk/src/config/configwindow.c:603 msgid "Calls History" msgstr "Liste der vorherigen Anrufen" -#: ../sflphone-gtk/src/configwindow.c:608 +#: ../sflphone-gtk/src/config/configwindow.c:611 msgid "_Maximum number of calls" msgstr "_maximale Anzahl von Anrufen" -#: ../sflphone-gtk/src/configwindow.c:624 +#: ../sflphone-gtk/src/config/configwindow.c:627 msgid "PulseAudio sound server" msgstr "PulseAudio Sound Server" -#: ../sflphone-gtk/src/configwindow.c:632 +#: ../sflphone-gtk/src/config/configwindow.c:635 msgid "_Control running applications volume" msgstr "Lautstärke für laufende Anwendungen _einstellen" -#: ../sflphone-gtk/src/configwindow.c:645 +#: ../sflphone-gtk/src/config/configwindow.c:648 msgid "SIP Port" msgstr "SIP Port" -#: ../sflphone-gtk/src/configwindow.c:658 +#: ../sflphone-gtk/src/config/configwindow.c:661 msgid "Port:" msgstr "Port:" -#: ../sflphone-gtk/src/configwindow.c:703 +#: ../sflphone-gtk/src/config/configwindow.c:706 msgid "General" msgstr "Allgemein" -#: ../sflphone-gtk/src/configwindow.c:714 +#: ../sflphone-gtk/src/config/configwindow.c:717 msgid "_Destination folder" msgstr "" -#: ../sflphone-gtk/src/configwindow.c:719 +#: ../sflphone-gtk/src/config/configwindow.c:723 msgid "Select a folder" msgstr "" -#: ../sflphone-gtk/src/configwindow.c:744 +#: ../sflphone-gtk/src/config/configwindow.c:748 msgid "Preferences" msgstr "Einstellungen" -#: ../sflphone-gtk/src/configwindow.c:764 +#: ../sflphone-gtk/src/config/configwindow.c:768 msgid "General Settings" msgstr "Allgemeine Einstellungen" -#: ../sflphone-gtk/src/configwindow.c:769 +#: ../sflphone-gtk/src/config/configwindow.c:773 msgid "Audio Settings" msgstr "Audio Einstellungen" -#: ../sflphone-gtk/src/configwindow.c:774 +#: ../sflphone-gtk/src/config/configwindow.c:778 msgid "Record" msgstr "" -#: ../sflphone-gtk/src/configwindow.c:798 +#: ../sflphone-gtk/src/config/configwindow.c:783 +msgid "Address Book" +msgstr "" + +#: ../sflphone-gtk/src/config/configwindow.c:788 +msgid "Hooks" +msgstr "" + +#: ../sflphone-gtk/src/config/configwindow.c:814 msgid "Accounts" msgstr "Konten" -#: ../sflphone-gtk/src/configwindow.c:810 +#: ../sflphone-gtk/src/config/configwindow.c:826 msgid "Accounts previously setup" msgstr "Zuvor eingestellte Konten" -#: ../sflphone-gtk/src/errors.c:28 -msgid "" -"<b>ALSA notification</b>\n" -"\n" -"Error while opening playback device" +#: ../sflphone-gtk/src/config/hooks-config.c:92 +msgid "URL argument" msgstr "" -"<b>ALSA Benachrichtigung</b>\n" -"\n" -"Fehler während Öffnen des \"playback device\"" -#: ../sflphone-gtk/src/errors.c:31 -msgid "" -"<b>ALSA notification</b>\n" -"\n" -"Error while opening capture device" -msgstr "" -"<b>ALSA Benachrichtigung</b>\n" -"\n" -"Fehler während Öffnen des \"capture device\"" +#: ../sflphone-gtk/src/config/hooks-config.c:102 +msgid "_SIP protocol" +msgstr "_SIP protokoll" -#: ../sflphone-gtk/src/errors.c:34 -msgid "" -"<b>Pulseaudio notification</b>\n" -"\n" -"Pulseaudio is not running" -msgstr "" -"<b>Pulseaudio Benachrichtigung</b>\n" -"\n" -"Pulseaudio nicht gestartet" +#: ../sflphone-gtk/src/config/hooks-config.c:107 +msgid "_IAX2 protocol" +msgstr "_IAX2 protokoll" -#: ../sflphone-gtk/src/historyfilter.c:49 -#: ../sflphone-gtk/src/historyfilter.c:68 -#: ../sflphone-gtk/src/historyfilter.c:83 -msgid "Search" -msgstr "Suchen" - -#: ../sflphone-gtk/src/mainwindow.c:69 -msgid "There is one call in progress." -msgstr "Laufender Anruf." - -#: ../sflphone-gtk/src/mainwindow.c:73 -msgid "There are calls in progress." -msgstr "Laufende Anrufe." - -#: ../sflphone-gtk/src/mainwindow.c:82 -msgid "Do you still want to quit?" +#: ../sflphone-gtk/src/config/hooks-config.c:113 +msgid "_SIP Header: " msgstr "" -#: ../sflphone-gtk/src/menus.c:135 -msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." -msgstr "SFLphone ist ein VoIP Client (kompatibel mit SIP und IAX2 Protokolle)" - -#: ../sflphone-gtk/src/menus.c:138 -msgid "About SFLphone" -msgstr "Über SFLphone" - -#: ../sflphone-gtk/src/menus.c:161 -msgid "_Help" -msgstr "_Hilfe" - -#: ../sflphone-gtk/src/menus.c:278 -msgid "_New call" -msgstr "_Neuer Anruf" - -#: ../sflphone-gtk/src/menus.c:290 ../sflphone-gtk/src/menus.c:760 -msgid "_Pick up" -msgstr "_Abnehmen" - -#: ../sflphone-gtk/src/menus.c:300 ../sflphone-gtk/src/menus.c:772 -msgid "_Hang up" -msgstr "A_uflegen" - -#: ../sflphone-gtk/src/menus.c:310 ../sflphone-gtk/src/menus.c:784 -msgid "On _Hold" -msgstr "in _Warteschleife" - -#: ../sflphone-gtk/src/menus.c:326 -msgid "_Account Assistant" -msgstr "_Konto Setup Assistent" - -#: ../sflphone-gtk/src/menus.c:356 -msgid "_Call" -msgstr "_Anruf" - -#: ../sflphone-gtk/src/menus.c:529 -msgid "_Clear history" -msgstr "Liste der vorherigen Anrufen _leeren" - -#: ../sflphone-gtk/src/menus.c:541 -msgid "_Accounts" -msgstr "_Konten" - -#: ../sflphone-gtk/src/menus.c:556 -msgid "_Edit" -msgstr "_Editieren" - -#: ../sflphone-gtk/src/menus.c:616 -msgid "_Dialpad" -msgstr "_Wählscheibe" - -#: ../sflphone-gtk/src/menus.c:628 -msgid "_Volume controls" -msgstr "Lautstärke Kontrollen" - -#: ../sflphone-gtk/src/menus.c:637 -msgid "_Search history" -msgstr "In vorherige Anrufen _suchen" - -#: ../sflphone-gtk/src/menus.c:645 -msgid "_View" -msgstr "_Anzeigen" - -#: ../sflphone-gtk/src/menus.c:867 -msgid "_Call back" -msgstr "_zurückrufen" - -#: ../sflphone-gtk/src/sflnotify.c:34 ../sflphone-gtk/src/sflnotify.c:100 -#, c-format -msgid "%s account: %s" -msgstr "%s Konto: %s" - -#: ../sflphone-gtk/src/sflnotify.c:37 -#, c-format -msgid "<i>From:</i> %s" -msgstr "<i>Von:</i> %s" - -#: ../sflphone-gtk/src/sflnotify.c:52 -msgid "Accept" -msgstr "Annehmen" - -#: ../sflphone-gtk/src/sflnotify.c:53 -msgid "Refuse" -msgstr "Ablehnen" - -#: ../sflphone-gtk/src/sflnotify.c:54 ../sflphone-gtk/src/sflnotify.c:117 -#: ../sflphone-gtk/src/sflnotify.c:154 -msgid "Ignore" -msgstr "Ignorieren" - -#: ../sflphone-gtk/src/sflnotify.c:136 -#, c-format -msgid "Calling with %s account <i>%s</i>" -msgstr "Mit %s Konto <i>%s</i> anrufen" - -#: ../sflphone-gtk/src/sflnotify.c:140 -msgid "Current account" -msgstr "Aktuelles Konto" - -#: ../sflphone-gtk/src/sflnotify.c:169 -msgid "You haven't setup any accounts" -msgstr "Sie haben noch kein Konto eingestellt" - -#: ../sflphone-gtk/src/sflnotify.c:185 ../sflphone-gtk/src/sflnotify.c:224 -msgid "Setup Accounts" -msgstr "Konten einstellen" - -#: ../sflphone-gtk/src/sflnotify.c:208 -msgid "You have no registered accounts" -msgstr "Sie haben noch kein registriertes Konto" - -#: ../sflphone-gtk/src/sliders.c:161 -msgid "Speakers volume" -msgstr "Lautsprecher Lautstärke" - -#: ../sflphone-gtk/src/sliders.c:163 -msgid "Mic volume" -msgstr "Mikro Lautstärke" - -#: ../sflphone-gtk/src/statusicon.c:91 -msgid "_Show main window" -msgstr "_Hauptfenster anzeigen" - -#: ../sflphone-gtk/src/statusicon.c:124 -#, c-format -msgid "SFLphone - %i accounts registered" -msgstr "SFLphone - %i Konten registriert" +#: ../sflphone-gtk/src/config/hooks-config.c:120 +msgid "_Command: " +msgstr "" -#: ../sflphone-gtk/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "<small>Anruf verpasst</small>" +#~ msgid "SFLphone 0.9.3" +#~ msgstr "SFLphone 0.9.2" -#: ../sflphone-gtk/src/timestamp.c:64 -#, c-format -msgid "<small>Duration:</small> %s" -msgstr "<small>Dauer:</small> %s" +#~ msgid "Setup Accounts" +#~ msgstr "Konten einstellen" #~ msgid "_STUN Server" #~ msgstr "_STUN Server" @@ -647,3 +742,4 @@ msgstr "<small>Dauer:</small> %s" #~ msgid "History empty" #~ msgstr "Liste der vorherigen Anrufen is leer" + diff --git a/po/es.po b/po/es.po index 199352a0b8806a41df35b21e31faa3edfc90df25..f55ec7ea4edbd3f40822bc96347877bbfa6fcba6 100644 --- a/po/es.po +++ b/po/es.po @@ -1,5 +1,5 @@ # Spanish translation of SFLphone. -# Copyright (C) 2008 The Free Software Foundation, Inc. +# Copyright (C) 2008 2009 The Free Software Foundation, Inc. # This file is distributed under the GNU General Public License Version 3. # # Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>, 2008. @@ -7,11 +7,11 @@ # POT-Creation-Date: 2007-01-13 01:39+0100\n msgid "" msgstr "" -"Project-Id-Version: SFLphone 0.9.2\n" +"Project-Id-Version: SFLphone 0.9.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-02-10 15:24-0500\n" +"POT-Creation-Date: 2009-04-02 11:15-0400\n" "PO-Revision-Date: 2008-08-11 11:53+0200\n" -"Last-Translator: Carlos Galisteo <cgalisteo AT k-rolus.net>\n" +"Last-Translator: Maxime Chambreuil <maxime.chambreuil@savoirfairelinux.com>\n" "Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -31,7 +31,7 @@ msgid "Trying..." msgstr "Intentando..." #: ../sflphone-gtk/src/accountlist.c:167 ../sflphone-gtk/src/sflnotify.c:171 -#: ../sflphone-gtk/src/sflnotify.c:210 +#: ../sflphone-gtk/src/sflnotify.c:212 msgid "Error" msgstr "Error" @@ -59,66 +59,22 @@ msgstr "Servidor stun inválido" msgid "Invalid" msgstr "Inválido" -#: ../sflphone-gtk/src/accountwindow.c:109 -msgid "Account settings" -msgstr "Configuración de cuentas" - -#: ../sflphone-gtk/src/accountwindow.c:121 -msgid "Account parameters" -msgstr "Paràmetros de cuenta" - -#: ../sflphone-gtk/src/accountwindow.c:143 -msgid "_Enabled" -msgstr "_Activado" - -#: ../sflphone-gtk/src/accountwindow.c:149 ../sflphone-gtk/src/assistant.c:238 -#: ../sflphone-gtk/src/assistant.c:292 -msgid "_Alias" -msgstr "_Alias" - -#: ../sflphone-gtk/src/accountwindow.c:157 -msgid "_Protocol" -msgstr "_Protocolo" - -#: ../sflphone-gtk/src/accountwindow.c:175 -msgid "Unknown" -msgstr "Desconocido" - -#: ../sflphone-gtk/src/accountwindow.c:185 ../sflphone-gtk/src/assistant.c:246 -#: ../sflphone-gtk/src/assistant.c:300 -msgid "_Host name" -msgstr "_Nombre de equipo" - -#: ../sflphone-gtk/src/accountwindow.c:193 ../sflphone-gtk/src/assistant.c:254 -#: ../sflphone-gtk/src/assistant.c:308 -msgid "_User name" -msgstr "_Usuario" - -#: ../sflphone-gtk/src/accountwindow.c:204 ../sflphone-gtk/src/assistant.c:264 -#: ../sflphone-gtk/src/assistant.c:318 -msgid "_Password" -msgstr "_Contraseña" - -#: ../sflphone-gtk/src/accountwindow.c:215 -msgid "_Voicemail box #" -msgstr "_Número de buzón de voz" - -#: ../sflphone-gtk/src/actions.c:57 ../sflphone-gtk/src/sflnotify.c:103 +#: ../sflphone-gtk/src/actions.c:55 ../sflphone-gtk/src/sflnotify.c:103 #, c-format msgid "%d voice mails" msgstr "%d mensajes de voz" -#: ../sflphone-gtk/src/actions.c:59 +#: ../sflphone-gtk/src/actions.c:57 #, c-format msgid "%d voice mail" msgstr "%d mensaje de voz" -#: ../sflphone-gtk/src/actions.c:80 +#: ../sflphone-gtk/src/actions.c:81 #, c-format msgid "%s account- %s" msgstr "%s cuenta: %s" -#: ../sflphone-gtk/src/actions.c:224 +#: ../sflphone-gtk/src/actions.c:225 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -126,7 +82,12 @@ msgstr "" "Incapaz de conectar con el servidor SFLphone.\n" " Asegúrese de que el demonio esté funcionando." -#: ../sflphone-gtk/src/actions.c:798 +#: ../sflphone-gtk/src/actions.c:764 +#, c-format +msgid "%s account- %s %s" +msgstr "%s cuenta- %s %s" + +#: ../sflphone-gtk/src/actions.c:861 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -139,43 +100,56 @@ msgstr "" "</b> Los codecs de audio de SFLphone deben estar en <i>%s</i> o en el " "directorio <b>.sflphone</b> de su home( <i>%s</i> )" -#: ../sflphone-gtk/src/assistant.c:148 +#: ../sflphone-gtk/src/assistant.c:31 +#, fuzzy, c-format +msgid "" +"This assistant is now finished.\n" +"You can at any time check your registration state or modify your accounts " +"parameters in the Options/Accounts window.\n" +"\n" +"Alias : %s\n" +"Server : %s\n" +"Username : %s\n" +"Password : %s" +msgstr "" +"Ese asistante ha finalizado.\n" +"\n" +"Puede comprobar en cualquier momento su estado de registro o modificar la " +"configuración de sus cuentas en la ventana de Opciones/Cuentas." + +#: ../sflphone-gtk/src/assistant.c:154 msgid "SFLphone account configuration wizard" msgstr "Asistente de configuración de cuentas de SFLphone" -#: ../sflphone-gtk/src/assistant.c:176 -msgid "SFLphone 0.9.2" -msgstr "SFLphone 0.9.3" - -#: ../sflphone-gtk/src/assistant.c:176 +#: ../sflphone-gtk/src/assistant.c:180 msgid "Welcome to SFLphone!" msgstr "¡Bienvenido a SFLphone!" -#: ../sflphone-gtk/src/assistant.c:178 +#: ../sflphone-gtk/src/assistant.c:181 msgid "This installation wizard will help you configure an account." msgstr "Este asistente de instalación le ayudará a configurar una cuenta." -#: ../sflphone-gtk/src/assistant.c:193 +#: ../sflphone-gtk/src/assistant.c:195 msgid "VoIP Protocols" msgstr "Protocolos VoIP" -#: ../sflphone-gtk/src/assistant.c:193 +#: ../sflphone-gtk/src/assistant.c:195 msgid "Select an account type:" msgstr "Escoja un tipo de cuenta:" -#: ../sflphone-gtk/src/assistant.c:211 +#: ../sflphone-gtk/src/assistant.c:213 msgid "Account" msgstr "Cuentas" -#: ../sflphone-gtk/src/assistant.c:211 +#: ../sflphone-gtk/src/assistant.c:213 msgid "Please select one of the following option:" msgstr "Por favor, rellene la siguiente información:" -#: ../sflphone-gtk/src/assistant.c:213 +#: ../sflphone-gtk/src/assistant.c:215 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "Crear una cuenta SIP/IAX2 gratis en sflphone.org" -#: ../sflphone-gtk/src/assistant.c:215 +#: ../sflphone-gtk/src/assistant.c:217 msgid "Register an existing SIP or IAX2 account" msgstr "Registrar una cuenta SIP o IAX@ existente" @@ -183,462 +157,579 @@ msgstr "Registrar una cuenta SIP o IAX@ existente" msgid "SIP account configuration" msgstr "Configuración de cuenta SIP" -#: ../sflphone-gtk/src/assistant.c:230 ../sflphone-gtk/src/assistant.c:284 +#: ../sflphone-gtk/src/assistant.c:230 ../sflphone-gtk/src/assistant.c:305 msgid "Please fill the following information:" msgstr "Por favor, rellene la siguiente información:" -#: ../sflphone-gtk/src/assistant.c:284 +#: ../sflphone-gtk/src/assistant.c:238 ../sflphone-gtk/src/assistant.c:313 +#: ../sflphone-gtk/src/config/accountwindow.c:143 +msgid "_Alias" +msgstr "_Alias" + +#: ../sflphone-gtk/src/assistant.c:246 ../sflphone-gtk/src/assistant.c:321 +#: ../sflphone-gtk/src/config/accountwindow.c:179 +msgid "_Host name" +msgstr "_Nombre de equipo" + +#: ../sflphone-gtk/src/assistant.c:254 ../sflphone-gtk/src/assistant.c:329 +#: ../sflphone-gtk/src/config/accountwindow.c:187 +msgid "_User name" +msgstr "_Usuario" + +#: ../sflphone-gtk/src/assistant.c:264 ../sflphone-gtk/src/assistant.c:339 +#: ../sflphone-gtk/src/config/accountwindow.c:198 +msgid "_Password" +msgstr "_Contraseña" + +#: ../sflphone-gtk/src/assistant.c:282 +msgid "Optional Email Address " +msgstr "Dirección de correo opcional " + +#: ../sflphone-gtk/src/assistant.c:282 +msgid "This email address will be use to send your voicemail messages" +msgstr "Este dirección de correo sera usado para mandar los mensajes" + +#: ../sflphone-gtk/src/assistant.c:290 +msgid "_Email" +msgstr "_Correo" + +#: ../sflphone-gtk/src/assistant.c:305 msgid "IAX2 account configuration" msgstr "Configuración de cuenta IAX2" -#: ../sflphone-gtk/src/assistant.c:341 ../sflphone-gtk/src/configwindow.c:821 +#: ../sflphone-gtk/src/assistant.c:360 +#: ../sflphone-gtk/src/config/configwindow.c:837 msgid "Network Address Translation" msgstr "Conversión de Dirección de Red (NAT)" -#: ../sflphone-gtk/src/assistant.c:341 +#: ../sflphone-gtk/src/assistant.c:360 msgid "You should probably enable this if you are behind a firewall." msgstr "Probablemente tiene que activar esto si está detrás de un cortafuegos." -#: ../sflphone-gtk/src/assistant.c:350 ../sflphone-gtk/src/configwindow.c:496 +#: ../sflphone-gtk/src/assistant.c:369 +#: ../sflphone-gtk/src/config/configwindow.c:499 msgid "E_nable STUN" msgstr "A_ctivar STUN" -#: ../sflphone-gtk/src/assistant.c:357 +#: ../sflphone-gtk/src/assistant.c:376 msgid "_STUN server" msgstr "_Servidor STUN" -#: ../sflphone-gtk/src/assistant.c:374 +#: ../sflphone-gtk/src/assistant.c:390 msgid "Account Registration" msgstr "Registro de cuenta" -#: ../sflphone-gtk/src/assistant.c:374 +#: ../sflphone-gtk/src/assistant.c:390 msgid "Congratulations!" msgstr "¡Enhorabuena!" -#: ../sflphone-gtk/src/assistant.c:376 +#: ../sflphone-gtk/src/context-menu.c:296 ../sflphone-gtk/src/menus.c:308 +#: ../sflphone-gtk/src/menus.c:791 +msgid "_Pick up" +msgstr "_Descolgar" + +#: ../sflphone-gtk/src/context-menu.c:308 ../sflphone-gtk/src/menus.c:318 +#: ../sflphone-gtk/src/menus.c:803 +msgid "_Hang up" +msgstr "_Colgar" + +#: ../sflphone-gtk/src/context-menu.c:320 ../sflphone-gtk/src/menus.c:328 +#: ../sflphone-gtk/src/menus.c:815 +msgid "On _Hold" +msgstr "En _Espera" + +#: ../sflphone-gtk/src/context-menu.c:332 ../sflphone-gtk/src/menus.c:340 +#: ../sflphone-gtk/src/menus.c:827 +msgid "_Record" +msgstr "_Recordar" + +#: ../sflphone-gtk/src/errors.c:28 msgid "" -"This assistant is now finished.\n" +"<b>ALSA notification</b>\n" "\n" -" You can at any time check your registration state or modify your accounts " -"parameters in the Options/Accounts window." +"Error while opening playback device" msgstr "" -"Ese asistante ha finalizado.\n" +"<b>Notificación ALSA</b>\n" "\n" -"Puede comprobar en cualquier momento su estado de registro o modificar la " -"configuración de sus cuentas en la ventana de Opciones/Cuentas." +"Error al abrir el dispositivo de reproducción" + +#: ../sflphone-gtk/src/errors.c:31 +msgid "" +"<b>ALSA notification</b>\n" +"\n" +"Error while opening capture device" +msgstr "" +"<b>Notificación ALSA</b>\n" +"\n" +"Error al abrir el dispositivo de captura" + +#: ../sflphone-gtk/src/errors.c:34 +msgid "" +"<b>Pulseaudio notification</b>\n" +"\n" +"Pulseaudio is not running" +msgstr "" +"<b>Notificación de Pulseaudio</b>\n" +"\n" +"Pulseaudio no está funcionando" + +#: ../sflphone-gtk/src/mainwindow.c:70 +msgid "There is one call in progress." +msgstr "No hay llamada en curso" + +#: ../sflphone-gtk/src/mainwindow.c:74 +msgid "There are calls in progress." +msgstr "Hay llamadas en curso." + +#: ../sflphone-gtk/src/mainwindow.c:83 +msgid "Do you still want to quit?" +msgstr "Sin embargo quiere parar ?" + +#: ../sflphone-gtk/src/menus.c:131 +msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." +msgstr "" +"SFLphone es un telefono por Internet compatible con los protocolos SIP y IAX2" + +#: ../sflphone-gtk/src/menus.c:134 +msgid "About SFLphone" +msgstr "Sobre SFLphone" + +#: ../sflphone-gtk/src/menus.c:157 +msgid "_Help" +msgstr "_Ayuda" + +#: ../sflphone-gtk/src/menus.c:296 ../sflphone-gtk/src/menus.c:949 +msgid "_New call" +msgstr "_Nueva llamada" + +#: ../sflphone-gtk/src/menus.c:354 +msgid "_Account Assistant" +msgstr "_Asistente de Cuenta" + +#: ../sflphone-gtk/src/menus.c:384 +msgid "_Call" +msgstr "_Llamar" + +#: ../sflphone-gtk/src/menus.c:557 +msgid "_Clear history" +msgstr "Historia de Llamada" + +#: ../sflphone-gtk/src/menus.c:569 +msgid "_Accounts" +msgstr "_Cuentas" + +#: ../sflphone-gtk/src/menus.c:584 +msgid "_Edit" +msgstr "_Editar" + +#: ../sflphone-gtk/src/menus.c:644 +msgid "_Dialpad" +msgstr "_Teclado numérico" -#: ../sflphone-gtk/src/audioconf.c:154 +#: ../sflphone-gtk/src/menus.c:656 +msgid "_Volume controls" +msgstr "_Controles de volumen" + +#: ../sflphone-gtk/src/menus.c:665 +msgid "_Search contact" +msgstr "_Buscar contactos" + +#: ../sflphone-gtk/src/menus.c:673 +msgid "_View" +msgstr "_Ver" + +#: ../sflphone-gtk/src/menus.c:885 +msgid "_Call back" +msgstr "_Llamar" + +#: ../sflphone-gtk/src/sflnotify.c:34 ../sflphone-gtk/src/sflnotify.c:100 +#, c-format +msgid "%s account: %s" +msgstr "%s cuenta: %s" + +#: ../sflphone-gtk/src/sflnotify.c:37 +#, c-format +msgid "<i>From:</i> %s" +msgstr "<i>De:</i> %s" + +#: ../sflphone-gtk/src/sflnotify.c:52 +msgid "Accept" +msgstr "Aceptar" + +#: ../sflphone-gtk/src/sflnotify.c:53 +msgid "Refuse" +msgstr "Rechazar" + +#: ../sflphone-gtk/src/sflnotify.c:54 ../sflphone-gtk/src/sflnotify.c:117 +#: ../sflphone-gtk/src/sflnotify.c:154 +msgid "Ignore" +msgstr "Ignorar" + +#: ../sflphone-gtk/src/sflnotify.c:136 +#, c-format +msgid "Calling with %s account <i>%s</i>" +msgstr "Llamando con la cuenta %s <i>%s</i>" + +#: ../sflphone-gtk/src/sflnotify.c:140 +msgid "Current account" +msgstr "Cuenta" + +#: ../sflphone-gtk/src/sflnotify.c:169 +msgid "You haven't setup any accounts" +msgstr "No ha configurado cuentas" + +#: ../sflphone-gtk/src/sflnotify.c:209 +msgid "You have no registered accounts" +msgstr "No tiene ninguna cuenta registrada" + +#: ../sflphone-gtk/src/sliders.c:161 +msgid "Speakers volume" +msgstr "Volumen de altavoces" + +#: ../sflphone-gtk/src/sliders.c:163 +msgid "Mic volume" +msgstr "Volumen del micrófono" + +#: ../sflphone-gtk/src/statusicon.c:91 +msgid "_Show main window" +msgstr "Mostrar ventana principal" + +#: ../sflphone-gtk/src/statusicon.c:124 +#, c-format +msgid "SFLphone - %i accounts registered" +msgstr "SFLphone - %i cuenta registrada" + +#: ../sflphone-gtk/src/timestamp.c:46 +msgid "<small>Missed call</small>" +msgstr "<small>Llamada faltada</small>" + +#: ../sflphone-gtk/src/timestamp.c:64 +#, c-format +msgid "<small>Duration:</small> %s" +msgstr "<small>Duración:</small> %s" + +#: ../sflphone-gtk/src/toolbar.c:49 +#, c-format +msgid "\"Voicemail\" <%s>" +msgstr "\"Mensaje\" <%s>" + +#: ../sflphone-gtk/src/toolbar.c:175 ../sflphone-gtk/src/toolbar.c:177 +msgid "Place a call" +msgstr "Llamar" + +#: ../sflphone-gtk/src/toolbar.c:184 ../sflphone-gtk/src/toolbar.c:186 +msgid "Pick up" +msgstr "Descolgar" + +#: ../sflphone-gtk/src/toolbar.c:194 ../sflphone-gtk/src/toolbar.c:196 +msgid "Hang up" +msgstr "Colgar" + +#: ../sflphone-gtk/src/toolbar.c:204 ../sflphone-gtk/src/toolbar.c:206 +msgid "Off Hold" +msgstr "Seguir" + +#: ../sflphone-gtk/src/toolbar.c:215 ../sflphone-gtk/src/toolbar.c:217 +msgid "On Hold" +msgstr "Retener" + +#: ../sflphone-gtk/src/toolbar.c:228 ../sflphone-gtk/src/toolbar.c:230 +msgid "Transfer" +msgstr "Transferir" + +#: ../sflphone-gtk/src/toolbar.c:240 ../sflphone-gtk/src/toolbar.c:242 +msgid "History" +msgstr "Historia de Llamada" + +#: ../sflphone-gtk/src/toolbar.c:251 ../sflphone-gtk/src/toolbar.c:253 +msgid "Address book" +msgstr "" + +#: ../sflphone-gtk/src/toolbar.c:258 ../sflphone-gtk/src/toolbar.c:262 +msgid "Voicemail" +msgstr "Mensaje" + +#: ../sflphone-gtk/src/toolbar.c:270 +msgid "Record a call" +msgstr "Recordar una llamada" + +#: ../sflphone-gtk/src/contacts/history.c:75 +#: ../sflphone-gtk/src/contacts/searchbar.c:39 +#: ../sflphone-gtk/src/contacts/searchbar.c:65 +msgid "Search" +msgstr "Buscar" + +#: ../sflphone-gtk/src/config/accountwindow.c:103 +msgid "Account settings" +msgstr "Configuración de cuentas" + +#: ../sflphone-gtk/src/config/accountwindow.c:115 +msgid "Account parameters" +msgstr "Paràmetros de cuenta" + +#: ../sflphone-gtk/src/config/accountwindow.c:137 +msgid "_Enabled" +msgstr "_Activado" + +#: ../sflphone-gtk/src/config/accountwindow.c:151 +msgid "_Protocol" +msgstr "_Protocolo" + +#: ../sflphone-gtk/src/config/accountwindow.c:169 +msgid "Unknown" +msgstr "Desconocido" + +#: ../sflphone-gtk/src/config/accountwindow.c:209 +msgid "_Voicemail box #" +msgstr "_Número de buzón de voz" + +#: ../sflphone-gtk/src/config/addressbook-config.c:105 +msgid "Search Parameters" +msgstr "Buscar paràmetros" + +#: ../sflphone-gtk/src/config/addressbook-config.c:116 +msgid "Maximum result number for a request: " +msgstr "Numero maximo de resultados de búsqueda" + +#: ../sflphone-gtk/src/config/addressbook-config.c:127 +msgid "_Display contact photo if available" +msgstr "_Mostrar fotos de contactos, si disponible" + +#: ../sflphone-gtk/src/config/addressbook-config.c:132 +msgid "Search for and display: " +msgstr "Buscar y mostrar: " + +#: ../sflphone-gtk/src/config/addressbook-config.c:135 +msgid "_Business phone" +msgstr "_Numero de telefono profecional" + +#: ../sflphone-gtk/src/config/addressbook-config.c:140 +msgid "_Home phone" +msgstr "_Numero de telefono personal" + +#: ../sflphone-gtk/src/config/addressbook-config.c:145 +msgid "_Mobile phone" +msgstr "_Numero de movil" + +#: ../sflphone-gtk/src/config/audioconf.c:154 #, c-format msgid "audio device index for output = %d\n" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:562 +#: ../sflphone-gtk/src/config/audioconf.c:562 msgid "Name" msgstr "Nombre" -#: ../sflphone-gtk/src/audioconf.c:567 +#: ../sflphone-gtk/src/config/audioconf.c:567 msgid "Frequency" msgstr "Frecuencia" -#: ../sflphone-gtk/src/audioconf.c:572 +#: ../sflphone-gtk/src/config/audioconf.c:572 msgid "Bitrate" msgstr "Tasa de transferencia" -#: ../sflphone-gtk/src/audioconf.c:577 +#: ../sflphone-gtk/src/config/audioconf.c:577 msgid "Bandwidth" msgstr "Ancho de banda" -#: ../sflphone-gtk/src/audioconf.c:637 +#: ../sflphone-gtk/src/config/audioconf.c:637 msgid "Pulseaudio" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:640 +#: ../sflphone-gtk/src/config/audioconf.c:640 msgid "ALSA" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:666 +#: ../sflphone-gtk/src/config/audioconf.c:666 msgid "ALSA plugin" msgstr "Plugin ALSA" -#: ../sflphone-gtk/src/audioconf.c:688 +#: ../sflphone-gtk/src/config/audioconf.c:688 msgid "Output" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:710 +#: ../sflphone-gtk/src/config/audioconf.c:710 msgid "Input" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:743 +#: ../sflphone-gtk/src/config/audioconf.c:743 msgid "_Enable ringtones" msgstr "_Habilitar tonos de llamada" -#: ../sflphone-gtk/src/audioconf.c:748 +#: ../sflphone-gtk/src/config/audioconf.c:748 msgid "Choose a ringtone" msgstr "Elija un tono de llmada" -#: ../sflphone-gtk/src/audioconf.c:753 +#: ../sflphone-gtk/src/config/audioconf.c:753 msgid "Audio Files" msgstr "Archivos de Audio" -#: ../sflphone-gtk/src/audioconf.c:770 +#: ../sflphone-gtk/src/config/audioconf.c:770 msgid "_Activate silence detection" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:798 +#: ../sflphone-gtk/src/config/audioconf.c:798 msgid "Sound Manager" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:805 +#: ../sflphone-gtk/src/config/audioconf.c:805 msgid "ALSA configuration" msgstr "Configuraciòn de cuenta SIP" -#: ../sflphone-gtk/src/audioconf.c:815 +#: ../sflphone-gtk/src/config/audioconf.c:815 msgid "Codecs" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:823 +#: ../sflphone-gtk/src/config/audioconf.c:823 msgid "Noise reduction" msgstr "Reducción de ruidos" -#: ../sflphone-gtk/src/audioconf.c:830 +#: ../sflphone-gtk/src/config/audioconf.c:830 msgid "Ringtones" msgstr "_Permitir los ringtones" -#: ../sflphone-gtk/src/calltree.c:209 -#, fuzzy, c-format -msgid "\"Voicemail\" <%s>" -msgstr "\"Buzón de Voz\" <%s>" - -#: ../sflphone-gtk/src/calltree.c:431 ../sflphone-gtk/src/calltree.c:433 -msgid "Place a call" -msgstr "Llamar" - -#: ../sflphone-gtk/src/calltree.c:440 ../sflphone-gtk/src/calltree.c:442 -msgid "Pick up" -msgstr "Descolgar" - -#: ../sflphone-gtk/src/calltree.c:450 ../sflphone-gtk/src/calltree.c:452 -msgid "Hang up" -msgstr "Colgar" - -#: ../sflphone-gtk/src/calltree.c:460 ../sflphone-gtk/src/calltree.c:462 -msgid "Off Hold" -msgstr "Seguir" - -#: ../sflphone-gtk/src/calltree.c:471 ../sflphone-gtk/src/calltree.c:473 -msgid "On Hold" -msgstr "Retener" - -#: ../sflphone-gtk/src/calltree.c:484 ../sflphone-gtk/src/calltree.c:486 -msgid "Transfer" -msgstr "Transferir" - -#: ../sflphone-gtk/src/calltree.c:496 ../sflphone-gtk/src/calltree.c:498 -msgid "History" -msgstr "Historia de Llamada" - -#: ../sflphone-gtk/src/calltree.c:506 ../sflphone-gtk/src/calltree.c:510 -msgid "Voicemail" -msgstr "%d mensaje" - -#: ../sflphone-gtk/src/calltree.c:521 -msgid "Record a call" -msgstr "Registrar una llamada" - -#: ../sflphone-gtk/src/configwindow.c:382 +#: ../sflphone-gtk/src/config/configwindow.c:385 msgid "Protocol" msgstr "Protocolo" -#: ../sflphone-gtk/src/configwindow.c:389 +#: ../sflphone-gtk/src/config/configwindow.c:392 msgid "Status" msgstr "Estado" -#: ../sflphone-gtk/src/configwindow.c:492 +#: ../sflphone-gtk/src/config/configwindow.c:495 msgid "Stun parameters will apply to each SIP account created." msgstr "Parámetros de stun se aplicarán a cada cuenta SIP creada." -#: ../sflphone-gtk/src/configwindow.c:500 +#: ../sflphone-gtk/src/config/configwindow.c:503 msgid "Enable it if you are behind a firewall" msgstr "Actívelo si está detrás de un cortafuegos, después reinicie SFLphone" -#: ../sflphone-gtk/src/configwindow.c:508 +#: ../sflphone-gtk/src/config/configwindow.c:511 msgid "Format: name.server:port" msgstr "Formato: nombre.servidor:puerto" -#: ../sflphone-gtk/src/configwindow.c:558 +#: ../sflphone-gtk/src/config/configwindow.c:561 msgid "Desktop Notification" msgstr "Notificación de escritorio" -#: ../sflphone-gtk/src/configwindow.c:566 +#: ../sflphone-gtk/src/config/configwindow.c:569 msgid "_Enable" msgstr "_Activar" -#: ../sflphone-gtk/src/configwindow.c:571 +#: ../sflphone-gtk/src/config/configwindow.c:574 msgid "_Notify voice mails" msgstr "_Notificar mensajes de voz" -#: ../sflphone-gtk/src/configwindow.c:577 +#: ../sflphone-gtk/src/config/configwindow.c:580 msgid "System Tray Icon" msgstr "Icono de bandeja del sistema" -#: ../sflphone-gtk/src/configwindow.c:585 +#: ../sflphone-gtk/src/config/configwindow.c:588 msgid "_Popup main window on incoming call" msgstr "_Popup ventana principal al recibir llamadas" -#: ../sflphone-gtk/src/configwindow.c:590 +#: ../sflphone-gtk/src/config/configwindow.c:593 msgid "Ne_ver popup main window" msgstr "_Nunca mostrar ventana principal" -#: ../sflphone-gtk/src/configwindow.c:594 +#: ../sflphone-gtk/src/config/configwindow.c:597 msgid "_Start hidden" msgstr "_Iniciar oculto" -#: ../sflphone-gtk/src/configwindow.c:600 +#: ../sflphone-gtk/src/config/configwindow.c:603 msgid "Calls History" msgstr "Historial de llamadas" -#: ../sflphone-gtk/src/configwindow.c:608 +#: ../sflphone-gtk/src/config/configwindow.c:611 msgid "_Maximum number of calls" msgstr "_Numero maximo de llamadas" -#: ../sflphone-gtk/src/configwindow.c:624 +#: ../sflphone-gtk/src/config/configwindow.c:627 msgid "PulseAudio sound server" msgstr "Servidor de sonido Pulseaudio" -#: ../sflphone-gtk/src/configwindow.c:632 +#: ../sflphone-gtk/src/config/configwindow.c:635 msgid "_Control running applications volume" msgstr "_Control del volumen de las applicaciones en curso" -#: ../sflphone-gtk/src/configwindow.c:645 +#: ../sflphone-gtk/src/config/configwindow.c:648 msgid "SIP Port" msgstr "" -#: ../sflphone-gtk/src/configwindow.c:658 +#: ../sflphone-gtk/src/config/configwindow.c:661 msgid "Port:" msgstr "" -#: ../sflphone-gtk/src/configwindow.c:703 +#: ../sflphone-gtk/src/config/configwindow.c:706 msgid "General" msgstr "Configuración" -#: ../sflphone-gtk/src/configwindow.c:714 +#: ../sflphone-gtk/src/config/configwindow.c:717 msgid "_Destination folder" msgstr "_Carpeta de destinación" -#: ../sflphone-gtk/src/configwindow.c:719 +#: ../sflphone-gtk/src/config/configwindow.c:723 msgid "Select a folder" msgstr "" -#: ../sflphone-gtk/src/configwindow.c:744 +#: ../sflphone-gtk/src/config/configwindow.c:748 msgid "Preferences" msgstr "Preferencias" -#: ../sflphone-gtk/src/configwindow.c:764 +#: ../sflphone-gtk/src/config/configwindow.c:768 msgid "General Settings" msgstr "Configuración" -#: ../sflphone-gtk/src/configwindow.c:769 +#: ../sflphone-gtk/src/config/configwindow.c:773 msgid "Audio Settings" msgstr "Configuración de audio" -#: ../sflphone-gtk/src/configwindow.c:774 +#: ../sflphone-gtk/src/config/configwindow.c:778 msgid "Record" msgstr "Registrar" -#: ../sflphone-gtk/src/configwindow.c:798 +#: ../sflphone-gtk/src/config/configwindow.c:783 +msgid "Address Book" +msgstr "" + +#: ../sflphone-gtk/src/config/configwindow.c:788 +msgid "Hooks" +msgstr "" + +#: ../sflphone-gtk/src/config/configwindow.c:814 msgid "Accounts" msgstr "Cuentas" -#: ../sflphone-gtk/src/configwindow.c:810 +#: ../sflphone-gtk/src/config/configwindow.c:826 msgid "Accounts previously setup" msgstr "Cuentas existentes" -#: ../sflphone-gtk/src/errors.c:28 -msgid "" -"<b>ALSA notification</b>\n" -"\n" -"Error while opening playback device" +#: ../sflphone-gtk/src/config/hooks-config.c:92 +msgid "URL argument" msgstr "" -"<b>Notificación ALSA</b>\n" -"\n" -"Error al abrir el dispositivo de reproducción" -#: ../sflphone-gtk/src/errors.c:31 -msgid "" -"<b>ALSA notification</b>\n" -"\n" -"Error while opening capture device" -msgstr "" -"<b>Notificación ALSA</b>\n" -"\n" -"Error al abrir el dispositivo de captura" - -#: ../sflphone-gtk/src/errors.c:34 -msgid "" -"<b>Pulseaudio notification</b>\n" -"\n" -"Pulseaudio is not running" -msgstr "" -"<b>Notificación de Pulseaudio</b>\n" -"\n" -"Pulseaudio no está funcionando" - -#: ../sflphone-gtk/src/historyfilter.c:49 -#: ../sflphone-gtk/src/historyfilter.c:68 -#: ../sflphone-gtk/src/historyfilter.c:83 -msgid "Search" -msgstr "Buscar" +#: ../sflphone-gtk/src/config/hooks-config.c:102 +msgid "_SIP protocol" +msgstr "_Protocolo SIP" -#: ../sflphone-gtk/src/mainwindow.c:69 -msgid "There is one call in progress." -msgstr "No hay llamada en curso" +#: ../sflphone-gtk/src/config/hooks-config.c:107 +msgid "_IAX2 protocol" +msgstr "_Protocolo IAX2" -#: ../sflphone-gtk/src/mainwindow.c:73 -msgid "There are calls in progress." -msgstr "Hay llamadas en curso." - -#: ../sflphone-gtk/src/mainwindow.c:82 -msgid "Do you still want to quit?" -msgstr "Sin embargo quiere parar ?" - -#: ../sflphone-gtk/src/menus.c:135 -msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." +#: ../sflphone-gtk/src/config/hooks-config.c:113 +msgid "_SIP Header: " msgstr "" -"SFLphone es un telefono por Internet compatible con los protocolos SIP y IAX2" -#: ../sflphone-gtk/src/menus.c:138 -msgid "About SFLphone" -msgstr "Sobre SFLphone" - -#: ../sflphone-gtk/src/menus.c:161 -msgid "_Help" -msgstr "_Ayuda" - -#: ../sflphone-gtk/src/menus.c:278 -msgid "_New call" -msgstr "_Nueva llamada" - -#: ../sflphone-gtk/src/menus.c:290 ../sflphone-gtk/src/menus.c:760 -msgid "_Pick up" -msgstr "_Descolgar" - -#: ../sflphone-gtk/src/menus.c:300 ../sflphone-gtk/src/menus.c:772 -msgid "_Hang up" -msgstr "_Colgar" - -#: ../sflphone-gtk/src/menus.c:310 ../sflphone-gtk/src/menus.c:784 -msgid "On _Hold" -msgstr "En _Espera" - -#: ../sflphone-gtk/src/menus.c:326 -msgid "_Account Assistant" -msgstr "_Asistente de Cuenta" - -#: ../sflphone-gtk/src/menus.c:356 -msgid "_Call" -msgstr "_Llamar" - -#: ../sflphone-gtk/src/menus.c:529 -msgid "_Clear history" -msgstr "Historia de Llamada" - -#: ../sflphone-gtk/src/menus.c:541 -msgid "_Accounts" -msgstr "_Cuentas" - -#: ../sflphone-gtk/src/menus.c:556 -msgid "_Edit" -msgstr "_Editar" - -#: ../sflphone-gtk/src/menus.c:616 -msgid "_Dialpad" -msgstr "_Teclado numérico" - -#: ../sflphone-gtk/src/menus.c:628 -msgid "_Volume controls" -msgstr "_Controles de volumen" - -#: ../sflphone-gtk/src/menus.c:637 -msgid "_Search history" +#: ../sflphone-gtk/src/config/hooks-config.c:120 +msgid "_Command: " msgstr "" -#: ../sflphone-gtk/src/menus.c:645 -msgid "_View" -msgstr "_Ver" - -#: ../sflphone-gtk/src/menus.c:867 -msgid "_Call back" -msgstr "_Llamar" - -#: ../sflphone-gtk/src/sflnotify.c:34 ../sflphone-gtk/src/sflnotify.c:100 -#, c-format -msgid "%s account: %s" -msgstr "%s cuenta: %s" - -#: ../sflphone-gtk/src/sflnotify.c:37 -#, c-format -msgid "<i>From:</i> %s" -msgstr "<i>De:</i> %s" - -#: ../sflphone-gtk/src/sflnotify.c:52 -msgid "Accept" -msgstr "Aceptar" - -#: ../sflphone-gtk/src/sflnotify.c:53 -msgid "Refuse" -msgstr "Rechazar" - -#: ../sflphone-gtk/src/sflnotify.c:54 ../sflphone-gtk/src/sflnotify.c:117 -#: ../sflphone-gtk/src/sflnotify.c:154 -msgid "Ignore" -msgstr "Ignorar" - -#: ../sflphone-gtk/src/sflnotify.c:136 -#, c-format -msgid "Calling with %s account <i>%s</i>" -msgstr "Llamando con la cuenta %s <i>%s</i>" - -#: ../sflphone-gtk/src/sflnotify.c:140 -msgid "Current account" -msgstr "Cuenta" - -#: ../sflphone-gtk/src/sflnotify.c:169 -msgid "You haven't setup any accounts" -msgstr "No ha configurado cuentas" - -#: ../sflphone-gtk/src/sflnotify.c:185 ../sflphone-gtk/src/sflnotify.c:224 -msgid "Setup Accounts" -msgstr "Cuentas" +#, fuzzy +#~ msgid "SFLphone 0.9.3" +#~ msgstr "SFLphone 0.9.3" -#: ../sflphone-gtk/src/sflnotify.c:208 -msgid "You have no registered accounts" -msgstr "No tiene ninguna cuenta registrada" - -#: ../sflphone-gtk/src/sliders.c:161 -msgid "Speakers volume" -msgstr "Volumen de altavoces" - -#: ../sflphone-gtk/src/sliders.c:163 -msgid "Mic volume" -msgstr "Volumen del micrófono" - -#: ../sflphone-gtk/src/statusicon.c:91 -msgid "_Show main window" -msgstr "Mostrar ventana principal" - -#: ../sflphone-gtk/src/statusicon.c:124 -#, c-format -msgid "SFLphone - %i accounts registered" -msgstr "SFLphone - %i cuenta registrada" - -#: ../sflphone-gtk/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "<small>Llamada faltada</small>" - -#: ../sflphone-gtk/src/timestamp.c:64 -#, c-format -msgid "<small>Duration:</small> %s" -msgstr "<small>Duración:</small> %s" +#~ msgid "Setup Accounts" +#~ msgstr "Cuentas" #~ msgid "_STUN Server" #~ msgstr "_Servidor STUN" diff --git a/po/fr.po b/po/fr.po index 0d95e0cefa7ea67399ed6961240c2d8afd0e9365..5fc0060c1a12b43699c9790dbdce8dd6e1913a36 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1,15 +1,15 @@ # French translation of SFLphone. -# Copyright (C) 2008 The Free Software Foundation, Inc. +# Copyright (C) 2008 2009 The Free Software Foundation, Inc. # This file is distributed under the GNU General Public License Version 3. # # Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>, 2008. # -# POT-Creation-Date: 2007-01-13 01:39+0100\n +# POT-Creation-Date: 2008-01-13 01:39+0100\n msgid "" msgstr "" -"Project-Id-Version: SFLphone 0.9.2\n" +"Project-Id-Version: SFLphone 0.9.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-02-10 15:24-0500\n" +"POT-Creation-Date: 2009-04-02 11:15-0400\n" "PO-Revision-Date: 2008-03-31 14:15\n" "Last-Translator: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>\n" "Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" @@ -31,7 +31,7 @@ msgid "Trying..." msgstr "En cours..." #: ../sflphone-gtk/src/accountlist.c:167 ../sflphone-gtk/src/sflnotify.c:171 -#: ../sflphone-gtk/src/sflnotify.c:210 +#: ../sflphone-gtk/src/sflnotify.c:212 msgid "Error" msgstr "Erreur" @@ -59,66 +59,22 @@ msgstr "Serveur Stun invalide" msgid "Invalid" msgstr "Non valide" -#: ../sflphone-gtk/src/accountwindow.c:109 -msgid "Account settings" -msgstr "Configuration des comptes" - -#: ../sflphone-gtk/src/accountwindow.c:121 -msgid "Account parameters" -msgstr "Paramètres du compte" - -#: ../sflphone-gtk/src/accountwindow.c:143 -msgid "_Enabled" -msgstr "_Activé" - -#: ../sflphone-gtk/src/accountwindow.c:149 ../sflphone-gtk/src/assistant.c:238 -#: ../sflphone-gtk/src/assistant.c:292 -msgid "_Alias" -msgstr "A_lias" - -#: ../sflphone-gtk/src/accountwindow.c:157 -msgid "_Protocol" -msgstr "_Protocole" - -#: ../sflphone-gtk/src/accountwindow.c:175 -msgid "Unknown" -msgstr "Inconnu" - -#: ../sflphone-gtk/src/accountwindow.c:185 ../sflphone-gtk/src/assistant.c:246 -#: ../sflphone-gtk/src/assistant.c:300 -msgid "_Host name" -msgstr "_Serveur" - -#: ../sflphone-gtk/src/accountwindow.c:193 ../sflphone-gtk/src/assistant.c:254 -#: ../sflphone-gtk/src/assistant.c:308 -msgid "_User name" -msgstr "Usa_ger" - -#: ../sflphone-gtk/src/accountwindow.c:204 ../sflphone-gtk/src/assistant.c:264 -#: ../sflphone-gtk/src/assistant.c:318 -msgid "_Password" -msgstr "_Mot de passe" - -#: ../sflphone-gtk/src/accountwindow.c:215 -msgid "_Voicemail box #" -msgstr "_Boite vocale #" - -#: ../sflphone-gtk/src/actions.c:57 ../sflphone-gtk/src/sflnotify.c:103 +#: ../sflphone-gtk/src/actions.c:55 ../sflphone-gtk/src/sflnotify.c:103 #, c-format msgid "%d voice mails" msgstr "%d messages vocaux" -#: ../sflphone-gtk/src/actions.c:59 +#: ../sflphone-gtk/src/actions.c:57 #, c-format msgid "%d voice mail" msgstr "%d message vocal" -#: ../sflphone-gtk/src/actions.c:80 +#: ../sflphone-gtk/src/actions.c:81 #, c-format msgid "%s account- %s" msgstr "compte %s- %s" -#: ../sflphone-gtk/src/actions.c:224 +#: ../sflphone-gtk/src/actions.c:225 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -126,7 +82,12 @@ msgstr "" "Impossible de se connecter au serveur SFLphone.\n" " Assurez-vous que le démon est lancé." -#: ../sflphone-gtk/src/actions.c:798 +#: ../sflphone-gtk/src/actions.c:764 +#, fuzzy, c-format +msgid "%s account- %s %s" +msgstr "compte %s- %s" + +#: ../sflphone-gtk/src/actions.c:861 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -139,43 +100,61 @@ msgstr "" "</b> Les codecs audio SFL doivent être soit dans <i>%s</i> soit dans le " "répertoire <b>.sflphone</b> de votre répertoire racine( <i>%s</i> )" -#: ../sflphone-gtk/src/assistant.c:148 +#: ../sflphone-gtk/src/assistant.c:31 +#, c-format +msgid "" +"This assistant is now finished.\n" +"You can at any time check your registration state or modify your accounts " +"parameters in the Options/Accounts window.\n" +"\n" +"Alias : %s\n" +"Server : %s\n" +"Username : %s\n" +"Password : %s" +msgstr "" +"Cet assistant est maintenant terminé.\n" +"\n" +" Vous pouvez à tout moment vérifier votre état d'enregistrement ou modifier " +"les paramètres de vos comptes dans la fenêtre Options/Comptes.\n" +"\n" +"Alias : %s\n" +"Serveur : %s\n" +"Nom d'usager : %s\n" +"Mot de passe : %s" + +#: ../sflphone-gtk/src/assistant.c:154 msgid "SFLphone account configuration wizard" msgstr "Assistant de configuration de compte" -#: ../sflphone-gtk/src/assistant.c:176 -msgid "SFLphone 0.9.2" -msgstr "SFLphone 0.9.3" - -#: ../sflphone-gtk/src/assistant.c:176 +#: ../sflphone-gtk/src/assistant.c:180 msgid "Welcome to SFLphone!" msgstr "Bienvenue dans SFLphone" -#: ../sflphone-gtk/src/assistant.c:178 +#: ../sflphone-gtk/src/assistant.c:181 msgid "This installation wizard will help you configure an account." msgstr "Cet assistant va vous guider dans la configuration d'un compte. " -#: ../sflphone-gtk/src/assistant.c:193 +#: ../sflphone-gtk/src/assistant.c:195 msgid "VoIP Protocols" msgstr "Protocoles VoIP" -#: ../sflphone-gtk/src/assistant.c:193 +#: ../sflphone-gtk/src/assistant.c:195 msgid "Select an account type:" msgstr "Choisissez un type de compte:" -#: ../sflphone-gtk/src/assistant.c:211 +#: ../sflphone-gtk/src/assistant.c:213 msgid "Account" msgstr "Comptes" -#: ../sflphone-gtk/src/assistant.c:211 +#: ../sflphone-gtk/src/assistant.c:213 msgid "Please select one of the following option:" msgstr "Veuillez remplir les champs suivants:" -#: ../sflphone-gtk/src/assistant.c:213 +#: ../sflphone-gtk/src/assistant.c:215 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "Créer un compte SIP/IAX2 gratuit sur sflphone.org" -#: ../sflphone-gtk/src/assistant.c:215 +#: ../sflphone-gtk/src/assistant.c:217 msgid "Register an existing SIP or IAX2 account" msgstr "Enregistrer un compte SIP ou IAX2 existant" @@ -183,464 +162,584 @@ msgstr "Enregistrer un compte SIP ou IAX2 existant" msgid "SIP account configuration" msgstr "Configuration d'un compte SIP" -#: ../sflphone-gtk/src/assistant.c:230 ../sflphone-gtk/src/assistant.c:284 +#: ../sflphone-gtk/src/assistant.c:230 ../sflphone-gtk/src/assistant.c:305 msgid "Please fill the following information:" msgstr "Veuillez remplir les champs suivants:" -#: ../sflphone-gtk/src/assistant.c:284 +#: ../sflphone-gtk/src/assistant.c:238 ../sflphone-gtk/src/assistant.c:313 +#: ../sflphone-gtk/src/config/accountwindow.c:143 +msgid "_Alias" +msgstr "A_lias" + +#: ../sflphone-gtk/src/assistant.c:246 ../sflphone-gtk/src/assistant.c:321 +#: ../sflphone-gtk/src/config/accountwindow.c:179 +msgid "_Host name" +msgstr "_Serveur" + +#: ../sflphone-gtk/src/assistant.c:254 ../sflphone-gtk/src/assistant.c:329 +#: ../sflphone-gtk/src/config/accountwindow.c:187 +msgid "_User name" +msgstr "Usa_ger" + +#: ../sflphone-gtk/src/assistant.c:264 ../sflphone-gtk/src/assistant.c:339 +#: ../sflphone-gtk/src/config/accountwindow.c:198 +msgid "_Password" +msgstr "_Mot de passe" + +#: ../sflphone-gtk/src/assistant.c:282 +msgid "Optional Email Address " +msgstr "Courriel optionnel" + +#: ../sflphone-gtk/src/assistant.c:282 +msgid "This email address will be use to send your voicemail messages" +msgstr "Vos messages vocaux seront envoyés par courriel à cette adresse " + +#: ../sflphone-gtk/src/assistant.c:290 +#, fuzzy +msgid "_Email" +msgstr "_Email" + +#: ../sflphone-gtk/src/assistant.c:305 msgid "IAX2 account configuration" msgstr "Configuration d'un compte IAX2" -#: ../sflphone-gtk/src/assistant.c:341 ../sflphone-gtk/src/configwindow.c:821 +#: ../sflphone-gtk/src/assistant.c:360 +#: ../sflphone-gtk/src/config/configwindow.c:837 msgid "Network Address Translation" msgstr "Traduction d'adresse réseau (NAT)" -#: ../sflphone-gtk/src/assistant.c:341 +#: ../sflphone-gtk/src/assistant.c:360 msgid "You should probably enable this if you are behind a firewall." msgstr "" "Vous devriez probablement activer cette option si \n" "vous vous trouvez derrière un pare-feu." -#: ../sflphone-gtk/src/assistant.c:350 ../sflphone-gtk/src/configwindow.c:496 +#: ../sflphone-gtk/src/assistant.c:369 +#: ../sflphone-gtk/src/config/configwindow.c:499 msgid "E_nable STUN" msgstr "A_ctiver STUN" -#: ../sflphone-gtk/src/assistant.c:357 +#: ../sflphone-gtk/src/assistant.c:376 msgid "_STUN server" msgstr "S_erveur STUN" -#: ../sflphone-gtk/src/assistant.c:374 +#: ../sflphone-gtk/src/assistant.c:390 msgid "Account Registration" msgstr "Enregistrement du compte" -#: ../sflphone-gtk/src/assistant.c:374 +#: ../sflphone-gtk/src/assistant.c:390 msgid "Congratulations!" msgstr "Félicitations!" -#: ../sflphone-gtk/src/assistant.c:376 +#: ../sflphone-gtk/src/context-menu.c:296 ../sflphone-gtk/src/menus.c:308 +#: ../sflphone-gtk/src/menus.c:791 +msgid "_Pick up" +msgstr "_Décrocher" + +#: ../sflphone-gtk/src/context-menu.c:308 ../sflphone-gtk/src/menus.c:318 +#: ../sflphone-gtk/src/menus.c:803 +msgid "_Hang up" +msgstr "_Raccrocher" + +#: ../sflphone-gtk/src/context-menu.c:320 ../sflphone-gtk/src/menus.c:328 +#: ../sflphone-gtk/src/menus.c:815 +msgid "On _Hold" +msgstr "_Mettre en attente" + +#: ../sflphone-gtk/src/context-menu.c:332 ../sflphone-gtk/src/menus.c:340 +#: ../sflphone-gtk/src/menus.c:827 +#, fuzzy +msgid "_Record" +msgstr "Enregistrement" + +#: ../sflphone-gtk/src/errors.c:28 msgid "" -"This assistant is now finished.\n" +"<b>ALSA notification</b>\n" "\n" -" You can at any time check your registration state or modify your accounts " -"parameters in the Options/Accounts window." +"Error while opening playback device" msgstr "" -"Cet assistant est maintenant terminé.\n" +"<b>Notification ALSA</b>\n" "\n" -" Vous pouvez à tout moment vérifier votre état d'enregistrement ou modifier " -"les paramètres de vos comptes dans la fenêtre Options/Comptes." +"Erreur lors de l'ouverture du périphérique de sortie" + +#: ../sflphone-gtk/src/errors.c:31 +msgid "" +"<b>ALSA notification</b>\n" +"\n" +"Error while opening capture device" +msgstr "" +"<b>Notification ALSA</b>\n" +"\n" +"Erreur lors de l'ouverture du périphérique d'entrée" + +#: ../sflphone-gtk/src/errors.c:34 +msgid "" +"<b>Pulseaudio notification</b>\n" +"\n" +"Pulseaudio is not running" +msgstr "" +"<b>Notification Pulseaudio</b>\n" +"\n" +"Pulseaudio n'est pas lancé" + +#: ../sflphone-gtk/src/mainwindow.c:70 +msgid "There is one call in progress." +msgstr "Vous avez un appel en cours." + +#: ../sflphone-gtk/src/mainwindow.c:74 +msgid "There are calls in progress." +msgstr "Vous avez des appels en cours." + +#: ../sflphone-gtk/src/mainwindow.c:83 +msgid "Do you still want to quit?" +msgstr "Voulez-vous quitter?" + +#: ../sflphone-gtk/src/menus.c:131 +msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." +msgstr "" +"SFLphone est un client VoIP compatible avec les protocoles SIP et IAX2." + +#: ../sflphone-gtk/src/menus.c:134 +msgid "About SFLphone" +msgstr "A propos de SFLphone" + +#: ../sflphone-gtk/src/menus.c:157 +msgid "_Help" +msgstr "A_ide" + +#: ../sflphone-gtk/src/menus.c:296 ../sflphone-gtk/src/menus.c:949 +msgid "_New call" +msgstr "_Nouvel appel" + +#: ../sflphone-gtk/src/menus.c:354 +msgid "_Account Assistant" +msgstr "_Assistant SFLphone" + +#: ../sflphone-gtk/src/menus.c:384 +msgid "_Call" +msgstr "_Actions" + +#: ../sflphone-gtk/src/menus.c:557 +msgid "_Clear history" +msgstr "Effacer l'historique" + +#: ../sflphone-gtk/src/menus.c:569 +msgid "_Accounts" +msgstr "Co_mptes" + +#: ../sflphone-gtk/src/menus.c:584 +msgid "_Edit" +msgstr "_Options" + +#: ../sflphone-gtk/src/menus.c:644 +msgid "_Dialpad" +msgstr "_Clavier" + +#: ../sflphone-gtk/src/menus.c:656 +msgid "_Volume controls" +msgstr "_Contrôle du volume" + +#: ../sflphone-gtk/src/menus.c:665 +#, fuzzy +msgid "_Search contact" +msgstr "Rechercher un contact" + +#: ../sflphone-gtk/src/menus.c:673 +msgid "_View" +msgstr "A_ffichage" + +#: ../sflphone-gtk/src/menus.c:885 +msgid "_Call back" +msgstr "_Rappeler" + +#: ../sflphone-gtk/src/sflnotify.c:34 ../sflphone-gtk/src/sflnotify.c:100 +#, c-format +msgid "%s account: %s" +msgstr "Compte %s: %s" + +#: ../sflphone-gtk/src/sflnotify.c:37 +#, c-format +msgid "<i>From:</i> %s" +msgstr "<i>De:</i> %s" + +#: ../sflphone-gtk/src/sflnotify.c:52 +msgid "Accept" +msgstr "Accepter" + +#: ../sflphone-gtk/src/sflnotify.c:53 +msgid "Refuse" +msgstr "Refuser" + +#: ../sflphone-gtk/src/sflnotify.c:54 ../sflphone-gtk/src/sflnotify.c:117 +#: ../sflphone-gtk/src/sflnotify.c:154 +msgid "Ignore" +msgstr "Ignorer" + +#: ../sflphone-gtk/src/sflnotify.c:136 +#, c-format +msgid "Calling with %s account <i>%s</i>" +msgstr "Appel avec le compte %s <i>%s</i>" + +#: ../sflphone-gtk/src/sflnotify.c:140 +msgid "Current account" +msgstr "Compte courant" + +#: ../sflphone-gtk/src/sflnotify.c:169 +msgid "You haven't setup any accounts" +msgstr "Vous n'avez aucun compte configuré" + +#: ../sflphone-gtk/src/sflnotify.c:209 +msgid "You have no registered accounts" +msgstr "Vous n'avez aucun compte enregistré" + +#: ../sflphone-gtk/src/sliders.c:161 +msgid "Speakers volume" +msgstr "Volume des hauts-parleurs" + +#: ../sflphone-gtk/src/sliders.c:163 +msgid "Mic volume" +msgstr "Volume du micro" + +#: ../sflphone-gtk/src/statusicon.c:91 +msgid "_Show main window" +msgstr "_Afficher la fenêtre principale" -#: ../sflphone-gtk/src/audioconf.c:154 +#: ../sflphone-gtk/src/statusicon.c:124 +#, c-format +msgid "SFLphone - %i accounts registered" +msgstr "SFLphone - %i compte enregistré" + +#: ../sflphone-gtk/src/timestamp.c:46 +msgid "<small>Missed call</small>" +msgstr "<small>Appel manqué</small>" + +#: ../sflphone-gtk/src/timestamp.c:64 +#, c-format +msgid "<small>Duration:</small> %s" +msgstr "<small>Durée:</small> %s" + +#: ../sflphone-gtk/src/toolbar.c:49 +#, c-format +msgid "\"Voicemail\" <%s>" +msgstr "\"Boite vocale\" <%s>" + +#: ../sflphone-gtk/src/toolbar.c:175 ../sflphone-gtk/src/toolbar.c:177 +msgid "Place a call" +msgstr "Appeler" + +#: ../sflphone-gtk/src/toolbar.c:184 ../sflphone-gtk/src/toolbar.c:186 +msgid "Pick up" +msgstr "Décrocher" + +#: ../sflphone-gtk/src/toolbar.c:194 ../sflphone-gtk/src/toolbar.c:196 +msgid "Hang up" +msgstr "Raccrocher" + +#: ../sflphone-gtk/src/toolbar.c:204 ../sflphone-gtk/src/toolbar.c:206 +msgid "Off Hold" +msgstr "Reprendre" + +#: ../sflphone-gtk/src/toolbar.c:215 ../sflphone-gtk/src/toolbar.c:217 +msgid "On Hold" +msgstr "Mettre en attente" + +#: ../sflphone-gtk/src/toolbar.c:228 ../sflphone-gtk/src/toolbar.c:230 +msgid "Transfer" +msgstr "Transférer" + +#: ../sflphone-gtk/src/toolbar.c:240 ../sflphone-gtk/src/toolbar.c:242 +msgid "History" +msgstr "Historique" + +#: ../sflphone-gtk/src/toolbar.c:251 ../sflphone-gtk/src/toolbar.c:253 +msgid "Address book" +msgstr "Carnet d'adresse" + +#: ../sflphone-gtk/src/toolbar.c:258 ../sflphone-gtk/src/toolbar.c:262 +msgid "Voicemail" +msgstr "Boite vocale" + +#: ../sflphone-gtk/src/toolbar.c:270 +msgid "Record a call" +msgstr "Enregistrer un appel" + +#: ../sflphone-gtk/src/contacts/history.c:75 +#: ../sflphone-gtk/src/contacts/searchbar.c:39 +#: ../sflphone-gtk/src/contacts/searchbar.c:65 +msgid "Search" +msgstr "Recherche" + +#: ../sflphone-gtk/src/config/accountwindow.c:103 +msgid "Account settings" +msgstr "Configuration des comptes" + +#: ../sflphone-gtk/src/config/accountwindow.c:115 +msgid "Account parameters" +msgstr "Paramètres du compte" + +#: ../sflphone-gtk/src/config/accountwindow.c:137 +msgid "_Enabled" +msgstr "_Activé" + +#: ../sflphone-gtk/src/config/accountwindow.c:151 +msgid "_Protocol" +msgstr "_Protocole" + +#: ../sflphone-gtk/src/config/accountwindow.c:169 +msgid "Unknown" +msgstr "Inconnu" + +#: ../sflphone-gtk/src/config/accountwindow.c:209 +msgid "_Voicemail box #" +msgstr "_Boite vocale #" + +#: ../sflphone-gtk/src/config/addressbook-config.c:105 +msgid "Search Parameters" +msgstr "Paramètres de recherche" + +#: ../sflphone-gtk/src/config/addressbook-config.c:116 +msgid "Maximum result number for a request: " +msgstr "Nombre maximum d'appels" + +#: ../sflphone-gtk/src/config/addressbook-config.c:127 +msgid "_Display contact photo if available" +msgstr "Afficher la photo si disponible" + +#: ../sflphone-gtk/src/config/addressbook-config.c:132 +msgid "Search for and display: " +msgstr "Chercher et afficher: " + +#: ../sflphone-gtk/src/config/addressbook-config.c:135 +msgid "_Business phone" +msgstr "Tél du bureau" + +#: ../sflphone-gtk/src/config/addressbook-config.c:140 +msgid "_Home phone" +msgstr "Tél du domicile" + +#: ../sflphone-gtk/src/config/addressbook-config.c:145 +msgid "_Mobile phone" +msgstr "Tél portable" + +#: ../sflphone-gtk/src/config/audioconf.c:154 #, c-format msgid "audio device index for output = %d\n" msgstr "index du device audio de sortie = %d\n" -#: ../sflphone-gtk/src/audioconf.c:562 +#: ../sflphone-gtk/src/config/audioconf.c:562 msgid "Name" msgstr "Nom" -#: ../sflphone-gtk/src/audioconf.c:567 +#: ../sflphone-gtk/src/config/audioconf.c:567 msgid "Frequency" msgstr "Fréquence" -#: ../sflphone-gtk/src/audioconf.c:572 +#: ../sflphone-gtk/src/config/audioconf.c:572 msgid "Bitrate" msgstr "Bitrate" -#: ../sflphone-gtk/src/audioconf.c:577 +#: ../sflphone-gtk/src/config/audioconf.c:577 msgid "Bandwidth" msgstr "Bande passante" -#: ../sflphone-gtk/src/audioconf.c:637 +#: ../sflphone-gtk/src/config/audioconf.c:637 msgid "Pulseaudio" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:640 +#: ../sflphone-gtk/src/config/audioconf.c:640 msgid "ALSA" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:666 +#: ../sflphone-gtk/src/config/audioconf.c:666 msgid "ALSA plugin" msgstr "Greffon ALSA" -#: ../sflphone-gtk/src/audioconf.c:688 +#: ../sflphone-gtk/src/config/audioconf.c:688 msgid "Output" msgstr "Sortie" -#: ../sflphone-gtk/src/audioconf.c:710 +#: ../sflphone-gtk/src/config/audioconf.c:710 msgid "Input" msgstr "Entrée" -#: ../sflphone-gtk/src/audioconf.c:743 +#: ../sflphone-gtk/src/config/audioconf.c:743 msgid "_Enable ringtones" msgstr "_Activer les sonneries" -#: ../sflphone-gtk/src/audioconf.c:748 +#: ../sflphone-gtk/src/config/audioconf.c:748 msgid "Choose a ringtone" msgstr "Sélectionner une sonnerie" -#: ../sflphone-gtk/src/audioconf.c:753 +#: ../sflphone-gtk/src/config/audioconf.c:753 msgid "Audio Files" msgstr "Fichier Audio" -#: ../sflphone-gtk/src/audioconf.c:770 +#: ../sflphone-gtk/src/config/audioconf.c:770 msgid "_Activate silence detection" msgstr "Activer la détection de silence" -#: ../sflphone-gtk/src/audioconf.c:798 +#: ../sflphone-gtk/src/config/audioconf.c:798 msgid "Sound Manager" msgstr "Interface Audio" -#: ../sflphone-gtk/src/audioconf.c:805 +#: ../sflphone-gtk/src/config/audioconf.c:805 msgid "ALSA configuration" msgstr "Configuration ALSA" -#: ../sflphone-gtk/src/audioconf.c:815 +#: ../sflphone-gtk/src/config/audioconf.c:815 msgid "Codecs" msgstr "" -#: ../sflphone-gtk/src/audioconf.c:823 +#: ../sflphone-gtk/src/config/audioconf.c:823 msgid "Noise reduction" msgstr "Réduction du bruit" -#: ../sflphone-gtk/src/audioconf.c:830 +#: ../sflphone-gtk/src/config/audioconf.c:830 msgid "Ringtones" msgstr "_Activer les sonneries" -#: ../sflphone-gtk/src/calltree.c:209 -#, c-format -msgid "\"Voicemail\" <%s>" -msgstr "\"Boite vocale\" <%s>" - -#: ../sflphone-gtk/src/calltree.c:431 ../sflphone-gtk/src/calltree.c:433 -msgid "Place a call" -msgstr "Appeler" - -#: ../sflphone-gtk/src/calltree.c:440 ../sflphone-gtk/src/calltree.c:442 -msgid "Pick up" -msgstr "Décrocher" - -#: ../sflphone-gtk/src/calltree.c:450 ../sflphone-gtk/src/calltree.c:452 -msgid "Hang up" -msgstr "Raccrocher" - -#: ../sflphone-gtk/src/calltree.c:460 ../sflphone-gtk/src/calltree.c:462 -msgid "Off Hold" -msgstr "Reprendre" - -#: ../sflphone-gtk/src/calltree.c:471 ../sflphone-gtk/src/calltree.c:473 -msgid "On Hold" -msgstr "Mettre en attente" - -#: ../sflphone-gtk/src/calltree.c:484 ../sflphone-gtk/src/calltree.c:486 -msgid "Transfer" -msgstr "Transférer" - -#: ../sflphone-gtk/src/calltree.c:496 ../sflphone-gtk/src/calltree.c:498 -msgid "History" -msgstr "Historique" - -#: ../sflphone-gtk/src/calltree.c:506 ../sflphone-gtk/src/calltree.c:510 -msgid "Voicemail" -msgstr "Boite vocale" - -#: ../sflphone-gtk/src/calltree.c:521 -msgid "Record a call" -msgstr "Enregistrer un appel" - -#: ../sflphone-gtk/src/configwindow.c:382 +#: ../sflphone-gtk/src/config/configwindow.c:385 msgid "Protocol" msgstr "Protocole" -#: ../sflphone-gtk/src/configwindow.c:389 +#: ../sflphone-gtk/src/config/configwindow.c:392 msgid "Status" msgstr "Statut" -#: ../sflphone-gtk/src/configwindow.c:492 +#: ../sflphone-gtk/src/config/configwindow.c:495 msgid "Stun parameters will apply to each SIP account created." msgstr "Les paramètres STUN sont appliqués à tous les comptes SIP créés" -#: ../sflphone-gtk/src/configwindow.c:500 +#: ../sflphone-gtk/src/config/configwindow.c:503 msgid "Enable it if you are behind a firewall" msgstr "À activer si vous êtes derrière un pare-feu, puis redémarrez SFLphone" -#: ../sflphone-gtk/src/configwindow.c:508 +#: ../sflphone-gtk/src/config/configwindow.c:511 msgid "Format: name.server:port" msgstr "Format: nom.serveur:port" -#: ../sflphone-gtk/src/configwindow.c:558 +#: ../sflphone-gtk/src/config/configwindow.c:561 msgid "Desktop Notification" msgstr "Notifications du bureau" -#: ../sflphone-gtk/src/configwindow.c:566 +#: ../sflphone-gtk/src/config/configwindow.c:569 msgid "_Enable" msgstr "_Activer" -#: ../sflphone-gtk/src/configwindow.c:571 +#: ../sflphone-gtk/src/config/configwindow.c:574 msgid "_Notify voice mails" msgstr "_Notifier les messages vocaux" -#: ../sflphone-gtk/src/configwindow.c:577 +#: ../sflphone-gtk/src/config/configwindow.c:580 msgid "System Tray Icon" msgstr "Icône dans la barre des tâches" -#: ../sflphone-gtk/src/configwindow.c:585 +#: ../sflphone-gtk/src/config/configwindow.c:588 msgid "_Popup main window on incoming call" msgstr "_Faire apparaître la fenêtre principale lors d'appel entrant" -#: ../sflphone-gtk/src/configwindow.c:590 +#: ../sflphone-gtk/src/config/configwindow.c:593 msgid "Ne_ver popup main window" msgstr "Ne _jamais afficher la fenêtre principale" -#: ../sflphone-gtk/src/configwindow.c:594 +#: ../sflphone-gtk/src/config/configwindow.c:597 msgid "_Start hidden" msgstr "_Démarrer caché" -#: ../sflphone-gtk/src/configwindow.c:600 +#: ../sflphone-gtk/src/config/configwindow.c:603 msgid "Calls History" msgstr "Historique des appels" -#: ../sflphone-gtk/src/configwindow.c:608 +#: ../sflphone-gtk/src/config/configwindow.c:611 msgid "_Maximum number of calls" msgstr "N_ombre maximum d'appels" -#: ../sflphone-gtk/src/configwindow.c:624 +#: ../sflphone-gtk/src/config/configwindow.c:627 msgid "PulseAudio sound server" msgstr "Serveur de son PulseAudio" -#: ../sflphone-gtk/src/configwindow.c:632 +#: ../sflphone-gtk/src/config/configwindow.c:635 msgid "_Control running applications volume" msgstr "_Autoriser à modifier le volume des autres applications" -#: ../sflphone-gtk/src/configwindow.c:645 +#: ../sflphone-gtk/src/config/configwindow.c:648 msgid "SIP Port" msgstr "Port SIP" -#: ../sflphone-gtk/src/configwindow.c:658 +#: ../sflphone-gtk/src/config/configwindow.c:661 msgid "Port:" msgstr "" -#: ../sflphone-gtk/src/configwindow.c:703 +#: ../sflphone-gtk/src/config/configwindow.c:706 msgid "General" msgstr "Général" -#: ../sflphone-gtk/src/configwindow.c:714 +#: ../sflphone-gtk/src/config/configwindow.c:717 msgid "_Destination folder" msgstr "_Dossier de destination" -#: ../sflphone-gtk/src/configwindow.c:719 +#: ../sflphone-gtk/src/config/configwindow.c:723 msgid "Select a folder" msgstr "Choisissez un dossier" -#: ../sflphone-gtk/src/configwindow.c:744 +#: ../sflphone-gtk/src/config/configwindow.c:748 msgid "Preferences" msgstr "Préférences" -#: ../sflphone-gtk/src/configwindow.c:764 +#: ../sflphone-gtk/src/config/configwindow.c:768 msgid "General Settings" msgstr "Préférences" -#: ../sflphone-gtk/src/configwindow.c:769 +#: ../sflphone-gtk/src/config/configwindow.c:773 msgid "Audio Settings" msgstr "Paramètres Audio" -#: ../sflphone-gtk/src/configwindow.c:774 +#: ../sflphone-gtk/src/config/configwindow.c:778 msgid "Record" msgstr "Enregistrement" -#: ../sflphone-gtk/src/configwindow.c:798 +#: ../sflphone-gtk/src/config/configwindow.c:783 +msgid "Address Book" +msgstr "Carnet d'adresse" + +#: ../sflphone-gtk/src/config/configwindow.c:788 +msgid "Hooks" +msgstr "Ancrage" + +#: ../sflphone-gtk/src/config/configwindow.c:814 msgid "Accounts" msgstr "Comptes" -#: ../sflphone-gtk/src/configwindow.c:810 +#: ../sflphone-gtk/src/config/configwindow.c:826 msgid "Accounts previously setup" msgstr "Liste des comptes existants" -#: ../sflphone-gtk/src/errors.c:28 -msgid "" -"<b>ALSA notification</b>\n" -"\n" -"Error while opening playback device" -msgstr "" -"<b>Notification ALSA</b>\n" -"\n" -"Erreur lors de l'ouverture du périphérique de sortie" - -#: ../sflphone-gtk/src/errors.c:31 -msgid "" -"<b>ALSA notification</b>\n" -"\n" -"Error while opening capture device" -msgstr "" -"<b>Notification ALSA</b>\n" -"\n" -"Erreur lors de l'ouverture du périphérique d'entrée" +#: ../sflphone-gtk/src/config/hooks-config.c:92 +msgid "URL argument" +msgstr "Argument URL" -#: ../sflphone-gtk/src/errors.c:34 -msgid "" -"<b>Pulseaudio notification</b>\n" -"\n" -"Pulseaudio is not running" -msgstr "" -"<b>Notification Pulseaudio</b>\n" -"\n" -"Pulseaudio n'est pas lancé" +#: ../sflphone-gtk/src/config/hooks-config.c:102 +msgid "_SIP protocol" +msgstr "_Protocole SIP" -#: ../sflphone-gtk/src/historyfilter.c:49 -#: ../sflphone-gtk/src/historyfilter.c:68 -#: ../sflphone-gtk/src/historyfilter.c:83 -msgid "Search" -msgstr "Recherche" +#: ../sflphone-gtk/src/config/hooks-config.c:107 +msgid "_IAX2 protocol" +msgstr "_Protocole IAX2" -#: ../sflphone-gtk/src/mainwindow.c:69 -msgid "There is one call in progress." -msgstr "Vous avez un appel en cours." +#: ../sflphone-gtk/src/config/hooks-config.c:113 +msgid "_SIP Header: " +msgstr "En-tête SIP: " -#: ../sflphone-gtk/src/mainwindow.c:73 -msgid "There are calls in progress." -msgstr "Vous avez des appels en cours." +#: ../sflphone-gtk/src/config/hooks-config.c:120 +msgid "_Command: " +msgstr "Commande" -#: ../sflphone-gtk/src/mainwindow.c:82 -msgid "Do you still want to quit?" -msgstr "Voulez-vous quitter?" +#, fuzzy +#~ msgid "SFLphone 0.9.4" +#~ msgstr "SFLphone 0.9.4" -#: ../sflphone-gtk/src/menus.c:135 -msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." -msgstr "" -"SFLphone est un client VoIP compatible avec les protocoles SIP et IAX2." - -#: ../sflphone-gtk/src/menus.c:138 -msgid "About SFLphone" -msgstr "A propos de SFLphone" - -#: ../sflphone-gtk/src/menus.c:161 -msgid "_Help" -msgstr "A_ide" - -#: ../sflphone-gtk/src/menus.c:278 -msgid "_New call" -msgstr "_Nouvel appel" - -#: ../sflphone-gtk/src/menus.c:290 ../sflphone-gtk/src/menus.c:760 -msgid "_Pick up" -msgstr "_Décrocher" - -#: ../sflphone-gtk/src/menus.c:300 ../sflphone-gtk/src/menus.c:772 -msgid "_Hang up" -msgstr "_Raccrocher" - -#: ../sflphone-gtk/src/menus.c:310 ../sflphone-gtk/src/menus.c:784 -msgid "On _Hold" -msgstr "_Mettre en attente" - -#: ../sflphone-gtk/src/menus.c:326 -msgid "_Account Assistant" -msgstr "_Assistant SFLphone" - -#: ../sflphone-gtk/src/menus.c:356 -msgid "_Call" -msgstr "_Actions" - -#: ../sflphone-gtk/src/menus.c:529 -msgid "_Clear history" -msgstr "Effacer l'historique" - -#: ../sflphone-gtk/src/menus.c:541 -msgid "_Accounts" -msgstr "Co_mptes" - -#: ../sflphone-gtk/src/menus.c:556 -msgid "_Edit" -msgstr "_Options" - -#: ../sflphone-gtk/src/menus.c:616 -msgid "_Dialpad" -msgstr "_Clavier" - -#: ../sflphone-gtk/src/menus.c:628 -msgid "_Volume controls" -msgstr "_Contrôle du volume" - -#: ../sflphone-gtk/src/menus.c:637 -msgid "_Search history" -msgstr "Recherche dans l'historique" - -#: ../sflphone-gtk/src/menus.c:645 -msgid "_View" -msgstr "A_ffichage" - -#: ../sflphone-gtk/src/menus.c:867 -msgid "_Call back" -msgstr "_Rappeler" - -#: ../sflphone-gtk/src/sflnotify.c:34 ../sflphone-gtk/src/sflnotify.c:100 -#, c-format -msgid "%s account: %s" -msgstr "Compte %s: %s" - -#: ../sflphone-gtk/src/sflnotify.c:37 -#, c-format -msgid "<i>From:</i> %s" -msgstr "<i>De:</i> %s" - -#: ../sflphone-gtk/src/sflnotify.c:52 -msgid "Accept" -msgstr "Accepter" - -#: ../sflphone-gtk/src/sflnotify.c:53 -msgid "Refuse" -msgstr "Refuser" - -#: ../sflphone-gtk/src/sflnotify.c:54 ../sflphone-gtk/src/sflnotify.c:117 -#: ../sflphone-gtk/src/sflnotify.c:154 -msgid "Ignore" -msgstr "Ignorer" - -#: ../sflphone-gtk/src/sflnotify.c:136 -#, c-format -msgid "Calling with %s account <i>%s</i>" -msgstr "Appel avec le compte %s <i>%s</i>" - -#: ../sflphone-gtk/src/sflnotify.c:140 -msgid "Current account" -msgstr "Compte courant" - -#: ../sflphone-gtk/src/sflnotify.c:169 -msgid "You haven't setup any accounts" -msgstr "Vous n'avez aucun compte configuré" - -#: ../sflphone-gtk/src/sflnotify.c:185 ../sflphone-gtk/src/sflnotify.c:224 -msgid "Setup Accounts" -msgstr "Configurer les comptes" - -#: ../sflphone-gtk/src/sflnotify.c:208 -msgid "You have no registered accounts" -msgstr "Vous n'avez aucun compte enregistré" - -#: ../sflphone-gtk/src/sliders.c:161 -msgid "Speakers volume" -msgstr "Volume des hauts-parleurs" - -#: ../sflphone-gtk/src/sliders.c:163 -msgid "Mic volume" -msgstr "Volume du micro" - -#: ../sflphone-gtk/src/statusicon.c:91 -msgid "_Show main window" -msgstr "_Afficher la fenêtre principale" - -#: ../sflphone-gtk/src/statusicon.c:124 -#, c-format -msgid "SFLphone - %i accounts registered" -msgstr "SFLphone - %i compte enregistré" - -#: ../sflphone-gtk/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "<small>Appel manqué</small>" - -#: ../sflphone-gtk/src/timestamp.c:64 -#, c-format -msgid "<small>Duration:</small> %s" -msgstr "<small>Durée:</small> %s" +#~ msgid "Setup Accounts" +#~ msgstr "Configurer les comptes" #~ msgid "_STUN Server" #~ msgstr "S_erveur STUN" diff --git a/po/ru.po b/po/ru.po index 90fe6fb83ebbacdbe9d74e649d4901f0dd603627..43f24e97e383cffcbcc8ca5302e8ef0d908da92b 100644 --- a/po/ru.po +++ b/po/ru.po @@ -1,17 +1,17 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# Russian Translation. +# Copyright (C) 2009 Savoir-Faire Linux Inc. +# This file is distributed under the same license as the sflphone package. +# Hussein Abdallah <hussein.abdallah@savoirfairelinux.com>. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: SFLphone 0.9.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-02-10 15:24-0500\n" +"POT-Creation-Date: 2009-04-02 11:15-0400\n" "PO-Revision-Date: 2009-01-08 15:19 GMT-5\n" "Last-Translator: HUSSEIN ABDALLAH <hussein.abdallah@savoirfairelinux.com>\n" -"Language-Team: RUSSIAN <LL@li.org>\n" +"Language-Team: Savoir-Faire Linux Inc <sflphoneteam@savoirfairelinux.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -29,7 +29,7 @@ msgid "Trying..." msgstr "Пробует подключиться..." #: ../sflphone-gtk/src/accountlist.c:167 ../sflphone-gtk/src/sflnotify.c:171 -#: ../sflphone-gtk/src/sflnotify.c:210 +#: ../sflphone-gtk/src/sflnotify.c:212 msgid "Error" msgstr "Ошибка" @@ -46,7 +46,6 @@ msgid "Host unreachable" msgstr "Хост недоступен" #: ../sflphone-gtk/src/accountlist.c:179 -#, fuzzy msgid "Stun configuration error" msgstr "Ошибка настройки Stun" @@ -58,66 +57,22 @@ msgstr "Недействительный Stun-сервер" msgid "Invalid" msgstr "Недействительный" -#: ../sflphone-gtk/src/accountwindow.c:109 -msgid "Account settings" -msgstr "Настройки аккаунта" - -#: ../sflphone-gtk/src/accountwindow.c:121 -msgid "Account parameters" -msgstr "Параметры аккаунта" - -#: ../sflphone-gtk/src/accountwindow.c:143 -msgid "_Enabled" -msgstr "_Включен" - -#: ../sflphone-gtk/src/accountwindow.c:149 ../sflphone-gtk/src/assistant.c:238 -#: ../sflphone-gtk/src/assistant.c:292 -msgid "_Alias" -msgstr "_Псевдоним" - -#: ../sflphone-gtk/src/accountwindow.c:157 -msgid "_Protocol" -msgstr "Пр_отокол" - -#: ../sflphone-gtk/src/accountwindow.c:175 -msgid "Unknown" -msgstr "Неизвестный" - -#: ../sflphone-gtk/src/accountwindow.c:185 ../sflphone-gtk/src/assistant.c:246 -#: ../sflphone-gtk/src/assistant.c:300 -msgid "_Host name" -msgstr "Имя или IP-адрес _сервера" - -#: ../sflphone-gtk/src/accountwindow.c:193 ../sflphone-gtk/src/assistant.c:254 -#: ../sflphone-gtk/src/assistant.c:308 -msgid "_User name" -msgstr "Имя или _номер пользователя" - -#: ../sflphone-gtk/src/accountwindow.c:204 ../sflphone-gtk/src/assistant.c:264 -#: ../sflphone-gtk/src/assistant.c:318 -msgid "_Password" -msgstr "Па_роль" - -#: ../sflphone-gtk/src/accountwindow.c:215 -msgid "_Voicemail box #" -msgstr "Номер _автоответчика #" - -#: ../sflphone-gtk/src/actions.c:57 ../sflphone-gtk/src/sflnotify.c:103 +#: ../sflphone-gtk/src/actions.c:55 ../sflphone-gtk/src/sflnotify.c:103 #, c-format msgid "%d voice mails" msgstr "%d речевые сообщения" -#: ../sflphone-gtk/src/actions.c:59 +#: ../sflphone-gtk/src/actions.c:57 #, c-format msgid "%d voice mail" msgstr "%d речевое сообщение" -#: ../sflphone-gtk/src/actions.c:80 +#: ../sflphone-gtk/src/actions.c:81 #, c-format msgid "%s account- %s" msgstr "%s аккаунт- %s" -#: ../sflphone-gtk/src/actions.c:224 +#: ../sflphone-gtk/src/actions.c:225 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -125,7 +80,12 @@ msgstr "" "Невозможно подключиться к SFLphone-серверу.\n" "Проверьте если демон работает." -#: ../sflphone-gtk/src/actions.c:798 +#: ../sflphone-gtk/src/actions.c:764 +#, fuzzy, c-format +msgid "%s account- %s %s" +msgstr "%s аккаунт- %s" + +#: ../sflphone-gtk/src/actions.c:861 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -138,46 +98,56 @@ msgstr "" "</b> Звуковые кодеки SFL должны находиться в <i>%s</i> или в <b>.sflphone</" "b> каталоге в вашем домашнем каталоге( <i>%s</i> )" -#: ../sflphone-gtk/src/assistant.c:148 +#: ../sflphone-gtk/src/assistant.c:31 +#, fuzzy, c-format +msgid "" +"This assistant is now finished.\n" +"You can at any time check your registration state or modify your accounts " +"parameters in the Options/Accounts window.\n" +"\n" +"Alias : %s\n" +"Server : %s\n" +"Username : %s\n" +"Password : %s" +msgstr "" +"Мастер закончил настройку.\n" +"\n" +" Вы можете в любое время проверить статус регистрации или изменить " +"параметры ваших аккаунтов в меню Правка / Аккаунты." + +#: ../sflphone-gtk/src/assistant.c:154 msgid "SFLphone account configuration wizard" msgstr "Мастер настройки SFLphone" -#: ../sflphone-gtk/src/assistant.c:176 -#, fuzzy -msgid "SFLphone 0.9.2" -msgstr "SFLphone 0.9.2" - -#: ../sflphone-gtk/src/assistant.c:176 +#: ../sflphone-gtk/src/assistant.c:180 msgid "Welcome to SFLphone!" msgstr "Добро пожаловать в SFLphone!" -#: ../sflphone-gtk/src/assistant.c:178 +#: ../sflphone-gtk/src/assistant.c:181 msgid "This installation wizard will help you configure an account." msgstr "Этот мастер установки поможет вам настроить ваш аккаунт." -#: ../sflphone-gtk/src/assistant.c:193 +#: ../sflphone-gtk/src/assistant.c:195 msgid "VoIP Protocols" msgstr "VoIP-протоколы" -#: ../sflphone-gtk/src/assistant.c:193 +#: ../sflphone-gtk/src/assistant.c:195 msgid "Select an account type:" msgstr "Выберите тип аккаунта:" -#: ../sflphone-gtk/src/assistant.c:211 -#, fuzzy +#: ../sflphone-gtk/src/assistant.c:213 msgid "Account" msgstr "Аккаунты" -#: ../sflphone-gtk/src/assistant.c:211 -#, fuzzy +#: ../sflphone-gtk/src/assistant.c:213 msgid "Please select one of the following option:" msgstr "Введите пожалуйста следующие данные" -#: ../sflphone-gtk/src/assistant.c:213 +#: ../sflphone-gtk/src/assistant.c:215 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "Создать бесплатный SIP/IAX2-аккаунт на sflphone.org" -#: ../sflphone-gtk/src/assistant.c:215 +#: ../sflphone-gtk/src/assistant.c:217 msgid "Register an existing SIP or IAX2 account" msgstr "Зарегистрировать существующий SIP или IAX2 аккаунт" @@ -185,468 +155,580 @@ msgstr "Зарегистрировать существующий SIP или IAX msgid "SIP account configuration" msgstr "Настройка SIP-аккаунта" -#: ../sflphone-gtk/src/assistant.c:230 ../sflphone-gtk/src/assistant.c:284 +#: ../sflphone-gtk/src/assistant.c:230 ../sflphone-gtk/src/assistant.c:305 msgid "Please fill the following information:" msgstr "Введите пожалуйста следующие данные" -#: ../sflphone-gtk/src/assistant.c:284 +#: ../sflphone-gtk/src/assistant.c:238 ../sflphone-gtk/src/assistant.c:313 +#: ../sflphone-gtk/src/config/accountwindow.c:143 +msgid "_Alias" +msgstr "_Псевдоним" + +#: ../sflphone-gtk/src/assistant.c:246 ../sflphone-gtk/src/assistant.c:321 +#: ../sflphone-gtk/src/config/accountwindow.c:179 +msgid "_Host name" +msgstr "Имя или IP-адрес _сервера" + +#: ../sflphone-gtk/src/assistant.c:254 ../sflphone-gtk/src/assistant.c:329 +#: ../sflphone-gtk/src/config/accountwindow.c:187 +msgid "_User name" +msgstr "Имя или _номер пользователя" + +#: ../sflphone-gtk/src/assistant.c:264 ../sflphone-gtk/src/assistant.c:339 +#: ../sflphone-gtk/src/config/accountwindow.c:198 +msgid "_Password" +msgstr "Па_роль" + +#: ../sflphone-gtk/src/assistant.c:282 +msgid "Optional Email Address " +msgstr "Электронный адрес (необязательный) " + +#: ../sflphone-gtk/src/assistant.c:282 +msgid "This email address will be use to send your voicemail messages" +msgstr "Этот электронный адрес будет использоваться для речевых сообщений" + +#: ../sflphone-gtk/src/assistant.c:290 +msgid "_Email" +msgstr "_Включить" + +#: ../sflphone-gtk/src/assistant.c:305 msgid "IAX2 account configuration" msgstr "Настройка IAX2-аккаунта" -#: ../sflphone-gtk/src/assistant.c:341 ../sflphone-gtk/src/configwindow.c:821 +#: ../sflphone-gtk/src/assistant.c:360 +#: ../sflphone-gtk/src/config/configwindow.c:837 msgid "Network Address Translation" msgstr "Network Address Translation" -#: ../sflphone-gtk/src/assistant.c:341 +#: ../sflphone-gtk/src/assistant.c:360 msgid "You should probably enable this if you are behind a firewall." msgstr "Вы наверное должны это включить если вы находитесь за сетевым экраном." -#: ../sflphone-gtk/src/assistant.c:350 ../sflphone-gtk/src/configwindow.c:496 +#: ../sflphone-gtk/src/assistant.c:369 +#: ../sflphone-gtk/src/config/configwindow.c:499 msgid "E_nable STUN" msgstr "Включить STUN" -#: ../sflphone-gtk/src/assistant.c:357 +#: ../sflphone-gtk/src/assistant.c:376 msgid "_STUN server" msgstr "_STUN-сервер" -#: ../sflphone-gtk/src/assistant.c:374 +#: ../sflphone-gtk/src/assistant.c:390 msgid "Account Registration" msgstr "Регистрация аккаунта" -#: ../sflphone-gtk/src/assistant.c:374 +#: ../sflphone-gtk/src/assistant.c:390 msgid "Congratulations!" msgstr "Поздравляем!" -#: ../sflphone-gtk/src/assistant.c:376 +#: ../sflphone-gtk/src/context-menu.c:296 ../sflphone-gtk/src/menus.c:308 +#: ../sflphone-gtk/src/menus.c:791 +msgid "_Pick up" +msgstr "_Взять трубку" + +#: ../sflphone-gtk/src/context-menu.c:308 ../sflphone-gtk/src/menus.c:318 +#: ../sflphone-gtk/src/menus.c:803 +msgid "_Hang up" +msgstr "_Положить трубку" + +#: ../sflphone-gtk/src/context-menu.c:320 ../sflphone-gtk/src/menus.c:328 +#: ../sflphone-gtk/src/menus.c:815 +msgid "On _Hold" +msgstr "_Удержать звонок" + +#: ../sflphone-gtk/src/context-menu.c:332 ../sflphone-gtk/src/menus.c:340 +#: ../sflphone-gtk/src/menus.c:827 +msgid "_Record" +msgstr "Записать" + +#: ../sflphone-gtk/src/errors.c:28 msgid "" -"This assistant is now finished.\n" +"<b>ALSA notification</b>\n" "\n" -" You can at any time check your registration state or modify your accounts " -"parameters in the Options/Accounts window." +"Error while opening playback device" msgstr "" -"Мастер закончил настройку.\n" +"<b>ALSA-nпредупреждение</b>\n" "\n" -" Вы можете в любое время проверить статус регистрации или изменить " -"параметры ваших аккаунтов в меню Правка / Аккаунты." +"Ошибка во время активирования устройства проигрывания" + +#: ../sflphone-gtk/src/errors.c:31 +msgid "" +"<b>ALSA notification</b>\n" +"\n" +"Error while opening capture device" +msgstr "" +"<b>ALSA-nпредупреждение</b>\n" +"\n" +"Ошибка во время активирования устройства входа" + +#: ../sflphone-gtk/src/errors.c:34 +msgid "" +"<b>Pulseaudio notification</b>\n" +"\n" +"Pulseaudio is not running" +msgstr "" +"<b>Предупреждение Pulseaudio</b>\n" +"\n" +"Pulseaudio не работает" + +#: ../sflphone-gtk/src/mainwindow.c:70 +msgid "There is one call in progress." +msgstr "Звонок ещё не окончен" + +#: ../sflphone-gtk/src/mainwindow.c:74 +msgid "There are calls in progress." +msgstr "Несколько звонков ещё не окончены" + +#: ../sflphone-gtk/src/mainwindow.c:83 +msgid "Do you still want to quit?" +msgstr "Вы уверенны что хотите выйти?" + +#: ../sflphone-gtk/src/menus.c:131 +msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." +msgstr "SFLphone - SIP и IAX2-совместимый VoIP-клиент " + +#: ../sflphone-gtk/src/menus.c:134 +msgid "About SFLphone" +msgstr "О SFLphone" + +#: ../sflphone-gtk/src/menus.c:157 +msgid "_Help" +msgstr "_Помощь" + +#: ../sflphone-gtk/src/menus.c:296 ../sflphone-gtk/src/menus.c:949 +msgid "_New call" +msgstr "_Новый звонок" + +#: ../sflphone-gtk/src/menus.c:354 +msgid "_Account Assistant" +msgstr "_Мастер настройки аккаунтов" + +#: ../sflphone-gtk/src/menus.c:384 +msgid "_Call" +msgstr "_Звонок" + +#: ../sflphone-gtk/src/menus.c:557 +msgid "_Clear history" +msgstr "_Стереть журнал" + +#: ../sflphone-gtk/src/menus.c:569 +msgid "_Accounts" +msgstr "_Аккаунты" + +#: ../sflphone-gtk/src/menus.c:584 +msgid "_Edit" +msgstr "_Правка" + +#: ../sflphone-gtk/src/menus.c:644 +msgid "_Dialpad" +msgstr "_Клавиатура" + +#: ../sflphone-gtk/src/menus.c:656 +msgid "_Volume controls" +msgstr "_Настройки громкости" + +#: ../sflphone-gtk/src/menus.c:665 +msgid "_Search contact" +msgstr "_Искать в журнале" + +#: ../sflphone-gtk/src/menus.c:673 +msgid "_View" +msgstr "_Вид" + +#: ../sflphone-gtk/src/menus.c:885 +msgid "_Call back" +msgstr "_Перезвонить" + +#: ../sflphone-gtk/src/sflnotify.c:34 ../sflphone-gtk/src/sflnotify.c:100 +#, c-format +msgid "%s account: %s" +msgstr "%s аккаунт: %s" -#: ../sflphone-gtk/src/audioconf.c:154 +#: ../sflphone-gtk/src/sflnotify.c:37 +#, c-format +msgid "<i>From:</i> %s" +msgstr "<i>От:</i> %s" + +#: ../sflphone-gtk/src/sflnotify.c:52 +msgid "Accept" +msgstr "Согласиться" + +#: ../sflphone-gtk/src/sflnotify.c:53 +msgid "Refuse" +msgstr "Отказаться" + +#: ../sflphone-gtk/src/sflnotify.c:54 ../sflphone-gtk/src/sflnotify.c:117 +#: ../sflphone-gtk/src/sflnotify.c:154 +msgid "Ignore" +msgstr "Пропустить" + +#: ../sflphone-gtk/src/sflnotify.c:136 +#, c-format +msgid "Calling with %s account <i>%s</i>" +msgstr "Звонок с аккаунтом %s <i>%s</i>" + +#: ../sflphone-gtk/src/sflnotify.c:140 +msgid "Current account" +msgstr "Нынешний аккаунт" + +#: ../sflphone-gtk/src/sflnotify.c:169 +msgid "You haven't setup any accounts" +msgstr "Вы не настроили ни одного аккаунта" + +#: ../sflphone-gtk/src/sflnotify.c:209 +msgid "You have no registered accounts" +msgstr "У вас нет зарегистрированных аккаунтов" + +#: ../sflphone-gtk/src/sliders.c:161 +msgid "Speakers volume" +msgstr "Громкость" + +#: ../sflphone-gtk/src/sliders.c:163 +msgid "Mic volume" +msgstr "Громкость микрофона" + +#: ../sflphone-gtk/src/statusicon.c:91 +msgid "_Show main window" +msgstr "_Показать главное окно" + +#: ../sflphone-gtk/src/statusicon.c:124 +#, c-format +msgid "SFLphone - %i accounts registered" +msgstr "SFLphone - Зарегистрировано %i аккаунтов" + +#: ../sflphone-gtk/src/timestamp.c:46 +msgid "<small>Missed call</small>" +msgstr "<small>Пропущенный звонок</small>" + +#: ../sflphone-gtk/src/timestamp.c:64 +#, c-format +msgid "<small>Duration:</small> %s" +msgstr "<small>Время:</small> %s" + +#: ../sflphone-gtk/src/toolbar.c:49 +#, c-format +msgid "\"Voicemail\" <%s>" +msgstr "\"Автоответчик\" <%s>" + +#: ../sflphone-gtk/src/toolbar.c:175 ../sflphone-gtk/src/toolbar.c:177 +msgid "Place a call" +msgstr "Позвонить" + +#: ../sflphone-gtk/src/toolbar.c:184 ../sflphone-gtk/src/toolbar.c:186 +msgid "Pick up" +msgstr "Взять трубку" + +#: ../sflphone-gtk/src/toolbar.c:194 ../sflphone-gtk/src/toolbar.c:196 +msgid "Hang up" +msgstr "Положить трубку" + +#: ../sflphone-gtk/src/toolbar.c:204 ../sflphone-gtk/src/toolbar.c:206 +msgid "Off Hold" +msgstr "Снова взять" + +#: ../sflphone-gtk/src/toolbar.c:215 ../sflphone-gtk/src/toolbar.c:217 +msgid "On Hold" +msgstr "Удержать звонок" + +#: ../sflphone-gtk/src/toolbar.c:228 ../sflphone-gtk/src/toolbar.c:230 +msgid "Transfer" +msgstr "Переслать звонок на другой номер" + +#: ../sflphone-gtk/src/toolbar.c:240 ../sflphone-gtk/src/toolbar.c:242 +msgid "History" +msgstr "Журнал" + +#: ../sflphone-gtk/src/toolbar.c:251 ../sflphone-gtk/src/toolbar.c:253 +msgid "Address book" +msgstr "Адресная книга" + +#: ../sflphone-gtk/src/toolbar.c:258 ../sflphone-gtk/src/toolbar.c:262 +msgid "Voicemail" +msgstr "Автоответчик" + +#: ../sflphone-gtk/src/toolbar.c:270 +msgid "Record a call" +msgstr "Записать переговор" + +#: ../sflphone-gtk/src/contacts/history.c:75 +#: ../sflphone-gtk/src/contacts/searchbar.c:39 +#: ../sflphone-gtk/src/contacts/searchbar.c:65 +msgid "Search" +msgstr "Поиск" + +#: ../sflphone-gtk/src/config/accountwindow.c:103 +msgid "Account settings" +msgstr "Настройки аккаунта" + +#: ../sflphone-gtk/src/config/accountwindow.c:115 +msgid "Account parameters" +msgstr "Параметры аккаунта" + +#: ../sflphone-gtk/src/config/accountwindow.c:137 +msgid "_Enabled" +msgstr "_Включен" + +#: ../sflphone-gtk/src/config/accountwindow.c:151 +msgid "_Protocol" +msgstr "Пр_отокол" + +#: ../sflphone-gtk/src/config/accountwindow.c:169 +msgid "Unknown" +msgstr "Неизвестный" + +#: ../sflphone-gtk/src/config/accountwindow.c:209 +msgid "_Voicemail box #" +msgstr "Номер _автоответчика #" + +#: ../sflphone-gtk/src/config/addressbook-config.c:105 +msgid "Search Parameters" +msgstr "Параметры аккаунта" + +#: ../sflphone-gtk/src/config/addressbook-config.c:116 +msgid "Maximum result number for a request: " +msgstr "Максимальное количество звонков" + +#: ../sflphone-gtk/src/config/addressbook-config.c:127 +msgid "_Display contact photo if available" +msgstr "_Показать фотографию контакта (если имеется):" + +#: ../sflphone-gtk/src/config/addressbook-config.c:132 +msgid "Search for and display: " +msgstr "Найти и показать: " + +#: ../sflphone-gtk/src/config/addressbook-config.c:135 +msgid "_Business phone" +msgstr "_Рабочий телефон" + +#: ../sflphone-gtk/src/config/addressbook-config.c:140 +msgid "_Home phone" +msgstr "_Домашний телефон" + +#: ../sflphone-gtk/src/config/addressbook-config.c:145 +msgid "_Mobile phone" +msgstr "_Мобильный телефон" + +#: ../sflphone-gtk/src/config/audioconf.c:154 #, c-format msgid "audio device index for output = %d\n" msgstr "Индекс звукового устройства = %d\n" -#: ../sflphone-gtk/src/audioconf.c:562 +#: ../sflphone-gtk/src/config/audioconf.c:562 msgid "Name" msgstr "Имя" -#: ../sflphone-gtk/src/audioconf.c:567 +#: ../sflphone-gtk/src/config/audioconf.c:567 msgid "Frequency" msgstr "Частота" -#: ../sflphone-gtk/src/audioconf.c:572 +#: ../sflphone-gtk/src/config/audioconf.c:572 msgid "Bitrate" msgstr "Битрейт" -#: ../sflphone-gtk/src/audioconf.c:577 +#: ../sflphone-gtk/src/config/audioconf.c:577 msgid "Bandwidth" msgstr "Пропускная способность" -#: ../sflphone-gtk/src/audioconf.c:637 +#: ../sflphone-gtk/src/config/audioconf.c:637 msgid "Pulseaudio" msgstr "Pulseaudio" -#: ../sflphone-gtk/src/audioconf.c:640 +#: ../sflphone-gtk/src/config/audioconf.c:640 msgid "ALSA" msgstr "ALSA" -#: ../sflphone-gtk/src/audioconf.c:666 +#: ../sflphone-gtk/src/config/audioconf.c:666 msgid "ALSA plugin" msgstr "ALSA-плагин" -#: ../sflphone-gtk/src/audioconf.c:688 +#: ../sflphone-gtk/src/config/audioconf.c:688 msgid "Output" msgstr "Выход" -#: ../sflphone-gtk/src/audioconf.c:710 +#: ../sflphone-gtk/src/config/audioconf.c:710 msgid "Input" msgstr "Вход" -#: ../sflphone-gtk/src/audioconf.c:743 +#: ../sflphone-gtk/src/config/audioconf.c:743 msgid "_Enable ringtones" msgstr "Включить звонок" -#: ../sflphone-gtk/src/audioconf.c:748 +#: ../sflphone-gtk/src/config/audioconf.c:748 msgid "Choose a ringtone" msgstr "Выберите звонок" -#: ../sflphone-gtk/src/audioconf.c:753 +#: ../sflphone-gtk/src/config/audioconf.c:753 msgid "Audio Files" msgstr "Звуковые файлы" -#: ../sflphone-gtk/src/audioconf.c:770 +#: ../sflphone-gtk/src/config/audioconf.c:770 msgid "_Activate silence detection" msgstr "Включить детектор тишины" -#: ../sflphone-gtk/src/audioconf.c:798 +#: ../sflphone-gtk/src/config/audioconf.c:798 msgid "Sound Manager" msgstr "Менеджер звука" -#: ../sflphone-gtk/src/audioconf.c:805 +#: ../sflphone-gtk/src/config/audioconf.c:805 msgid "ALSA configuration" msgstr "Настройка ALSA" -#: ../sflphone-gtk/src/audioconf.c:815 +#: ../sflphone-gtk/src/config/audioconf.c:815 msgid "Codecs" msgstr "Кодеки" -#: ../sflphone-gtk/src/audioconf.c:823 +#: ../sflphone-gtk/src/config/audioconf.c:823 msgid "Noise reduction" msgstr "Уменьшение шума" -#: ../sflphone-gtk/src/audioconf.c:830 +#: ../sflphone-gtk/src/config/audioconf.c:830 msgid "Ringtones" msgstr "Звонки" -#: ../sflphone-gtk/src/calltree.c:209 -#, c-format -msgid "\"Voicemail\" <%s>" -msgstr "\"Автоответчик\" <%s>" - -#: ../sflphone-gtk/src/calltree.c:431 ../sflphone-gtk/src/calltree.c:433 -msgid "Place a call" -msgstr "Позвонить" - -#: ../sflphone-gtk/src/calltree.c:440 ../sflphone-gtk/src/calltree.c:442 -msgid "Pick up" -msgstr "Взять трубку" - -#: ../sflphone-gtk/src/calltree.c:450 ../sflphone-gtk/src/calltree.c:452 -msgid "Hang up" -msgstr "Положить трубку" - -#: ../sflphone-gtk/src/calltree.c:460 ../sflphone-gtk/src/calltree.c:462 -msgid "Off Hold" -msgstr "Снова взять" - -#: ../sflphone-gtk/src/calltree.c:471 ../sflphone-gtk/src/calltree.c:473 -msgid "On Hold" -msgstr "Удержать звонок" - -#: ../sflphone-gtk/src/calltree.c:484 ../sflphone-gtk/src/calltree.c:486 -msgid "Transfer" -msgstr "Переслать звонок на другой номер" - -#: ../sflphone-gtk/src/calltree.c:496 ../sflphone-gtk/src/calltree.c:498 -msgid "History" -msgstr "Журнал" - -#: ../sflphone-gtk/src/calltree.c:506 ../sflphone-gtk/src/calltree.c:510 -msgid "Voicemail" -msgstr "Автоответчик" - -#: ../sflphone-gtk/src/calltree.c:521 -#, fuzzy -msgid "Record a call" -msgstr "Записать переговор" - -#: ../sflphone-gtk/src/configwindow.c:382 +#: ../sflphone-gtk/src/config/configwindow.c:385 msgid "Protocol" msgstr "Протокол" -#: ../sflphone-gtk/src/configwindow.c:389 +#: ../sflphone-gtk/src/config/configwindow.c:392 msgid "Status" msgstr "Статус" -#: ../sflphone-gtk/src/configwindow.c:492 +#: ../sflphone-gtk/src/config/configwindow.c:495 msgid "Stun parameters will apply to each SIP account created." msgstr "STUN-параметры будут эффективны для каждого созданного SIP-аккаунта" -#: ../sflphone-gtk/src/configwindow.c:500 -#, fuzzy +#: ../sflphone-gtk/src/config/configwindow.c:503 msgid "Enable it if you are behind a firewall" msgstr "" "Включите это если вы находитесь за сетевым экраном и потом перезагрузите " "SFLphone" -#: ../sflphone-gtk/src/configwindow.c:508 +#: ../sflphone-gtk/src/config/configwindow.c:511 msgid "Format: name.server:port" msgstr "Формат: имя.сервер:порт" -#: ../sflphone-gtk/src/configwindow.c:558 +#: ../sflphone-gtk/src/config/configwindow.c:561 msgid "Desktop Notification" msgstr "Извещения на рабочем столе" -#: ../sflphone-gtk/src/configwindow.c:566 +#: ../sflphone-gtk/src/config/configwindow.c:569 msgid "_Enable" msgstr "_Включить" -#: ../sflphone-gtk/src/configwindow.c:571 +#: ../sflphone-gtk/src/config/configwindow.c:574 msgid "_Notify voice mails" msgstr "_Предупредить о новых речевых сообщениях" -#: ../sflphone-gtk/src/configwindow.c:577 +#: ../sflphone-gtk/src/config/configwindow.c:580 msgid "System Tray Icon" msgstr "System Tray Icon" -#: ../sflphone-gtk/src/configwindow.c:585 +#: ../sflphone-gtk/src/config/configwindow.c:588 msgid "_Popup main window on incoming call" msgstr "_Показать главное окно при входящем звонке" -#: ../sflphone-gtk/src/configwindow.c:590 +#: ../sflphone-gtk/src/config/configwindow.c:593 msgid "Ne_ver popup main window" msgstr "Никогда не показывать главное окно" -#: ../sflphone-gtk/src/configwindow.c:594 +#: ../sflphone-gtk/src/config/configwindow.c:597 msgid "_Start hidden" msgstr "_Начать спрятанным" -#: ../sflphone-gtk/src/configwindow.c:600 +#: ../sflphone-gtk/src/config/configwindow.c:603 msgid "Calls History" msgstr "Журнал звонков" -#: ../sflphone-gtk/src/configwindow.c:608 +#: ../sflphone-gtk/src/config/configwindow.c:611 msgid "_Maximum number of calls" msgstr "_Максимальное количество звонков" -#: ../sflphone-gtk/src/configwindow.c:624 +#: ../sflphone-gtk/src/config/configwindow.c:627 msgid "PulseAudio sound server" msgstr "Сервер звука PulseAudio" -#: ../sflphone-gtk/src/configwindow.c:632 +#: ../sflphone-gtk/src/config/configwindow.c:635 msgid "_Control running applications volume" msgstr "_Начать спрятанным " -#: ../sflphone-gtk/src/configwindow.c:645 +#: ../sflphone-gtk/src/config/configwindow.c:648 msgid "SIP Port" msgstr "SIP-порт" -#: ../sflphone-gtk/src/configwindow.c:658 +#: ../sflphone-gtk/src/config/configwindow.c:661 msgid "Port:" msgstr "Порт:" -#: ../sflphone-gtk/src/configwindow.c:703 -#, fuzzy +#: ../sflphone-gtk/src/config/configwindow.c:706 msgid "General" msgstr "Общие настройки" -#: ../sflphone-gtk/src/configwindow.c:714 +#: ../sflphone-gtk/src/config/configwindow.c:717 msgid "_Destination folder" msgstr "Папка назна_чения" -#: ../sflphone-gtk/src/configwindow.c:719 +#: ../sflphone-gtk/src/config/configwindow.c:723 msgid "Select a folder" msgstr "Выберите папку" -#: ../sflphone-gtk/src/configwindow.c:744 +#: ../sflphone-gtk/src/config/configwindow.c:748 msgid "Preferences" msgstr "Предпочтения" -#: ../sflphone-gtk/src/configwindow.c:764 +#: ../sflphone-gtk/src/config/configwindow.c:768 msgid "General Settings" msgstr "Общие настройки" -#: ../sflphone-gtk/src/configwindow.c:769 +#: ../sflphone-gtk/src/config/configwindow.c:773 msgid "Audio Settings" msgstr "Настройки звука" -#: ../sflphone-gtk/src/configwindow.c:774 +#: ../sflphone-gtk/src/config/configwindow.c:778 msgid "Record" msgstr "Записать" -#: ../sflphone-gtk/src/configwindow.c:798 +#: ../sflphone-gtk/src/config/configwindow.c:783 +msgid "Address Book" +msgstr "Адресная книга" + +#: ../sflphone-gtk/src/config/configwindow.c:788 +msgid "Hooks" +msgstr "перехватчики (hooks)" + +#: ../sflphone-gtk/src/config/configwindow.c:814 msgid "Accounts" msgstr "Аккаунты" -#: ../sflphone-gtk/src/configwindow.c:810 +#: ../sflphone-gtk/src/config/configwindow.c:826 msgid "Accounts previously setup" msgstr "Существующие аккаунты" -#: ../sflphone-gtk/src/errors.c:28 -msgid "" -"<b>ALSA notification</b>\n" -"\n" -"Error while opening playback device" -msgstr "" -"<b>ALSA-nпредупреждение</b>\n" -"\n" -"Ошибка во время активирования устройства проигрывания" +#: ../sflphone-gtk/src/config/hooks-config.c:92 +msgid "URL argument" +msgstr "URL аргумент" -#: ../sflphone-gtk/src/errors.c:31 -msgid "" -"<b>ALSA notification</b>\n" -"\n" -"Error while opening capture device" -msgstr "" -"<b>ALSA-nпредупреждение</b>\n" -"\n" -"Ошибка во время активирования устройства входа" +#: ../sflphone-gtk/src/config/hooks-config.c:102 +msgid "_SIP protocol" +msgstr "Пр_отокол" -#: ../sflphone-gtk/src/errors.c:34 -msgid "" -"<b>Pulseaudio notification</b>\n" -"\n" -"Pulseaudio is not running" -msgstr "" -"<b>Предупреждение Pulseaudio</b>\n" -"\n" -"Pulseaudio не работает" +#: ../sflphone-gtk/src/config/hooks-config.c:107 +msgid "_IAX2 protocol" +msgstr "Пр_отокол" -#: ../sflphone-gtk/src/historyfilter.c:49 -#: ../sflphone-gtk/src/historyfilter.c:68 -#: ../sflphone-gtk/src/historyfilter.c:83 -msgid "Search" -msgstr "Поиск" +#: ../sflphone-gtk/src/config/hooks-config.c:113 +msgid "_SIP Header: " +msgstr "_SIP Заголовок" -#: ../sflphone-gtk/src/mainwindow.c:69 -#, fuzzy -msgid "There is one call in progress." -msgstr "Звонок ещё не окончен" +#: ../sflphone-gtk/src/config/hooks-config.c:120 +msgid "_Command: " +msgstr "_Команда" -#: ../sflphone-gtk/src/mainwindow.c:73 #, fuzzy -msgid "There are calls in progress." -msgstr "Несколько звонков ещё не окончены" +#~ msgid "SFLphone 0.9.3" +#~ msgstr "SFLphone 0.9.2" -#: ../sflphone-gtk/src/mainwindow.c:82 -msgid "Do you still want to quit?" -msgstr "Вы уверенны что хотите выйти?" - -#: ../sflphone-gtk/src/menus.c:135 -msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." -msgstr "SFLphone - SIP и IAX2-совместимый VoIP-клиент " - -#: ../sflphone-gtk/src/menus.c:138 -msgid "About SFLphone" -msgstr "О SFLphone" - -#: ../sflphone-gtk/src/menus.c:161 -msgid "_Help" -msgstr "_Помощь" - -#: ../sflphone-gtk/src/menus.c:278 -msgid "_New call" -msgstr "_Новый звонок" - -#: ../sflphone-gtk/src/menus.c:290 ../sflphone-gtk/src/menus.c:760 -msgid "_Pick up" -msgstr "_Взять трубку" - -#: ../sflphone-gtk/src/menus.c:300 ../sflphone-gtk/src/menus.c:772 -msgid "_Hang up" -msgstr "_Положить трубку" - -#: ../sflphone-gtk/src/menus.c:310 ../sflphone-gtk/src/menus.c:784 -msgid "On _Hold" -msgstr "_Удержать звонок" - -#: ../sflphone-gtk/src/menus.c:326 -msgid "_Account Assistant" -msgstr "_Мастер настройки аккаунтов" - -#: ../sflphone-gtk/src/menus.c:356 -msgid "_Call" -msgstr "_Звонок" - -#: ../sflphone-gtk/src/menus.c:529 -msgid "_Clear history" -msgstr "_Стереть журнал" - -#: ../sflphone-gtk/src/menus.c:541 -msgid "_Accounts" -msgstr "_Аккаунты" - -#: ../sflphone-gtk/src/menus.c:556 -msgid "_Edit" -msgstr "_Правка" - -#: ../sflphone-gtk/src/menus.c:616 -msgid "_Dialpad" -msgstr "_Клавиатура" - -#: ../sflphone-gtk/src/menus.c:628 -msgid "_Volume controls" -msgstr "_Настройки громкости" - -#: ../sflphone-gtk/src/menus.c:637 -msgid "_Search history" -msgstr "_Искать в журнале" - -#: ../sflphone-gtk/src/menus.c:645 -msgid "_View" -msgstr "_Вид" - -#: ../sflphone-gtk/src/menus.c:867 -msgid "_Call back" -msgstr "_Перезвонить" - -#: ../sflphone-gtk/src/sflnotify.c:34 ../sflphone-gtk/src/sflnotify.c:100 -#, c-format -msgid "%s account: %s" -msgstr "%s аккаунт: %s" - -#: ../sflphone-gtk/src/sflnotify.c:37 -#, c-format -msgid "<i>From:</i> %s" -msgstr "<i>От:</i> %s" - -#: ../sflphone-gtk/src/sflnotify.c:52 -msgid "Accept" -msgstr "Согласиться" - -#: ../sflphone-gtk/src/sflnotify.c:53 -msgid "Refuse" -msgstr "Отказаться" - -#: ../sflphone-gtk/src/sflnotify.c:54 ../sflphone-gtk/src/sflnotify.c:117 -#: ../sflphone-gtk/src/sflnotify.c:154 -msgid "Ignore" -msgstr "Пропустить" - -#: ../sflphone-gtk/src/sflnotify.c:136 -#, c-format -msgid "Calling with %s account <i>%s</i>" -msgstr "Звонок с аккаунтом %s <i>%s</i>" - -#: ../sflphone-gtk/src/sflnotify.c:140 -msgid "Current account" -msgstr "Нынешний аккаунт" - -#: ../sflphone-gtk/src/sflnotify.c:169 -msgid "You haven't setup any accounts" -msgstr "Вы не настроили ни одного аккаунта" - -#: ../sflphone-gtk/src/sflnotify.c:185 ../sflphone-gtk/src/sflnotify.c:224 -msgid "Setup Accounts" -msgstr "Настроить аккаунты" - -#: ../sflphone-gtk/src/sflnotify.c:208 -msgid "You have no registered accounts" -msgstr "У вас нет зарегистрированных аккаунтов" - -#: ../sflphone-gtk/src/sliders.c:161 -msgid "Speakers volume" -msgstr "Громкость" - -#: ../sflphone-gtk/src/sliders.c:163 -msgid "Mic volume" -msgstr "Громкость микрофона" - -#: ../sflphone-gtk/src/statusicon.c:91 -msgid "_Show main window" -msgstr "_Показать главное окно" - -#: ../sflphone-gtk/src/statusicon.c:124 -#, c-format -msgid "SFLphone - %i accounts registered" -msgstr "SFLphone - Зарегистрировано %i аккаунтов" - -#: ../sflphone-gtk/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "<small>Пропущенный звонок</small>" - -#: ../sflphone-gtk/src/timestamp.c:64 -#, c-format -msgid "<small>Duration:</small> %s" -msgstr "<small>Время:</small> %s" +#~ msgid "Setup Accounts" +#~ msgstr "Настроить аккаунты" #~ msgid "_STUN Server" #~ msgstr "_STUN-сервер" diff --git a/po/zh_CN.po b/po/zh_CN.po index e6b463e3dbdfbfd707b0e827e261c13e3aadb3ce..fee36e06cebb45b0096f21b5a3dfb1f3591ac917 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: SFLphone 0.9.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-02-10 15:24-0500\n" +"POT-Creation-Date: 2009-04-02 11:15-0400\n" "PO-Revision-Date: 2008-10-28 14:15\n" "Last-Translator: Yun Liu <yun.liu@savoirfairelinux.com>\n" "Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" @@ -30,7 +30,7 @@ msgid "Trying..." msgstr "正在连接..." #: ../sflphone-gtk/src/accountlist.c:167 ../sflphone-gtk/src/sflnotify.c:171 -#: ../sflphone-gtk/src/sflnotify.c:210 +#: ../sflphone-gtk/src/sflnotify.c:212 msgid "Error" msgstr "注册失败" @@ -47,7 +47,6 @@ msgid "Host unreachable" msgstr "服务器连接失败" #: ../sflphone-gtk/src/accountlist.c:179 -#, fuzzy msgid "Stun configuration error" msgstr "Stun配置有误" @@ -59,66 +58,22 @@ msgstr "Stun服务器无效" msgid "Invalid" msgstr "无效" -#: ../sflphone-gtk/src/accountwindow.c:109 -msgid "Account settings" -msgstr "帐户设置" - -#: ../sflphone-gtk/src/accountwindow.c:121 -msgid "Account parameters" -msgstr "帐户相关参数" - -#: ../sflphone-gtk/src/accountwindow.c:143 -msgid "_Enabled" -msgstr "启用(E)" - -#: ../sflphone-gtk/src/accountwindow.c:149 ../sflphone-gtk/src/assistant.c:238 -#: ../sflphone-gtk/src/assistant.c:292 -msgid "_Alias" -msgstr "别名(A)" - -#: ../sflphone-gtk/src/accountwindow.c:157 -msgid "_Protocol" -msgstr "协议(P)" - -#: ../sflphone-gtk/src/accountwindow.c:175 -msgid "Unknown" -msgstr "未知" - -#: ../sflphone-gtk/src/accountwindow.c:185 ../sflphone-gtk/src/assistant.c:246 -#: ../sflphone-gtk/src/assistant.c:300 -msgid "_Host name" -msgstr "主机名(H)" - -#: ../sflphone-gtk/src/accountwindow.c:193 ../sflphone-gtk/src/assistant.c:254 -#: ../sflphone-gtk/src/assistant.c:308 -msgid "_User name" -msgstr "用户名(U)" - -#: ../sflphone-gtk/src/accountwindow.c:204 ../sflphone-gtk/src/assistant.c:264 -#: ../sflphone-gtk/src/assistant.c:318 -msgid "_Password" -msgstr "密码(P)" - -#: ../sflphone-gtk/src/accountwindow.c:215 -msgid "_Voicemail box #" -msgstr "语音信箱(V)" - -#: ../sflphone-gtk/src/actions.c:57 ../sflphone-gtk/src/sflnotify.c:103 +#: ../sflphone-gtk/src/actions.c:55 ../sflphone-gtk/src/sflnotify.c:103 #, c-format msgid "%d voice mails" msgstr "%d 个语音信息" -#: ../sflphone-gtk/src/actions.c:59 +#: ../sflphone-gtk/src/actions.c:57 #, c-format msgid "%d voice mail" msgstr "%d 个语音信息" -#: ../sflphone-gtk/src/actions.c:80 +#: ../sflphone-gtk/src/actions.c:81 #, c-format msgid "%s account- %s" msgstr "%s 帐户- %s" -#: ../sflphone-gtk/src/actions.c:224 +#: ../sflphone-gtk/src/actions.c:225 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -126,7 +81,11 @@ msgstr "" "连接SFLphone服务器失败.\n" "请检查daemon是否还在运行." -#: ../sflphone-gtk/src/actions.c:798 +#: ../sflphone-gtk/src/actions.c:764 +msgid "%s account- %s %s" +msgstr "%s 帐户- %s %s" + +#: ../sflphone-gtk/src/actions.c:861 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -139,46 +98,58 @@ msgstr "" "</b> SFL声音codecs文件应位于<i>%s</i> 或 位于主目录( <i>%s</i> )的<b>." "sflphone</b>目录下" -#: ../sflphone-gtk/src/assistant.c:148 +#: ../sflphone-gtk/src/assistant.c:31 +msgid "" +"This assistant is now finished.\n" +"You can at any time check your registration state or modify your accounts " +"parameters in the Options/Accounts window.\n" +"\n" +"Alias : %s\n" +"Server : %s\n" +"Username : %s\n" +"Password : %s" +msgstr "" +"配置完成.\n" +"你可以随时在 选项/帐户 窗口中查看注册状态或者修改帐户参数.\n" +"\n" +"别名: %s\n" +"服务器: %s\n" +"用户名: %s\n" +"密码: %s" + +#: ../sflphone-gtk/src/assistant.c:154 msgid "SFLphone account configuration wizard" msgstr "SFLphone 帐户设置向导" -#: ../sflphone-gtk/src/assistant.c:176 -#, fuzzy -msgid "SFLphone 0.9.2" -msgstr "SFLphone 0.9.2" - -#: ../sflphone-gtk/src/assistant.c:176 +#: ../sflphone-gtk/src/assistant.c:180 msgid "Welcome to SFLphone!" msgstr "欢迎使用SFLphone!" -#: ../sflphone-gtk/src/assistant.c:178 +#: ../sflphone-gtk/src/assistant.c:181 msgid "This installation wizard will help you configure an account." msgstr "安装向导将帮助您配置帐户" -#: ../sflphone-gtk/src/assistant.c:193 +#: ../sflphone-gtk/src/assistant.c:195 msgid "VoIP Protocols" msgstr "VoIP协议" -#: ../sflphone-gtk/src/assistant.c:193 +#: ../sflphone-gtk/src/assistant.c:195 msgid "Select an account type:" msgstr "选择帐户类型:" -#: ../sflphone-gtk/src/assistant.c:211 -#, fuzzy +#: ../sflphone-gtk/src/assistant.c:213 msgid "Account" msgstr "帐户" -#: ../sflphone-gtk/src/assistant.c:211 -#, fuzzy +#: ../sflphone-gtk/src/assistant.c:213 msgid "Please select one of the following option:" -msgstr "请填写以下信息:" +msgstr "请选择以下选项中的一个:" -#: ../sflphone-gtk/src/assistant.c:213 +#: ../sflphone-gtk/src/assistant.c:215 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "在sflphone.org上创建免费的SIP/IAX2帐户" -#: ../sflphone-gtk/src/assistant.c:215 +#: ../sflphone-gtk/src/assistant.c:217 msgid "Register an existing SIP or IAX2 account" msgstr "注册已存在的SIP或IAX2帐户" @@ -186,466 +157,574 @@ msgstr "注册已存在的SIP或IAX2帐户" msgid "SIP account configuration" msgstr "SIP帐户配置" -#: ../sflphone-gtk/src/assistant.c:230 ../sflphone-gtk/src/assistant.c:284 +#: ../sflphone-gtk/src/assistant.c:230 ../sflphone-gtk/src/assistant.c:305 msgid "Please fill the following information:" msgstr "请填写以下信息:" -#: ../sflphone-gtk/src/assistant.c:284 +#: ../sflphone-gtk/src/assistant.c:238 ../sflphone-gtk/src/assistant.c:313 +#: ../sflphone-gtk/src/config/accountwindow.c:143 +msgid "_Alias" +msgstr "别名(A)" + +#: ../sflphone-gtk/src/assistant.c:246 ../sflphone-gtk/src/assistant.c:321 +#: ../sflphone-gtk/src/config/accountwindow.c:179 +msgid "_Host name" +msgstr "主机名(H)" + +#: ../sflphone-gtk/src/assistant.c:254 ../sflphone-gtk/src/assistant.c:329 +#: ../sflphone-gtk/src/config/accountwindow.c:187 +msgid "_User name" +msgstr "用户名(U)" + +#: ../sflphone-gtk/src/assistant.c:264 ../sflphone-gtk/src/assistant.c:339 +#: ../sflphone-gtk/src/config/accountwindow.c:198 +msgid "_Password" +msgstr "密码(P)" + +#: ../sflphone-gtk/src/assistant.c:282 +msgid "Optional Email Address " +msgstr "可选邮件地址 " + +#: ../sflphone-gtk/src/assistant.c:282 +msgid "This email address will be use to send your voicemail messages" +msgstr "这个邮件地址将被用来发送您的语音邮箱消息" + +#: ../sflphone-gtk/src/assistant.c:290 +msgid "_Email" +msgstr " 邮件(E)" + +#: ../sflphone-gtk/src/assistant.c:305 msgid "IAX2 account configuration" msgstr "IAX2帐户配置" -#: ../sflphone-gtk/src/assistant.c:341 ../sflphone-gtk/src/configwindow.c:821 +#: ../sflphone-gtk/src/assistant.c:360 +#: ../sflphone-gtk/src/config/configwindow.c:837 msgid "Network Address Translation" msgstr "网络地址解析" -#: ../sflphone-gtk/src/assistant.c:341 +#: ../sflphone-gtk/src/assistant.c:360 msgid "You should probably enable this if you are behind a firewall." -msgstr "如果你的网络使用防火墙,你很有可能需要设定此项." +msgstr "如果你使用网络使用防火墙,你很有可能需要设定此项." -#: ../sflphone-gtk/src/assistant.c:350 ../sflphone-gtk/src/configwindow.c:496 +#: ../sflphone-gtk/src/assistant.c:369 +#: ../sflphone-gtk/src/config/configwindow.c:499 msgid "E_nable STUN" msgstr "使用STUN(n)" -#: ../sflphone-gtk/src/assistant.c:357 +#: ../sflphone-gtk/src/assistant.c:376 msgid "_STUN server" msgstr "STUN服务器(S)" -#: ../sflphone-gtk/src/assistant.c:374 +#: ../sflphone-gtk/src/assistant.c:390 msgid "Account Registration" msgstr "帐户注册" -#: ../sflphone-gtk/src/assistant.c:374 +#: ../sflphone-gtk/src/assistant.c:390 msgid "Congratulations!" msgstr "恭喜!" -#: ../sflphone-gtk/src/assistant.c:376 +#: ../sflphone-gtk/src/context-menu.c:296 ../sflphone-gtk/src/menus.c:308 +#: ../sflphone-gtk/src/menus.c:791 +msgid "_Pick up" +msgstr "拨出(P)" + +#: ../sflphone-gtk/src/context-menu.c:308 ../sflphone-gtk/src/menus.c:318 +#: ../sflphone-gtk/src/menus.c:803 +msgid "_Hang up" +msgstr "放下(H)" + +#: ../sflphone-gtk/src/context-menu.c:320 ../sflphone-gtk/src/menus.c:328 +#: ../sflphone-gtk/src/menus.c:815 +msgid "On _Hold" +msgstr "保持(H)" + +#: ../sflphone-gtk/src/context-menu.c:332 ../sflphone-gtk/src/menus.c:340 +#: ../sflphone-gtk/src/menus.c:827 +msgid "_Record" +msgstr "记录(R)" + +#: ../sflphone-gtk/src/errors.c:28 msgid "" -"This assistant is now finished.\n" +"<b>ALSA notification</b>\n" "\n" -" You can at any time check your registration state or modify your accounts " -"parameters in the Options/Accounts window." +"Error while opening playback device" msgstr "" -"配置完成.\n" +"<b>ALSA提示</b>\n" +"\n" +"打开回放设备时出错" + +#: ../sflphone-gtk/src/errors.c:31 +msgid "" +"<b>ALSA notification</b>\n" +"\n" +"Error while opening capture device" +msgstr "" +"<b>ALSA提示</b>\n" +"\n" +"打开采集设备时出错" + +#: ../sflphone-gtk/src/errors.c:34 +msgid "" +"<b>Pulseaudio notification</b>\n" "\n" -"你可以随时在 选项/帐户 窗口中查看注册状态或者修改帐户参数" +"Pulseaudio is not running" +msgstr "" + +#: ../sflphone-gtk/src/mainwindow.c:70 +msgid "There is one call in progress." +msgstr "有一个电话正在处理" + +#: ../sflphone-gtk/src/mainwindow.c:74 +msgid "There are calls in progress." +msgstr "有电话正在处理中" + +#: ../sflphone-gtk/src/mainwindow.c:83 +msgid "Do you still want to quit?" +msgstr "确认要退出?" + +#: ../sflphone-gtk/src/menus.c:131 +msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." +msgstr "SFLphone是一个VoIP客户端,它兼容SIP和IAX2协议." + +#: ../sflphone-gtk/src/menus.c:134 +msgid "About SFLphone" +msgstr "关于SFLphone" + +#: ../sflphone-gtk/src/menus.c:157 +msgid "_Help" +msgstr "帮助(H)" + +#: ../sflphone-gtk/src/menus.c:296 ../sflphone-gtk/src/menus.c:949 +msgid "_New call" +msgstr "新电话(N)" + +#: ../sflphone-gtk/src/menus.c:354 +msgid "_Account Assistant" +msgstr "帐户向导(A)" + +#: ../sflphone-gtk/src/menus.c:384 +msgid "_Call" +msgstr "电话" + +#: ../sflphone-gtk/src/menus.c:557 +msgid "_Clear history" +msgstr "清空历史记录(C)" + +#: ../sflphone-gtk/src/menus.c:569 +msgid "_Accounts" +msgstr "帐户(A)" + +#: ../sflphone-gtk/src/menus.c:584 +msgid "_Edit" +msgstr "编辑(E)" + +#: ../sflphone-gtk/src/menus.c:644 +msgid "_Dialpad" +msgstr "拨号面板" + +#: ../sflphone-gtk/src/menus.c:656 +msgid "_Volume controls" +msgstr "音量控制(V)" + +#: ../sflphone-gtk/src/menus.c:665 +msgid "_Search contact" +msgstr "查找历史(S)" + +#: ../sflphone-gtk/src/menus.c:673 +msgid "_View" +msgstr "查看(V)" + +#: ../sflphone-gtk/src/menus.c:885 +msgid "_Call back" +msgstr "回叫(C)" + +#: ../sflphone-gtk/src/sflnotify.c:34 ../sflphone-gtk/src/sflnotify.c:100 +#, c-format +msgid "%s account: %s" +msgstr "%s 帐户: %s" + +#: ../sflphone-gtk/src/sflnotify.c:37 +#, c-format +msgid "<i>From:</i> %s" +msgstr "<i>拨入方:</i> %s" + +#: ../sflphone-gtk/src/sflnotify.c:52 +msgid "Accept" +msgstr "接受" + +#: ../sflphone-gtk/src/sflnotify.c:53 +msgid "Refuse" +msgstr "拒绝" + +#: ../sflphone-gtk/src/sflnotify.c:54 ../sflphone-gtk/src/sflnotify.c:117 +#: ../sflphone-gtk/src/sflnotify.c:154 +msgid "Ignore" +msgstr "忽略" + +#: ../sflphone-gtk/src/sflnotify.c:136 +#, c-format +msgid "Calling with %s account <i>%s</i>" +msgstr "使用%s帐户<i>%s</i>呼叫" + +#: ../sflphone-gtk/src/sflnotify.c:140 +msgid "Current account" +msgstr "当前帐户" + +#: ../sflphone-gtk/src/sflnotify.c:169 +msgid "You haven't setup any accounts" +msgstr "你没有设置任何帐户" + +#: ../sflphone-gtk/src/sflnotify.c:209 +msgid "You have no registered accounts" +msgstr "未发现已注册帐户" + +#: ../sflphone-gtk/src/sliders.c:161 +msgid "Speakers volume" +msgstr "扬声器音量" + +#: ../sflphone-gtk/src/sliders.c:163 +msgid "Mic volume" +msgstr "话筒音量" + +#: ../sflphone-gtk/src/statusicon.c:91 +msgid "_Show main window" +msgstr "显示主窗口(S)" + +#: ../sflphone-gtk/src/statusicon.c:124 +#, c-format +msgid "SFLphone - %i accounts registered" +msgstr "SFLphone - %i 个帐户已注册" + +#: ../sflphone-gtk/src/timestamp.c:46 +msgid "<small>Missed call</small>" +msgstr "<small>未接电话</small>" + +#: ../sflphone-gtk/src/timestamp.c:64 +#, c-format +msgid "<small>Duration:</small> %s" +msgstr "<small>时长:</small> %s" + +#: ../sflphone-gtk/src/toolbar.c:49 +#, c-format +msgid "\"Voicemail\" <%s>" +msgstr "\"语音邮件\" <%s>" + +#: ../sflphone-gtk/src/toolbar.c:175 ../sflphone-gtk/src/toolbar.c:177 +msgid "Place a call" +msgstr "拨号" + +#: ../sflphone-gtk/src/toolbar.c:184 ../sflphone-gtk/src/toolbar.c:186 +msgid "Pick up" +msgstr "接电话" + +#: ../sflphone-gtk/src/toolbar.c:194 ../sflphone-gtk/src/toolbar.c:196 +msgid "Hang up" +msgstr "放电话" + +#: ../sflphone-gtk/src/toolbar.c:204 ../sflphone-gtk/src/toolbar.c:206 +msgid "Off Hold" +msgstr "恢复通话" -#: ../sflphone-gtk/src/audioconf.c:154 +#: ../sflphone-gtk/src/toolbar.c:215 ../sflphone-gtk/src/toolbar.c:217 +msgid "On Hold" +msgstr "待机" + +#: ../sflphone-gtk/src/toolbar.c:228 ../sflphone-gtk/src/toolbar.c:230 +msgid "Transfer" +msgstr "转接" + +#: ../sflphone-gtk/src/toolbar.c:240 ../sflphone-gtk/src/toolbar.c:242 +msgid "History" +msgstr "历史" + +#: ../sflphone-gtk/src/toolbar.c:251 ../sflphone-gtk/src/toolbar.c:253 +msgid "Address book" +msgstr "地址簿" + +#: ../sflphone-gtk/src/toolbar.c:258 ../sflphone-gtk/src/toolbar.c:262 +msgid "Voicemail" +msgstr "语音信箱" + +#: ../sflphone-gtk/src/toolbar.c:270 +msgid "Record a call" +msgstr "记录通话" + +#: ../sflphone-gtk/src/contacts/history.c:75 +#: ../sflphone-gtk/src/contacts/searchbar.c:39 +#: ../sflphone-gtk/src/contacts/searchbar.c:65 +msgid "Search" +msgstr "查找" + +#: ../sflphone-gtk/src/config/accountwindow.c:103 +msgid "Account settings" +msgstr "帐户设置" + +#: ../sflphone-gtk/src/config/accountwindow.c:115 +msgid "Account parameters" +msgstr "帐户相关参数" + +#: ../sflphone-gtk/src/config/accountwindow.c:137 +msgid "_Enabled" +msgstr "启用(E)" + +#: ../sflphone-gtk/src/config/accountwindow.c:151 +msgid "_Protocol" +msgstr "协议(P)" + +#: ../sflphone-gtk/src/config/accountwindow.c:169 +msgid "Unknown" +msgstr "未知" + +#: ../sflphone-gtk/src/config/accountwindow.c:209 +msgid "_Voicemail box #" +msgstr "语音信箱(V)" + +#: ../sflphone-gtk/src/config/addressbook-config.c:105 +msgid "Search Parameters" +msgstr "查找相关参数" + +#: ../sflphone-gtk/src/config/addressbook-config.c:116 +msgid "Maximum result number for a request: " +msgstr "最大拨号数" + +#: ../sflphone-gtk/src/config/addressbook-config.c:127 +msgid "_Display contact photo if available" +msgstr "如果可行则显示联系人照片(D)" + +#: ../sflphone-gtk/src/config/addressbook-config.c:132 +msgid "Search for and display: " +msgstr "查找并显示:" + +#: ../sflphone-gtk/src/config/addressbook-config.c:135 +msgid "_Business phone" +msgstr "商务电话(B)" + +#: ../sflphone-gtk/src/config/addressbook-config.c:140 +msgid "_Home phone" +msgstr "家庭电话(H)" + +#: ../sflphone-gtk/src/config/addressbook-config.c:145 +msgid "_Mobile phone" +msgstr "移动电话(M)" + +#: ../sflphone-gtk/src/config/audioconf.c:154 #, c-format msgid "audio device index for output = %d\n" msgstr "音频设备索引输出 = %d\n" -#: ../sflphone-gtk/src/audioconf.c:562 +#: ../sflphone-gtk/src/config/audioconf.c:562 msgid "Name" msgstr "名称" -#: ../sflphone-gtk/src/audioconf.c:567 +#: ../sflphone-gtk/src/config/audioconf.c:567 msgid "Frequency" msgstr "频率" -#: ../sflphone-gtk/src/audioconf.c:572 +#: ../sflphone-gtk/src/config/audioconf.c:572 msgid "Bitrate" msgstr "比率" -#: ../sflphone-gtk/src/audioconf.c:577 +#: ../sflphone-gtk/src/config/audioconf.c:577 msgid "Bandwidth" msgstr "带宽" -#: ../sflphone-gtk/src/audioconf.c:637 +#: ../sflphone-gtk/src/config/audioconf.c:637 msgid "Pulseaudio" msgstr "Pulseaudio" -#: ../sflphone-gtk/src/audioconf.c:640 +#: ../sflphone-gtk/src/config/audioconf.c:640 msgid "ALSA" msgstr "ALSA" -#: ../sflphone-gtk/src/audioconf.c:666 +#: ../sflphone-gtk/src/config/audioconf.c:666 msgid "ALSA plugin" msgstr "ALSA插件" -#: ../sflphone-gtk/src/audioconf.c:688 +#: ../sflphone-gtk/src/config/audioconf.c:688 msgid "Output" msgstr "输出" -#: ../sflphone-gtk/src/audioconf.c:710 +#: ../sflphone-gtk/src/config/audioconf.c:710 msgid "Input" msgstr "输入" -#: ../sflphone-gtk/src/audioconf.c:743 +#: ../sflphone-gtk/src/config/audioconf.c:743 msgid "_Enable ringtones" msgstr "启用铃声(E)" -#: ../sflphone-gtk/src/audioconf.c:748 +#: ../sflphone-gtk/src/config/audioconf.c:748 msgid "Choose a ringtone" msgstr "选择铃声" -#: ../sflphone-gtk/src/audioconf.c:753 +#: ../sflphone-gtk/src/config/audioconf.c:753 msgid "Audio Files" msgstr "音频文件" -#: ../sflphone-gtk/src/audioconf.c:770 +#: ../sflphone-gtk/src/config/audioconf.c:770 msgid "_Activate silence detection" msgstr "启用静音检测(A)" -#: ../sflphone-gtk/src/audioconf.c:798 +#: ../sflphone-gtk/src/config/audioconf.c:798 msgid "Sound Manager" msgstr "音频管理器" -#: ../sflphone-gtk/src/audioconf.c:805 +#: ../sflphone-gtk/src/config/audioconf.c:805 msgid "ALSA configuration" msgstr "ALSA 配置" -#: ../sflphone-gtk/src/audioconf.c:815 +#: ../sflphone-gtk/src/config/audioconf.c:815 msgid "Codecs" msgstr "Codecs编码" -#: ../sflphone-gtk/src/audioconf.c:823 +#: ../sflphone-gtk/src/config/audioconf.c:823 msgid "Noise reduction" msgstr "降噪" -#: ../sflphone-gtk/src/audioconf.c:830 +#: ../sflphone-gtk/src/config/audioconf.c:830 msgid "Ringtones" msgstr "铃声" -#: ../sflphone-gtk/src/calltree.c:209 -#, c-format -msgid "\"Voicemail\" <%s>" -msgstr "\"语音邮件\" <%s>" - -#: ../sflphone-gtk/src/calltree.c:431 ../sflphone-gtk/src/calltree.c:433 -msgid "Place a call" -msgstr "拨号" - -#: ../sflphone-gtk/src/calltree.c:440 ../sflphone-gtk/src/calltree.c:442 -msgid "Pick up" -msgstr "接电话" - -#: ../sflphone-gtk/src/calltree.c:450 ../sflphone-gtk/src/calltree.c:452 -msgid "Hang up" -msgstr "放电话" - -#: ../sflphone-gtk/src/calltree.c:460 ../sflphone-gtk/src/calltree.c:462 -msgid "Off Hold" -msgstr "恢复通话" - -#: ../sflphone-gtk/src/calltree.c:471 ../sflphone-gtk/src/calltree.c:473 -msgid "On Hold" -msgstr "待机" - -#: ../sflphone-gtk/src/calltree.c:484 ../sflphone-gtk/src/calltree.c:486 -msgid "Transfer" -msgstr "转接" - -#: ../sflphone-gtk/src/calltree.c:496 ../sflphone-gtk/src/calltree.c:498 -msgid "History" -msgstr "历史" - -#: ../sflphone-gtk/src/calltree.c:506 ../sflphone-gtk/src/calltree.c:510 -msgid "Voicemail" -msgstr "语音信箱" - -#: ../sflphone-gtk/src/calltree.c:521 -#, fuzzy -msgid "Record a call" -msgstr "拨号" - -#: ../sflphone-gtk/src/configwindow.c:382 +#: ../sflphone-gtk/src/config/configwindow.c:385 msgid "Protocol" msgstr "协议" -#: ../sflphone-gtk/src/configwindow.c:389 +#: ../sflphone-gtk/src/config/configwindow.c:392 msgid "Status" msgstr "状态" -#: ../sflphone-gtk/src/configwindow.c:492 +#: ../sflphone-gtk/src/config/configwindow.c:495 msgid "Stun parameters will apply to each SIP account created." msgstr "Stun参数将应用于每一个注册的SIP帐户" -#: ../sflphone-gtk/src/configwindow.c:500 -#, fuzzy +#: ../sflphone-gtk/src/config/configwindow.c:503 msgid "Enable it if you are behind a firewall" -msgstr "当使用防火墙时,需设定STUN. 设置完毕后,请重新启动SFLphone" +msgstr "当使用防火墙时,启用该项" -#: ../sflphone-gtk/src/configwindow.c:508 +#: ../sflphone-gtk/src/config/configwindow.c:511 msgid "Format: name.server:port" msgstr "格式:name.server:port" -#: ../sflphone-gtk/src/configwindow.c:558 +#: ../sflphone-gtk/src/config/configwindow.c:561 msgid "Desktop Notification" msgstr "桌面提示" -#: ../sflphone-gtk/src/configwindow.c:566 +#: ../sflphone-gtk/src/config/configwindow.c:569 msgid "_Enable" msgstr "启用(E)" -#: ../sflphone-gtk/src/configwindow.c:571 +#: ../sflphone-gtk/src/config/configwindow.c:574 msgid "_Notify voice mails" msgstr "通知语音邮件(N)" -#: ../sflphone-gtk/src/configwindow.c:577 +#: ../sflphone-gtk/src/config/configwindow.c:580 msgid "System Tray Icon" msgstr "系统托盘图标" -#: ../sflphone-gtk/src/configwindow.c:585 +#: ../sflphone-gtk/src/config/configwindow.c:588 msgid "_Popup main window on incoming call" msgstr "来电时弹出主窗口(P)" -#: ../sflphone-gtk/src/configwindow.c:590 +#: ../sflphone-gtk/src/config/configwindow.c:593 msgid "Ne_ver popup main window" msgstr "从不弹出主窗口(v)" -#: ../sflphone-gtk/src/configwindow.c:594 +#: ../sflphone-gtk/src/config/configwindow.c:597 msgid "_Start hidden" msgstr "启动时隐藏(S)" -#: ../sflphone-gtk/src/configwindow.c:600 +#: ../sflphone-gtk/src/config/configwindow.c:603 msgid "Calls History" msgstr "拨号历史" -#: ../sflphone-gtk/src/configwindow.c:608 +#: ../sflphone-gtk/src/config/configwindow.c:611 msgid "_Maximum number of calls" msgstr "最大拨号数(M)" -#: ../sflphone-gtk/src/configwindow.c:624 +#: ../sflphone-gtk/src/config/configwindow.c:627 msgid "PulseAudio sound server" msgstr "PulseAudio服务器" -#: ../sflphone-gtk/src/configwindow.c:632 +#: ../sflphone-gtk/src/config/configwindow.c:635 msgid "_Control running applications volume" msgstr "控制正在运行的应用程序的音量(C)" -#: ../sflphone-gtk/src/configwindow.c:645 +#: ../sflphone-gtk/src/config/configwindow.c:648 msgid "SIP Port" msgstr "SIP端口号" -#: ../sflphone-gtk/src/configwindow.c:658 +#: ../sflphone-gtk/src/config/configwindow.c:661 msgid "Port:" msgstr "端口:" -#: ../sflphone-gtk/src/configwindow.c:703 -#, fuzzy +#: ../sflphone-gtk/src/config/configwindow.c:706 msgid "General" msgstr "常用配置" -#: ../sflphone-gtk/src/configwindow.c:714 +#: ../sflphone-gtk/src/config/configwindow.c:717 msgid "_Destination folder" msgstr "目标文件夹(D)" -#: ../sflphone-gtk/src/configwindow.c:719 +#: ../sflphone-gtk/src/config/configwindow.c:723 msgid "Select a folder" msgstr "选择文件夹" -#: ../sflphone-gtk/src/configwindow.c:744 +#: ../sflphone-gtk/src/config/configwindow.c:748 msgid "Preferences" msgstr "属性" -#: ../sflphone-gtk/src/configwindow.c:764 +#: ../sflphone-gtk/src/config/configwindow.c:768 msgid "General Settings" msgstr "常用配置" -#: ../sflphone-gtk/src/configwindow.c:769 +#: ../sflphone-gtk/src/config/configwindow.c:773 msgid "Audio Settings" msgstr "音频配置" -#: ../sflphone-gtk/src/configwindow.c:774 +#: ../sflphone-gtk/src/config/configwindow.c:778 msgid "Record" msgstr "记录" -#: ../sflphone-gtk/src/configwindow.c:798 +#: ../sflphone-gtk/src/config/configwindow.c:783 +msgid "Address Book" +msgstr "地址簿" + +#: ../sflphone-gtk/src/config/configwindow.c:788 +msgid "Hooks" +msgstr "钩键" + +#: ../sflphone-gtk/src/config/configwindow.c:814 msgid "Accounts" msgstr "帐户" -#: ../sflphone-gtk/src/configwindow.c:810 +#: ../sflphone-gtk/src/config/configwindow.c:826 msgid "Accounts previously setup" msgstr "以前帐户设置" -#: ../sflphone-gtk/src/errors.c:28 -msgid "" -"<b>ALSA notification</b>\n" -"\n" -"Error while opening playback device" -msgstr "" -"<b>ALSA提示</b>\n" -"\n" -"打开回放设备时出错" - -#: ../sflphone-gtk/src/errors.c:31 -msgid "" -"<b>ALSA notification</b>\n" -"\n" -"Error while opening capture device" -msgstr "" -"<b>ALSA提示</b>\n" -"\n" -"打开采集设备时出错" +#: ../sflphone-gtk/src/config/hooks-config.c:92 +msgid "URL argument" +msgstr "URL参数" -#: ../sflphone-gtk/src/errors.c:34 -msgid "" -"<b>Pulseaudio notification</b>\n" -"\n" -"Pulseaudio is not running" -msgstr "" +#: ../sflphone-gtk/src/config/hooks-config.c:102 +msgid "_SIP protocol" +msgstr "SIP 协议(S)" -#: ../sflphone-gtk/src/historyfilter.c:49 -#: ../sflphone-gtk/src/historyfilter.c:68 -#: ../sflphone-gtk/src/historyfilter.c:83 -msgid "Search" -msgstr "查找" +#: ../sflphone-gtk/src/config/hooks-config.c:107 +msgid "_IAX2 protocol" +msgstr "IAX2 协议(I)" -#: ../sflphone-gtk/src/mainwindow.c:69 -#, fuzzy -msgid "There is one call in progress." -msgstr "" -"<b>有一个电话正在处理</b>\n" -"确定要退出?" +#: ../sflphone-gtk/src/config/hooks-config.c:113 +msgid "_SIP Header: " +msgstr "SIP消息头(S):" -#: ../sflphone-gtk/src/mainwindow.c:73 -#, fuzzy -msgid "There are calls in progress." -msgstr "" -"<b>有电话正在处理中</b>\n" -"确定要退出?" +#: ../sflphone-gtk/src/config/hooks-config.c:120 +msgid "_Command: " +msgstr "命令(C):" -#: ../sflphone-gtk/src/mainwindow.c:82 -msgid "Do you still want to quit?" -msgstr "确认要退出?" +#~ msgid "SFLphone 0.9.3" +#~ msgstr "SFLphone 0.9.2" -#: ../sflphone-gtk/src/menus.c:135 -msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." -msgstr "SFLphone是一个VoIP客户端,它兼容SIP和IAX2协议." - -#: ../sflphone-gtk/src/menus.c:138 -msgid "About SFLphone" -msgstr "关于SFLphone" - -#: ../sflphone-gtk/src/menus.c:161 -msgid "_Help" -msgstr "帮助(H)" - -#: ../sflphone-gtk/src/menus.c:278 -msgid "_New call" -msgstr "新电话(N)" - -#: ../sflphone-gtk/src/menus.c:290 ../sflphone-gtk/src/menus.c:760 -msgid "_Pick up" -msgstr "拨出(P)" - -#: ../sflphone-gtk/src/menus.c:300 ../sflphone-gtk/src/menus.c:772 -msgid "_Hang up" -msgstr "放下(H)" - -#: ../sflphone-gtk/src/menus.c:310 ../sflphone-gtk/src/menus.c:784 -msgid "On _Hold" -msgstr "保持(H)" - -#: ../sflphone-gtk/src/menus.c:326 -msgid "_Account Assistant" -msgstr "帐户向导(A)" - -#: ../sflphone-gtk/src/menus.c:356 -msgid "_Call" -msgstr "电话" - -#: ../sflphone-gtk/src/menus.c:529 -msgid "_Clear history" -msgstr "清空历史记录(C)" - -#: ../sflphone-gtk/src/menus.c:541 -msgid "_Accounts" -msgstr "帐户(A)" - -#: ../sflphone-gtk/src/menus.c:556 -msgid "_Edit" -msgstr "编辑(E)" - -#: ../sflphone-gtk/src/menus.c:616 -msgid "_Dialpad" -msgstr "拨号面板" - -#: ../sflphone-gtk/src/menus.c:628 -msgid "_Volume controls" -msgstr "音量控制(V)" - -#: ../sflphone-gtk/src/menus.c:637 -msgid "_Search history" -msgstr "查找历史(S)" - -#: ../sflphone-gtk/src/menus.c:645 -msgid "_View" -msgstr "查看(V)" - -#: ../sflphone-gtk/src/menus.c:867 -msgid "_Call back" -msgstr "回叫(C)" - -#: ../sflphone-gtk/src/sflnotify.c:34 ../sflphone-gtk/src/sflnotify.c:100 -#, c-format -msgid "%s account: %s" -msgstr "%s 帐户: %s" - -#: ../sflphone-gtk/src/sflnotify.c:37 -#, c-format -msgid "<i>From:</i> %s" -msgstr "<i>拨入方:</i> %s" - -#: ../sflphone-gtk/src/sflnotify.c:52 -msgid "Accept" -msgstr "接受" - -#: ../sflphone-gtk/src/sflnotify.c:53 -msgid "Refuse" -msgstr "拒绝" - -#: ../sflphone-gtk/src/sflnotify.c:54 ../sflphone-gtk/src/sflnotify.c:117 -#: ../sflphone-gtk/src/sflnotify.c:154 -msgid "Ignore" -msgstr "忽略" - -#: ../sflphone-gtk/src/sflnotify.c:136 -#, c-format -msgid "Calling with %s account <i>%s</i>" -msgstr "使用%s帐户<i>%s</i>呼叫" - -#: ../sflphone-gtk/src/sflnotify.c:140 -msgid "Current account" -msgstr "当前帐户" - -#: ../sflphone-gtk/src/sflnotify.c:169 -msgid "You haven't setup any accounts" -msgstr "你没有设置任何帐户" - -#: ../sflphone-gtk/src/sflnotify.c:185 ../sflphone-gtk/src/sflnotify.c:224 -msgid "Setup Accounts" -msgstr "设定帐户" - -#: ../sflphone-gtk/src/sflnotify.c:208 -msgid "You have no registered accounts" -msgstr "未发现已注册帐户" - -#: ../sflphone-gtk/src/sliders.c:161 -msgid "Speakers volume" -msgstr "扬声器音量" - -#: ../sflphone-gtk/src/sliders.c:163 -msgid "Mic volume" -msgstr "话筒音量" - -#: ../sflphone-gtk/src/statusicon.c:91 -msgid "_Show main window" -msgstr "显示主窗口(S)" - -#: ../sflphone-gtk/src/statusicon.c:124 -#, c-format -msgid "SFLphone - %i accounts registered" -msgstr "SFLphone - %i 个帐户已注册" - -#: ../sflphone-gtk/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "<small>未接电话</small>" - -#: ../sflphone-gtk/src/timestamp.c:64 -#, c-format -msgid "<small>Duration:</small> %s" -msgstr "<small>时长:</small> %s" +#~ msgid "Setup Accounts" +#~ msgstr "设定帐户" #~ msgid "_STUN Server" #~ msgstr "STUN服务器(S)" @@ -655,3 +734,4 @@ msgstr "<small>时长:</small> %s" #~ msgid "History empty" #~ msgstr "无历史记录" + diff --git a/po/zh_HK.po b/po/zh_HK.po index a395aacf3c2c11a7b679d564dd33cbd998b3e5c2..eebc77122fa5cb383ef1f48eb494d5db15225de3 100644 --- a/po/zh_HK.po +++ b/po/zh_HK.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: SFLphone 0.9.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-02-10 15:24-0500\n" +"POT-Creation-Date: 2009-04-02 11:15-0400\n" "PO-Revision-Date: 2008-10-28 14:15\n" "Last-Translator: Yun Liu <yun.liu@savoirfairelinux.com>\n" "Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" @@ -30,7 +30,7 @@ msgid "Trying..." msgstr "正在連接..." #: ../sflphone-gtk/src/accountlist.c:167 ../sflphone-gtk/src/sflnotify.c:171 -#: ../sflphone-gtk/src/sflnotify.c:210 +#: ../sflphone-gtk/src/sflnotify.c:212 msgid "Error" msgstr "註冊失敗" @@ -47,7 +47,6 @@ msgid "Host unreachable" msgstr "伺服器連線失敗" #: ../sflphone-gtk/src/accountlist.c:179 -#, fuzzy msgid "Stun configuration error" msgstr "Stun配置有誤" @@ -59,66 +58,22 @@ msgstr "Stun伺服器無效" msgid "Invalid" msgstr "無效" -#: ../sflphone-gtk/src/accountwindow.c:109 -msgid "Account settings" -msgstr "帳戶設置" - -#: ../sflphone-gtk/src/accountwindow.c:121 -msgid "Account parameters" -msgstr "帳戶相關參數" - -#: ../sflphone-gtk/src/accountwindow.c:143 -msgid "_Enabled" -msgstr "啟用(E)" - -#: ../sflphone-gtk/src/accountwindow.c:149 ../sflphone-gtk/src/assistant.c:238 -#: ../sflphone-gtk/src/assistant.c:292 -msgid "_Alias" -msgstr "別稱(A)" - -#: ../sflphone-gtk/src/accountwindow.c:157 -msgid "_Protocol" -msgstr "協議(P)" - -#: ../sflphone-gtk/src/accountwindow.c:175 -msgid "Unknown" -msgstr "未知" - -#: ../sflphone-gtk/src/accountwindow.c:185 ../sflphone-gtk/src/assistant.c:246 -#: ../sflphone-gtk/src/assistant.c:300 -msgid "_Host name" -msgstr "主机名稱(H)" - -#: ../sflphone-gtk/src/accountwindow.c:193 ../sflphone-gtk/src/assistant.c:254 -#: ../sflphone-gtk/src/assistant.c:308 -msgid "_User name" -msgstr "使用者名稱(U)" - -#: ../sflphone-gtk/src/accountwindow.c:204 ../sflphone-gtk/src/assistant.c:264 -#: ../sflphone-gtk/src/assistant.c:318 -msgid "_Password" -msgstr "密碼(P)" - -#: ../sflphone-gtk/src/accountwindow.c:215 -msgid "_Voicemail box #" -msgstr "語音郵箱(V)" - -#: ../sflphone-gtk/src/actions.c:57 ../sflphone-gtk/src/sflnotify.c:103 +#: ../sflphone-gtk/src/actions.c:55 ../sflphone-gtk/src/sflnotify.c:103 #, c-format msgid "%d voice mails" msgstr "%d 個語音郵件" -#: ../sflphone-gtk/src/actions.c:59 +#: ../sflphone-gtk/src/actions.c:57 #, c-format msgid "%d voice mail" msgstr "%d 個語音郵件" -#: ../sflphone-gtk/src/actions.c:80 +#: ../sflphone-gtk/src/actions.c:81 #, c-format msgid "%s account- %s" msgstr "%s 帳戶- %s" -#: ../sflphone-gtk/src/actions.c:224 +#: ../sflphone-gtk/src/actions.c:225 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -126,7 +81,11 @@ msgstr "" "連接SFLphone伺服器失敗.\n" "請核查daemon是否正在運行." -#: ../sflphone-gtk/src/actions.c:798 +#: ../sflphone-gtk/src/actions.c:764 +msgid "%s account- %s %s" +msgstr "%s 帳戶- %s %s" + +#: ../sflphone-gtk/src/actions.c:861 #, c-format msgid "" "<b>Error: No audio codecs found.\n" @@ -139,46 +98,58 @@ msgstr "" "</b> SFL聲音編碼檔案應該位于<i>%s</i> 或者位于主目錄( <i>%s</i> )的<b>." "sflphone</b>目錄下" -#: ../sflphone-gtk/src/assistant.c:148 +#: ../sflphone-gtk/src/assistant.c:31 +msgid "" +"This assistant is now finished.\n" +"You can at any time check your registration state or modify your accounts " +"parameters in the Options/Accounts window.\n" +"\n" +"Alias : %s\n" +"Server : %s\n" +"Username : %s\n" +"Password : %s" +msgstr "" +"配置完成.\n" +"你可以隨時在 選項/帳戶 中查看註冊狀態或者修改帳戶信息" +"\n" +"別稱: %s\n" +"伺服器: %s\n" +"使用者名稱: %s\n" +"密碼: %s" + +#: ../sflphone-gtk/src/assistant.c:154 msgid "SFLphone account configuration wizard" msgstr "SFLphone 帳戶設置向導" -#: ../sflphone-gtk/src/assistant.c:176 -#, fuzzy -msgid "SFLphone 0.9.2" -msgstr "SFLphone 0.9.2" - -#: ../sflphone-gtk/src/assistant.c:176 +#: ../sflphone-gtk/src/assistant.c:180 msgid "Welcome to SFLphone!" msgstr "歡迎使用SFLphone!" -#: ../sflphone-gtk/src/assistant.c:178 +#: ../sflphone-gtk/src/assistant.c:181 msgid "This installation wizard will help you configure an account." msgstr "安裝向導將幫助您配置帳戶" -#: ../sflphone-gtk/src/assistant.c:193 +#: ../sflphone-gtk/src/assistant.c:195 msgid "VoIP Protocols" msgstr "VoIP協議" -#: ../sflphone-gtk/src/assistant.c:193 +#: ../sflphone-gtk/src/assistant.c:195 msgid "Select an account type:" msgstr "選擇帳戶類型:" -#: ../sflphone-gtk/src/assistant.c:211 -#, fuzzy +#: ../sflphone-gtk/src/assistant.c:213 msgid "Account" msgstr "帳戶" -#: ../sflphone-gtk/src/assistant.c:211 -#, fuzzy +#: ../sflphone-gtk/src/assistant.c:213 msgid "Please select one of the following option:" -msgstr "請填寫如下信息:" +msgstr "請選擇以下選項中的一個:" -#: ../sflphone-gtk/src/assistant.c:213 +#: ../sflphone-gtk/src/assistant.c:215 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "在sflphone.org上創建免費的SIP/IAX2帳戶" -#: ../sflphone-gtk/src/assistant.c:215 +#: ../sflphone-gtk/src/assistant.c:217 msgid "Register an existing SIP or IAX2 account" msgstr "註冊已存在的SIP或IAX2帳戶" @@ -186,466 +157,575 @@ msgstr "註冊已存在的SIP或IAX2帳戶" msgid "SIP account configuration" msgstr "SIP帳戶配置" -#: ../sflphone-gtk/src/assistant.c:230 ../sflphone-gtk/src/assistant.c:284 +#: ../sflphone-gtk/src/assistant.c:230 ../sflphone-gtk/src/assistant.c:305 msgid "Please fill the following information:" msgstr "請填寫如下信息:" -#: ../sflphone-gtk/src/assistant.c:284 +#: ../sflphone-gtk/src/assistant.c:238 ../sflphone-gtk/src/assistant.c:313 +#: ../sflphone-gtk/src/config/accountwindow.c:143 +msgid "_Alias" +msgstr "別稱(A)" + +#: ../sflphone-gtk/src/assistant.c:246 ../sflphone-gtk/src/assistant.c:321 +#: ../sflphone-gtk/src/config/accountwindow.c:179 +msgid "_Host name" +msgstr "主机名稱(H)" + +#: ../sflphone-gtk/src/assistant.c:254 ../sflphone-gtk/src/assistant.c:329 +#: ../sflphone-gtk/src/config/accountwindow.c:187 +msgid "_User name" +msgstr "使用者名稱(U)" + +#: ../sflphone-gtk/src/assistant.c:264 ../sflphone-gtk/src/assistant.c:339 +#: ../sflphone-gtk/src/config/accountwindow.c:198 +msgid "_Password" +msgstr "密碼(P)" + +#: ../sflphone-gtk/src/assistant.c:282 +msgid "Optional Email Address " +msgstr "可選郵件地址 " + +#: ../sflphone-gtk/src/assistant.c:282 +msgid "This email address will be use to send your voicemail messages" +msgstr "這個郵件地址將被用來發送您的語音郵箱消息" + +#: ../sflphone-gtk/src/assistant.c:290 +msgid "_Email" +msgstr "郵件(E)" + +#: ../sflphone-gtk/src/assistant.c:305 msgid "IAX2 account configuration" msgstr "IAX2帳戶配置" -#: ../sflphone-gtk/src/assistant.c:341 ../sflphone-gtk/src/configwindow.c:821 +#: ../sflphone-gtk/src/assistant.c:360 +#: ../sflphone-gtk/src/config/configwindow.c:837 msgid "Network Address Translation" msgstr "網路地址分析" -#: ../sflphone-gtk/src/assistant.c:341 +#: ../sflphone-gtk/src/assistant.c:360 msgid "You should probably enable this if you are behind a firewall." -msgstr "如果你的網路防火牆,你很有可能需要設定該項." +msgstr "如果你使用網路防火牆,你很有可能需要設定該項." -#: ../sflphone-gtk/src/assistant.c:350 ../sflphone-gtk/src/configwindow.c:496 +#: ../sflphone-gtk/src/assistant.c:369 +#: ../sflphone-gtk/src/config/configwindow.c:499 msgid "E_nable STUN" msgstr "啟用STUN(n)" -#: ../sflphone-gtk/src/assistant.c:357 +#: ../sflphone-gtk/src/assistant.c:376 msgid "_STUN server" msgstr "STUN伺服器(S)" -#: ../sflphone-gtk/src/assistant.c:374 +#: ../sflphone-gtk/src/assistant.c:390 msgid "Account Registration" msgstr "帳戶註冊" -#: ../sflphone-gtk/src/assistant.c:374 +#: ../sflphone-gtk/src/assistant.c:390 msgid "Congratulations!" msgstr "恭喜!" -#: ../sflphone-gtk/src/assistant.c:376 +#: ../sflphone-gtk/src/context-menu.c:296 ../sflphone-gtk/src/menus.c:308 +#: ../sflphone-gtk/src/menus.c:791 +msgid "_Pick up" +msgstr "撥出(P)" + +#: ../sflphone-gtk/src/context-menu.c:308 ../sflphone-gtk/src/menus.c:318 +#: ../sflphone-gtk/src/menus.c:803 +msgid "_Hang up" +msgstr "放下(H)" + +#: ../sflphone-gtk/src/context-menu.c:320 ../sflphone-gtk/src/menus.c:328 +#: ../sflphone-gtk/src/menus.c:815 +msgid "On _Hold" +msgstr "待机" + +#: ../sflphone-gtk/src/context-menu.c:332 ../sflphone-gtk/src/menus.c:340 +#: ../sflphone-gtk/src/menus.c:827 +msgid "_Record" +msgstr "記錄(R)" + +#: ../sflphone-gtk/src/errors.c:28 msgid "" -"This assistant is now finished.\n" +"<b>ALSA notification</b>\n" "\n" -" You can at any time check your registration state or modify your accounts " -"parameters in the Options/Accounts window." +"Error while opening playback device" msgstr "" -"配置完成.\n" +"<b>ALSA提示</b>\n" "\n" -"你可以隨時在 選項/帳戶 中查看註冊狀態或者修改帳戶信息" +"打開回放設備時出錯" + +#: ../sflphone-gtk/src/errors.c:31 +msgid "" +"<b>ALSA notification</b>\n" +"\n" +"Error while opening capture device" +msgstr "" +"<b>ALSA提示</b>\n" +"\n" +"打開采集設備時出錯" + +#: ../sflphone-gtk/src/errors.c:34 +msgid "" +"<b>Pulseaudio notification</b>\n" +"\n" +"Pulseaudio is not running" +msgstr "" + +#: ../sflphone-gtk/src/mainwindow.c:70 +msgid "There is one call in progress." +msgstr "有一個電話正在處理中." + +#: ../sflphone-gtk/src/mainwindow.c:74 +msgid "There are calls in progress." +msgstr "有電話正在處理中." + +#: ../sflphone-gtk/src/mainwindow.c:83 +msgid "Do you still want to quit?" +msgstr "確認要退出?" + +#: ../sflphone-gtk/src/menus.c:131 +msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." +msgstr "SFLphone是一個VoIP客戶端,它兼容SIP和IAX2协议." -#: ../sflphone-gtk/src/audioconf.c:154 +#: ../sflphone-gtk/src/menus.c:134 +msgid "About SFLphone" +msgstr "有關SFLphone" + +#: ../sflphone-gtk/src/menus.c:157 +msgid "_Help" +msgstr "幫助(H)" + +#: ../sflphone-gtk/src/menus.c:296 ../sflphone-gtk/src/menus.c:949 +msgid "_New call" +msgstr "新電話(N)" + +#: ../sflphone-gtk/src/menus.c:354 +msgid "_Account Assistant" +msgstr "帳戶向導(A)" + +#: ../sflphone-gtk/src/menus.c:384 +msgid "_Call" +msgstr "電話" + +#: ../sflphone-gtk/src/menus.c:557 +msgid "_Clear history" +msgstr "清空曆史記錄(C)" + +#: ../sflphone-gtk/src/menus.c:569 +msgid "_Accounts" +msgstr "帳戶(A)" + +#: ../sflphone-gtk/src/menus.c:584 +msgid "_Edit" +msgstr "編輯(E)" + +#: ../sflphone-gtk/src/menus.c:644 +msgid "_Dialpad" +msgstr "撥號面板" + +#: ../sflphone-gtk/src/menus.c:656 +msgid "_Volume controls" +msgstr "音量控制(V)" + +#: ../sflphone-gtk/src/menus.c:665 +msgid "_Search contact" +msgstr "搜尋歷史(S)" + +#: ../sflphone-gtk/src/menus.c:673 +msgid "_View" +msgstr "查看(V)" + +#: ../sflphone-gtk/src/menus.c:885 +msgid "_Call back" +msgstr "回叫(C)" + +#: ../sflphone-gtk/src/sflnotify.c:34 ../sflphone-gtk/src/sflnotify.c:100 +#, c-format +msgid "%s account: %s" +msgstr "%s 帳戶: %s" + +#: ../sflphone-gtk/src/sflnotify.c:37 +#, c-format +msgid "<i>From:</i> %s" +msgstr "<i>撥入方:</i> %s" + +#: ../sflphone-gtk/src/sflnotify.c:52 +msgid "Accept" +msgstr "接受" + +#: ../sflphone-gtk/src/sflnotify.c:53 +msgid "Refuse" +msgstr "拒絕" + +#: ../sflphone-gtk/src/sflnotify.c:54 ../sflphone-gtk/src/sflnotify.c:117 +#: ../sflphone-gtk/src/sflnotify.c:154 +msgid "Ignore" +msgstr "忽略" + +#: ../sflphone-gtk/src/sflnotify.c:136 +#, c-format +msgid "Calling with %s account <i>%s</i>" +msgstr "使用%s帳戶<i>%s</i>呼叫" + +#: ../sflphone-gtk/src/sflnotify.c:140 +msgid "Current account" +msgstr "當前帳戶" + +#: ../sflphone-gtk/src/sflnotify.c:169 +msgid "You haven't setup any accounts" +msgstr "你沒有設置任何帳戶" + +#: ../sflphone-gtk/src/sflnotify.c:209 +msgid "You have no registered accounts" +msgstr "未發現已註冊帳戶" + +#: ../sflphone-gtk/src/sliders.c:161 +msgid "Speakers volume" +msgstr "揚聲器音量" + +#: ../sflphone-gtk/src/sliders.c:163 +msgid "Mic volume" +msgstr "話筒音量" + +#: ../sflphone-gtk/src/statusicon.c:91 +msgid "_Show main window" +msgstr "顯示主窗口(S)" + +#: ../sflphone-gtk/src/statusicon.c:124 +#, c-format +msgid "SFLphone - %i accounts registered" +msgstr "SFLphone - %i 個帳戶已註冊" + +#: ../sflphone-gtk/src/timestamp.c:46 +msgid "<small>Missed call</small>" +msgstr "<small>未接電話</small>" + +#: ../sflphone-gtk/src/timestamp.c:64 +#, c-format +msgid "<small>Duration:</small> %s" +msgstr "<small>時長:</small> %s" + +#: ../sflphone-gtk/src/toolbar.c:49 +#, c-format +msgid "\"Voicemail\" <%s>" +msgstr "\"語音郵件\" <%s>" + +#: ../sflphone-gtk/src/toolbar.c:175 ../sflphone-gtk/src/toolbar.c:177 +msgid "Place a call" +msgstr "打電話" + +#: ../sflphone-gtk/src/toolbar.c:184 ../sflphone-gtk/src/toolbar.c:186 +msgid "Pick up" +msgstr "接電話" + +#: ../sflphone-gtk/src/toolbar.c:194 ../sflphone-gtk/src/toolbar.c:196 +msgid "Hang up" +msgstr "放電話" + +#: ../sflphone-gtk/src/toolbar.c:204 ../sflphone-gtk/src/toolbar.c:206 +msgid "Off Hold" +msgstr "恢复通話" + +#: ../sflphone-gtk/src/toolbar.c:215 ../sflphone-gtk/src/toolbar.c:217 +msgid "On Hold" +msgstr "待机" + +#: ../sflphone-gtk/src/toolbar.c:228 ../sflphone-gtk/src/toolbar.c:230 +msgid "Transfer" +msgstr "轉接" + +#: ../sflphone-gtk/src/toolbar.c:240 ../sflphone-gtk/src/toolbar.c:242 +msgid "History" +msgstr "歷史" + +#: ../sflphone-gtk/src/toolbar.c:251 ../sflphone-gtk/src/toolbar.c:253 +msgid "Address book" +msgstr "地址簿" + +#: ../sflphone-gtk/src/toolbar.c:258 ../sflphone-gtk/src/toolbar.c:262 +msgid "Voicemail" +msgstr "語音郵件" + +#: ../sflphone-gtk/src/toolbar.c:270 +msgid "Record a call" +msgstr "記錄通話" + +#: ../sflphone-gtk/src/contacts/history.c:75 +#: ../sflphone-gtk/src/contacts/searchbar.c:39 +#: ../sflphone-gtk/src/contacts/searchbar.c:65 +msgid "Search" +msgstr "搜尋" + +#: ../sflphone-gtk/src/config/accountwindow.c:103 +msgid "Account settings" +msgstr "帳戶設置" + +#: ../sflphone-gtk/src/config/accountwindow.c:115 +msgid "Account parameters" +msgstr "帳戶相關參數" + +#: ../sflphone-gtk/src/config/accountwindow.c:137 +msgid "_Enabled" +msgstr "啟用(E)" + +#: ../sflphone-gtk/src/config/accountwindow.c:151 +msgid "_Protocol" +msgstr "協議(P)" + +#: ../sflphone-gtk/src/config/accountwindow.c:169 +msgid "Unknown" +msgstr "未知" + +#: ../sflphone-gtk/src/config/accountwindow.c:209 +msgid "_Voicemail box #" +msgstr "語音郵箱(V)" + +#: ../sflphone-gtk/src/config/addressbook-config.c:105 +msgid "Search Parameters" +msgstr "搜尋相關參數" + +#: ../sflphone-gtk/src/config/addressbook-config.c:116 +msgid "Maximum result number for a request: " +msgstr "最大打出電話數目" + +#: ../sflphone-gtk/src/config/addressbook-config.c:127 +msgid "_Display contact photo if available" +msgstr "如果可以則顯示聯繫人照片(D)" + +#: ../sflphone-gtk/src/config/addressbook-config.c:132 +msgid "Search for and display: " +msgstr "搜尋並顯示:" + +#: ../sflphone-gtk/src/config/addressbook-config.c:135 +msgid "_Business phone" +msgstr "商務電話(B)" + +#: ../sflphone-gtk/src/config/addressbook-config.c:140 +msgid "_Home phone" +msgstr "家庭電話(H)" + +#: ../sflphone-gtk/src/config/addressbook-config.c:145 +msgid "_Mobile phone" +msgstr "移動電話(M)" + +#: ../sflphone-gtk/src/config/audioconf.c:154 #, c-format msgid "audio device index for output = %d\n" msgstr "音訊設備索引輸出 = %d\n" -#: ../sflphone-gtk/src/audioconf.c:562 +#: ../sflphone-gtk/src/config/audioconf.c:562 msgid "Name" msgstr "名稱" -#: ../sflphone-gtk/src/audioconf.c:567 +#: ../sflphone-gtk/src/config/audioconf.c:567 msgid "Frequency" msgstr "顰律" -#: ../sflphone-gtk/src/audioconf.c:572 +#: ../sflphone-gtk/src/config/audioconf.c:572 msgid "Bitrate" msgstr "比率" -#: ../sflphone-gtk/src/audioconf.c:577 +#: ../sflphone-gtk/src/config/audioconf.c:577 msgid "Bandwidth" msgstr "顰寬" -#: ../sflphone-gtk/src/audioconf.c:637 +#: ../sflphone-gtk/src/config/audioconf.c:637 msgid "Pulseaudio" msgstr "Pulseaudio" -#: ../sflphone-gtk/src/audioconf.c:640 +#: ../sflphone-gtk/src/config/audioconf.c:640 msgid "ALSA" msgstr "ALSA" -#: ../sflphone-gtk/src/audioconf.c:666 +#: ../sflphone-gtk/src/config/audioconf.c:666 msgid "ALSA plugin" msgstr "ALSA插件" -#: ../sflphone-gtk/src/audioconf.c:688 +#: ../sflphone-gtk/src/config/audioconf.c:688 msgid "Output" msgstr "輸出" -#: ../sflphone-gtk/src/audioconf.c:710 +#: ../sflphone-gtk/src/config/audioconf.c:710 msgid "Input" msgstr "輸入" -#: ../sflphone-gtk/src/audioconf.c:743 +#: ../sflphone-gtk/src/config/audioconf.c:743 msgid "_Enable ringtones" msgstr "啟動鈴聲(E)" -#: ../sflphone-gtk/src/audioconf.c:748 +#: ../sflphone-gtk/src/config/audioconf.c:748 msgid "Choose a ringtone" msgstr "鈴聲選擇" -#: ../sflphone-gtk/src/audioconf.c:753 +#: ../sflphone-gtk/src/config/audioconf.c:753 msgid "Audio Files" msgstr "音訊檔案" -#: ../sflphone-gtk/src/audioconf.c:770 +#: ../sflphone-gtk/src/config/audioconf.c:770 msgid "_Activate silence detection" msgstr "啟用靜音檢測(A)" -#: ../sflphone-gtk/src/audioconf.c:798 +#: ../sflphone-gtk/src/config/audioconf.c:798 msgid "Sound Manager" msgstr "聲音管理器" -#: ../sflphone-gtk/src/audioconf.c:805 +#: ../sflphone-gtk/src/config/audioconf.c:805 msgid "ALSA configuration" msgstr "ALSA 配置" -#: ../sflphone-gtk/src/audioconf.c:815 +#: ../sflphone-gtk/src/config/audioconf.c:815 msgid "Codecs" msgstr "編碼" -#: ../sflphone-gtk/src/audioconf.c:823 +#: ../sflphone-gtk/src/config/audioconf.c:823 msgid "Noise reduction" msgstr "降噪" -#: ../sflphone-gtk/src/audioconf.c:830 +#: ../sflphone-gtk/src/config/audioconf.c:830 msgid "Ringtones" msgstr "鈴聲" -#: ../sflphone-gtk/src/calltree.c:209 -#, c-format -msgid "\"Voicemail\" <%s>" -msgstr "\"語音郵件\" <%s>" - -#: ../sflphone-gtk/src/calltree.c:431 ../sflphone-gtk/src/calltree.c:433 -msgid "Place a call" -msgstr "打電話" - -#: ../sflphone-gtk/src/calltree.c:440 ../sflphone-gtk/src/calltree.c:442 -msgid "Pick up" -msgstr "接電話" - -#: ../sflphone-gtk/src/calltree.c:450 ../sflphone-gtk/src/calltree.c:452 -msgid "Hang up" -msgstr "放電話" - -#: ../sflphone-gtk/src/calltree.c:460 ../sflphone-gtk/src/calltree.c:462 -msgid "Off Hold" -msgstr "恢复通話" - -#: ../sflphone-gtk/src/calltree.c:471 ../sflphone-gtk/src/calltree.c:473 -msgid "On Hold" -msgstr "待机" - -#: ../sflphone-gtk/src/calltree.c:484 ../sflphone-gtk/src/calltree.c:486 -msgid "Transfer" -msgstr "轉接" - -#: ../sflphone-gtk/src/calltree.c:496 ../sflphone-gtk/src/calltree.c:498 -msgid "History" -msgstr "歷史" - -#: ../sflphone-gtk/src/calltree.c:506 ../sflphone-gtk/src/calltree.c:510 -msgid "Voicemail" -msgstr "語音郵件" - -#: ../sflphone-gtk/src/calltree.c:521 -#, fuzzy -msgid "Record a call" -msgstr "打電話" - -#: ../sflphone-gtk/src/configwindow.c:382 +#: ../sflphone-gtk/src/config/configwindow.c:385 msgid "Protocol" msgstr "協議" -#: ../sflphone-gtk/src/configwindow.c:389 +#: ../sflphone-gtk/src/config/configwindow.c:392 msgid "Status" msgstr "狀態" -#: ../sflphone-gtk/src/configwindow.c:492 +#: ../sflphone-gtk/src/config/configwindow.c:495 msgid "Stun parameters will apply to each SIP account created." msgstr "Stun參數將應用於每一個註冊的SIP帳戶" -#: ../sflphone-gtk/src/configwindow.c:500 -#, fuzzy +#: ../sflphone-gtk/src/config/configwindow.c:503 msgid "Enable it if you are behind a firewall" -msgstr "當使用防火牆時,需要設定STUN. 完成設定后,請重新啟動SFLphone" +msgstr "當使用防火牆時,需要設定此項" -#: ../sflphone-gtk/src/configwindow.c:508 +#: ../sflphone-gtk/src/config/configwindow.c:511 msgid "Format: name.server:port" msgstr "格式:name.server:port" -#: ../sflphone-gtk/src/configwindow.c:558 +#: ../sflphone-gtk/src/config/configwindow.c:561 msgid "Desktop Notification" msgstr "桌面提示" -#: ../sflphone-gtk/src/configwindow.c:566 +#: ../sflphone-gtk/src/config/configwindow.c:569 msgid "_Enable" msgstr "啟用(E)" -#: ../sflphone-gtk/src/configwindow.c:571 +#: ../sflphone-gtk/src/config/configwindow.c:574 msgid "_Notify voice mails" msgstr "語音郵件通知(N)" -#: ../sflphone-gtk/src/configwindow.c:577 +#: ../sflphone-gtk/src/config/configwindow.c:580 msgid "System Tray Icon" msgstr "系統托盤圖標" -#: ../sflphone-gtk/src/configwindow.c:585 +#: ../sflphone-gtk/src/config/configwindow.c:588 msgid "_Popup main window on incoming call" msgstr "來電話時彈出主視窗(P)" -#: ../sflphone-gtk/src/configwindow.c:590 +#: ../sflphone-gtk/src/config/configwindow.c:593 msgid "Ne_ver popup main window" msgstr "從不彈出主視窗(v)" -#: ../sflphone-gtk/src/configwindow.c:594 +#: ../sflphone-gtk/src/config/configwindow.c:597 msgid "_Start hidden" msgstr "啟動時隱藏(S)" -#: ../sflphone-gtk/src/configwindow.c:600 +#: ../sflphone-gtk/src/config/configwindow.c:603 msgid "Calls History" msgstr "打電話歷史" -#: ../sflphone-gtk/src/configwindow.c:608 +#: ../sflphone-gtk/src/config/configwindow.c:611 msgid "_Maximum number of calls" msgstr "最大打出電話數目(M)" -#: ../sflphone-gtk/src/configwindow.c:624 +#: ../sflphone-gtk/src/config/configwindow.c:627 msgid "PulseAudio sound server" msgstr "PulseAudio聲音伺服器" -#: ../sflphone-gtk/src/configwindow.c:632 +#: ../sflphone-gtk/src/config/configwindow.c:635 msgid "_Control running applications volume" msgstr "控制正在運行中的應用程式的音量(C)" -#: ../sflphone-gtk/src/configwindow.c:645 +#: ../sflphone-gtk/src/config/configwindow.c:648 msgid "SIP Port" msgstr "SIP端口" -#: ../sflphone-gtk/src/configwindow.c:658 +#: ../sflphone-gtk/src/config/configwindow.c:661 msgid "Port:" msgstr "端口:" -#: ../sflphone-gtk/src/configwindow.c:703 -#, fuzzy +#: ../sflphone-gtk/src/config/configwindow.c:706 msgid "General" msgstr "常用配置" -#: ../sflphone-gtk/src/configwindow.c:714 +#: ../sflphone-gtk/src/config/configwindow.c:717 msgid "_Destination folder" msgstr "目標文件夾(D)" -#: ../sflphone-gtk/src/configwindow.c:719 +#: ../sflphone-gtk/src/config/configwindow.c:723 msgid "Select a folder" msgstr "選擇文件夾" -#: ../sflphone-gtk/src/configwindow.c:744 +#: ../sflphone-gtk/src/config/configwindow.c:748 msgid "Preferences" msgstr "屬性" -#: ../sflphone-gtk/src/configwindow.c:764 +#: ../sflphone-gtk/src/config/configwindow.c:768 msgid "General Settings" msgstr "常用配置" -#: ../sflphone-gtk/src/configwindow.c:769 +#: ../sflphone-gtk/src/config/configwindow.c:773 msgid "Audio Settings" msgstr "音訊配置" -#: ../sflphone-gtk/src/configwindow.c:774 +#: ../sflphone-gtk/src/config/configwindow.c:778 msgid "Record" msgstr "記錄" -#: ../sflphone-gtk/src/configwindow.c:798 +#: ../sflphone-gtk/src/config/configwindow.c:783 +msgid "Address Book" +msgstr "地址簿" + +#: ../sflphone-gtk/src/config/configwindow.c:788 +msgid "Hooks" +msgstr "鉤鍵" + +#: ../sflphone-gtk/src/config/configwindow.c:814 msgid "Accounts" msgstr "帳戶" -#: ../sflphone-gtk/src/configwindow.c:810 +#: ../sflphone-gtk/src/config/configwindow.c:826 msgid "Accounts previously setup" msgstr "以前帳戶設定" -#: ../sflphone-gtk/src/errors.c:28 -msgid "" -"<b>ALSA notification</b>\n" -"\n" -"Error while opening playback device" -msgstr "" -"<b>ALSA提示</b>\n" -"\n" -"打開回放設備時出錯" - -#: ../sflphone-gtk/src/errors.c:31 -msgid "" -"<b>ALSA notification</b>\n" -"\n" -"Error while opening capture device" -msgstr "" -"<b>ALSA提示</b>\n" -"\n" -"打開采集設備時出錯" - -#: ../sflphone-gtk/src/errors.c:34 -msgid "" -"<b>Pulseaudio notification</b>\n" -"\n" -"Pulseaudio is not running" -msgstr "" - -#: ../sflphone-gtk/src/historyfilter.c:49 -#: ../sflphone-gtk/src/historyfilter.c:68 -#: ../sflphone-gtk/src/historyfilter.c:83 -msgid "Search" -msgstr "搜尋" - -#: ../sflphone-gtk/src/mainwindow.c:69 -#, fuzzy -msgid "There is one call in progress." -msgstr "" -"<b>有一個電話正在處理中</b>\n" -"确定要退出?" - -#: ../sflphone-gtk/src/mainwindow.c:73 -#, fuzzy -msgid "There are calls in progress." -msgstr "" -"<b>有電話正在處理中</b>\n" -"确定要退出?" - -#: ../sflphone-gtk/src/mainwindow.c:82 -msgid "Do you still want to quit?" -msgstr "確認要退出?" - -#: ../sflphone-gtk/src/menus.c:135 -msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." -msgstr "SFLphone是一個VoIP客戶端,它兼容SIP和IAX2协议." - -#: ../sflphone-gtk/src/menus.c:138 -msgid "About SFLphone" -msgstr "有關SFLphone" - -#: ../sflphone-gtk/src/menus.c:161 -msgid "_Help" -msgstr "幫助(H)" - -#: ../sflphone-gtk/src/menus.c:278 -msgid "_New call" -msgstr "新電話(N)" - -#: ../sflphone-gtk/src/menus.c:290 ../sflphone-gtk/src/menus.c:760 -msgid "_Pick up" -msgstr "撥出(P)" - -#: ../sflphone-gtk/src/menus.c:300 ../sflphone-gtk/src/menus.c:772 -msgid "_Hang up" -msgstr "放下(H)" - -#: ../sflphone-gtk/src/menus.c:310 ../sflphone-gtk/src/menus.c:784 -msgid "On _Hold" -msgstr "待机" - -#: ../sflphone-gtk/src/menus.c:326 -msgid "_Account Assistant" -msgstr "帳戶向導(A)" - -#: ../sflphone-gtk/src/menus.c:356 -msgid "_Call" -msgstr "電話" - -#: ../sflphone-gtk/src/menus.c:529 -msgid "_Clear history" -msgstr "清空曆史記錄(C)" - -#: ../sflphone-gtk/src/menus.c:541 -msgid "_Accounts" -msgstr "帳戶(A)" - -#: ../sflphone-gtk/src/menus.c:556 -msgid "_Edit" -msgstr "編輯(E)" - -#: ../sflphone-gtk/src/menus.c:616 -msgid "_Dialpad" -msgstr "撥號面板" - -#: ../sflphone-gtk/src/menus.c:628 -msgid "_Volume controls" -msgstr "音量控制(V)" - -#: ../sflphone-gtk/src/menus.c:637 -msgid "_Search history" -msgstr "查找歷史(S)" - -#: ../sflphone-gtk/src/menus.c:645 -msgid "_View" -msgstr "查看(V)" - -#: ../sflphone-gtk/src/menus.c:867 -msgid "_Call back" -msgstr "回叫(C)" - -#: ../sflphone-gtk/src/sflnotify.c:34 ../sflphone-gtk/src/sflnotify.c:100 -#, c-format -msgid "%s account: %s" -msgstr "%s 帳戶: %s" - -#: ../sflphone-gtk/src/sflnotify.c:37 -#, c-format -msgid "<i>From:</i> %s" -msgstr "<i>撥入方:</i> %s" - -#: ../sflphone-gtk/src/sflnotify.c:52 -msgid "Accept" -msgstr "接受" - -#: ../sflphone-gtk/src/sflnotify.c:53 -msgid "Refuse" -msgstr "拒絕" - -#: ../sflphone-gtk/src/sflnotify.c:54 ../sflphone-gtk/src/sflnotify.c:117 -#: ../sflphone-gtk/src/sflnotify.c:154 -msgid "Ignore" -msgstr "忽略" - -#: ../sflphone-gtk/src/sflnotify.c:136 -#, c-format -msgid "Calling with %s account <i>%s</i>" -msgstr "使用%s帳戶<i>%s</i>呼叫" - -#: ../sflphone-gtk/src/sflnotify.c:140 -msgid "Current account" -msgstr "當前帳戶" - -#: ../sflphone-gtk/src/sflnotify.c:169 -msgid "You haven't setup any accounts" -msgstr "你沒有設置任何帳戶" +#: ../sflphone-gtk/src/config/hooks-config.c:92 +msgid "URL argument" +msgstr "URL參數" -#: ../sflphone-gtk/src/sflnotify.c:185 ../sflphone-gtk/src/sflnotify.c:224 -msgid "Setup Accounts" -msgstr "設定帳戶" - -#: ../sflphone-gtk/src/sflnotify.c:208 -msgid "You have no registered accounts" -msgstr "未發現已註冊帳戶" +#: ../sflphone-gtk/src/config/hooks-config.c:102 +msgid "_SIP protocol" +msgstr "SIP 協議(S)" -#: ../sflphone-gtk/src/sliders.c:161 -msgid "Speakers volume" -msgstr "揚聲器音量" +#: ../sflphone-gtk/src/config/hooks-config.c:107 +msgid "_IAX2 protocol" +msgstr "IAX2 協議(I)" -#: ../sflphone-gtk/src/sliders.c:163 -msgid "Mic volume" -msgstr "話筒音量" +#: ../sflphone-gtk/src/config/hooks-config.c:113 +msgid "_SIP Header: " +msgstr "SIP消息頭(S):" -#: ../sflphone-gtk/src/statusicon.c:91 -msgid "_Show main window" -msgstr "顯示主窗口(S)" +#: ../sflphone-gtk/src/config/hooks-config.c:120 +msgid "_Command: " +msgstr "命令(C):" -#: ../sflphone-gtk/src/statusicon.c:124 -#, c-format -msgid "SFLphone - %i accounts registered" -msgstr "SFLphone - %i 個帳戶已註冊" -#: ../sflphone-gtk/src/timestamp.c:46 -msgid "<small>Missed call</small>" -msgstr "<small>未接電話</small>" +#~ msgid "SFLphone 0.9.3" +#~ msgstr "SFLphone 0.9.2" -#: ../sflphone-gtk/src/timestamp.c:64 -#, c-format -msgid "<small>Duration:</small> %s" -msgstr "<small>時長:</small> %s" +#~ msgid "Setup Accounts" +#~ msgstr "設定帳戶" #~ msgid "_STUN Server" #~ msgstr "STUN伺服器(S)" @@ -655,3 +735,4 @@ msgstr "<small>時長:</small> %s" #~ msgid "History empty" #~ msgstr "無曆史記錄" + diff --git a/sflphone-gtk/.cproject b/sflphone-gtk/.cproject index 0164b0a62c9d2857a79d40d75d440852bc0f37aa..c737a8d2a3d901d4d129b40dec43c82fb7d29ac2 100644 --- a/sflphone-gtk/.cproject +++ b/sflphone-gtk/.cproject @@ -33,6 +33,7 @@ <option id="gnu.c.compiler.option.preprocessor.def.symbols.1676995808" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"> <listOptionValue builtIn="false" value=""ICONS_DIR="/usr/share/sflphone\""/> <listOptionValue builtIn="false" value=""CODECS_DIR="/usr/lib/sflphone/codecs\""/> +<listOptionValue builtIn="false" value=""DATA_DIR="/usr/share/sflphone\""/> </option> <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1938301835" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> </tool> @@ -44,7 +45,7 @@ </tool> <tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.963771621" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base"/> <tool id="cdt.managedbuild.tool.gnu.assembler.base.1924201184" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base"> -<option id="gnu.both.asm.option.include.paths.1513412733" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath"/> +<option id="gnu.both.asm.option.include.paths.1513412733" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths"/> <inputType id="cdt.managedbuild.tool.gnu.assembler.input.938125330" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> </tool> </toolChain> @@ -55,6 +56,7 @@ <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/> <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> + <storageModule moduleId="scannerConfiguration"> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/> <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> diff --git a/sflphone-gtk/.settings/org.eclipse.cdt.core.prefs b/sflphone-gtk/.settings/org.eclipse.cdt.core.prefs index 55576b0f05ecb8cbfcdc2ed0863a9d1cd4426ca5..923efa5204c06e39c83cd785e6f39b9cc7741f51 100644 --- a/sflphone-gtk/.settings/org.eclipse.cdt.core.prefs +++ b/sflphone-gtk/.settings/org.eclipse.cdt.core.prefs @@ -1,4 +1,4 @@ -#Thu Feb 26 16:02:29 EST 2009 +#Thu Mar 26 14:05:05 EDT 2009 eclipse.preferences.version=1 org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16 org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration=80 @@ -10,36 +10,36 @@ org.eclipse.cdt.core.formatter.alignment_for_expression_list=0 org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer=16 org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration=16 org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.cdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.cdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.cdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.cdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.cdt.core.formatter.brace_position_for_namespace_declaration=end_of_line -org.eclipse.cdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.cdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.cdt.core.formatter.brace_position_for_array_initializer=next_line_shifted +org.eclipse.cdt.core.formatter.brace_position_for_block=next_line_shifted +org.eclipse.cdt.core.formatter.brace_position_for_block_in_case=next_line_shifted +org.eclipse.cdt.core.formatter.brace_position_for_method_declaration=next_line +org.eclipse.cdt.core.formatter.brace_position_for_namespace_declaration=next_line +org.eclipse.cdt.core.formatter.brace_position_for_switch=next_line_shifted +org.eclipse.cdt.core.formatter.brace_position_for_type_declaration=next_line org.eclipse.cdt.core.formatter.compact_else_if=true org.eclipse.cdt.core.formatter.continuation_indentation=2 org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer=2 org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line=false org.eclipse.cdt.core.formatter.indent_access_specifier_compare_to_type_header=false org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_access_specifier=true -org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_namespace_header=false +org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_namespace_header=true org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.cdt.core.formatter.indent_declaration_compare_to_template_header=false +org.eclipse.cdt.core.formatter.indent_declaration_compare_to_template_header=true org.eclipse.cdt.core.formatter.indent_empty_lines=false org.eclipse.cdt.core.formatter.indent_statements_compare_to_block=true org.eclipse.cdt.core.formatter.indent_statements_compare_to_body=true org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases=true org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.cdt.core.formatter.indentation.size=2 +org.eclipse.cdt.core.formatter.indentation.size=8 org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.cdt.core.formatter.insert_new_line_after_template_declaration=do not insert +org.eclipse.cdt.core.formatter.insert_new_line_after_template_declaration=insert org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration=do not insert -org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement=insert +org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration=insert +org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement=insert org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block=insert org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator=insert org.eclipse.cdt.core.formatter.insert_space_after_binary_operator=insert @@ -94,7 +94,7 @@ org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invoc org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause=do not insert +org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause=insert org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case=do not insert org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional=insert org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default=do not insert diff --git a/sflphone-gtk/.settings/org.eclipse.cdt.ui.prefs b/sflphone-gtk/.settings/org.eclipse.cdt.ui.prefs index 6a9c16b18bbcb98a8dba89d549ec3ad4728cadbb..9281ecd41f6b758197d07f8869691d0953314ea4 100644 --- a/sflphone-gtk/.settings/org.eclipse.cdt.ui.prefs +++ b/sflphone-gtk/.settings/org.eclipse.cdt.ui.prefs @@ -1,4 +1,4 @@ -#Thu Feb 26 16:02:29 EST 2009 +#Thu Mar 26 14:05:05 EDT 2009 eclipse.preferences.version=1 -formatter_profile=_SFLPhone +formatter_profile=org.eclipse.cdt.ui.default.gnu_profile formatter_settings_version=1 diff --git a/sflphone-gtk/Makefile.am b/sflphone-gtk/Makefile.am index 034728db4722ab4f654b20d90d9c1d7368f7f17f..5705a85e233eaa9ee7383ef7288e6e961f6629e9 100644 --- a/sflphone-gtk/Makefile.am +++ b/sflphone-gtk/Makefile.am @@ -1,8 +1,11 @@ -SUBDIRS = src pixmaps +SUBDIRS = src pixmaps tests ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = sflphone.desktop.in +log4crc_DATA = log4crc +log4crcdir = $(datadir)/sflphone + +EXTRA_DIST = $(log4crc_DATA) sflphone.desktop.in appsdir = $(datadir)/applications apps_in_files = sflphone.desktop.in apps_DATA = $(apps_in_files:.desktop.in=.desktop) diff --git a/sflphone-gtk/configure.ac b/sflphone-gtk/configure.ac index e6e25412930a5348f41dd659386bd3fe14909bb8..118a3f65368f25d0ac90a87673e87d941eefe32a 100644 --- a/sflphone-gtk/configure.ac +++ b/sflphone-gtk/configure.ac @@ -1,10 +1,10 @@ -AC_INIT([SFLphone],[0.9.4],[sflphoneteam@savoirfairelinux.com],[sflphone]) +AC_INIT([SFLphone],[0.9.5~beta],[sflphoneteam@savoirfairelinux.com],[sflphone]) AM_CONFIG_HEADER(config.h) LT_INIT PACKAGE=SFLphone -VERSION=0.9.4 +VERSION=0.9.5~beta AM_INIT_AUTOMAKE($PACKAGE,$VERSION) AC_CONFIG_MACRO_DIR([m4]) @@ -28,24 +28,53 @@ AC_PROG_INSTALL AC_STDC_HEADERS AC_PROG_LIBTOOL -PKG_CHECK_MODULES(DEPS, \ - dbus-glib-1 >= 0.35 \ - libnotify >= 0.4 \ - gtk+-2.0 >= 2.2 \ - glib-2.0 >= 2.2 \ - libsexy >= 0.1 \ +dnl Check for log4c +AC_CHECK_HEADERS(log4c.h, have_log4c=true, have_log4c=false) +if ! $have_log4c; then + AC_MSG_ERROR(Please install the log4c library) +fi + +dnl Check for GTK+ version +dnl If gtk+-2.0 >= 2.16, we don't need libsexy package anymore +PKG_CHECK_MODULES(GTK216, gtk+-2.0 >= 2.16, need_libsexy=false, need_libsexy=true) +if $need_libsexy; then + PKG_CHECK_MODULES(LIBSEXY, libsexy >= 0.1, have_libsexy=true, have_libsexy=false) + if ! $have_libsexy; then + AC_MSG_ERROR(libsexy package has not been found. Please install it.) + fi +fi +AC_SUBST(LIBSEXY_CFLAGS) +AC_SUBST(LIBSEXY_LIBS) + +PKG_CHECK_MODULES(DEPS, \ + dbus-glib-1 >= 0.35 \ + libnotify >= 0.4 \ + gtk+-2.0 >= 2.2 \ + glib-2.0 >= 2.2 \ libebook-1.2 >= 2.22 ) AC_SUBST(DEPS_CFLAGS) AC_SUBST(DEPS_LIBS) +# This macro is defined in check.m4 and tests if check.h and +# libcheck.a are installed in your system. It sets CHECK_CFLAGS and +# CHECK_LIBS accordingly. +# AM_PATH_CHECK([MINIMUM-VERSION, +# [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl AM_PATH_CHECK() DEPRECATED +PKG_CHECK_MODULES([CHECK], [check >= 0.9.4]) + AC_OUTPUT([ Makefile -src/Makefile -src/contactlist/Makefile +src/Makefile +src/config/Makefile +src/dbus/Makefile +src/contacts/Makefile +src/contacts/addressbook/Makefile pixmaps/Makefile sflphone.desktop +tests/Makefile ]) diff --git a/sflphone-gtk/globals.mak b/sflphone-gtk/globals.mak new file mode 100644 index 0000000000000000000000000000000000000000..94c36612cc612440edf94a64552a48ef7648e3ff --- /dev/null +++ b/sflphone-gtk/globals.mak @@ -0,0 +1,17 @@ +# Global variables +src = $(top_srcdir) + +# Preprocessor flags +AM_CPPFLAGS = $(DEPS_CFLAGS) \ + $(LIBSEXY_CFLAGS) \ + -I$(src)/src \ + -I$(src)/src/config \ + -I$(src)/src/dbus \ + -I$(src)/src/contacts \ + -I$(src)/src/addressbook \ + -DDATA_DIR=\""$(prefix)/share/sflphone"\" \ + -DICONS_DIR=\""$(prefix)/share/sflphone"\" \ + -DCODECS_DIR=\""$(prefix)/lib/sflphone/codecs"\" + -DPREFIX=\"$(prefix)\" \ + $(ZEROCONFFLAGS) \ + -DENABLE_TRACE diff --git a/sflphone-gtk/log4crc b/sflphone-gtk/log4crc new file mode 100644 index 0000000000000000000000000000000000000000..e108c9378b0e99e095389c63d029db54a1791290 --- /dev/null +++ b/sflphone-gtk/log4crc @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE log4c SYSTEM ""> + +<log4c version="1.2.1"> + <config> + <bufsize>0</bufsize> + <debug level="2"/> + <nocleanup>0</nocleanup> + <reread>1</reread> + </config> + + <rollingpolicy name="rollingpolicy" type="sizewin" maxsize="1024" maxnum="10" /> + <appender name="rollingfileappender" type="rollingfile" logdir="." prefix="prefix" layout="dated" rollingpolicy="rollingpolicy" /> + + <appender name="stdout" type="stream" layout="basic"/> + <appender name="stderr" type="stream" layout="dated"/> + <appender name="syslog" type="syslog" layout="basic"/> + + <layout name="basic" type="basic"/> + <layout name="dated" type="dated"/> + + <category name="root" priority="warning"/> + <category name="org.sflphone.gtk" priority="warning" appender="stdout" /> +</log4c> diff --git a/sflphone-gtk/src/Makefile.am b/sflphone-gtk/src/Makefile.am index 5947dcd0830475723a046da865e58f49e7c15ce1..1ffe0db8f2cb22155080b4499a2e79e506e08bfe 100644 --- a/sflphone-gtk/src/Makefile.am +++ b/sflphone-gtk/src/Makefile.am @@ -1,60 +1,40 @@ +include ../globals.mak + bin_PROGRAMS = sflphone-gtk -SUBDIRS=contactlist +SUBDIRS = config contacts dbus -# noinst_LTLIBRARIES = libsflphonegtk.la - -NOFIFY_LIBS=-lnotify -SEXY_LIBS=-lsexy +NOFIFY_LIBS = -lnotify +LOG4C = -llog4c -#if GTK_CHECK_VERSION(2,10,0) -STATUSICON_HEADER = statusicon.h -STATUSICON_SOURCE = statusicon.c -#elif -#STATUSICON_HEADER = -#STATUSICON_SOURCE = -#endif +SFLPHONEGTK_LIBS=./contacts/libcontacts.la ./config/libconfig.la ./dbus/libdbus.la sflphone_gtk_SOURCES = \ main.c \ errors.c \ - dbus.c \ sflnotify.c \ assistant.c \ mainwindow.c \ - calllist.c \ dialpad.c \ - audioconf.c \ menus.c \ - calltab.c \ - calltree.c \ - searchfilter.c \ + toolbar.c \ + call.c \ actions.c \ - configwindow.c \ accountlist.c \ - accountwindow.c \ marshaller.c \ sliders.c \ - $(STATUSICON_SOURCE) \ + statusicon.c \ codeclist.c \ timestamp.c \ - reqaccount.c \ - addressbook-config.c \ - hooks-config.c + reqaccount.c -noinst_HEADERS = actions.h dbus.h sflnotify.h mainwindow.h calllist.h dialpad.h audioconf.h codeclist.h assistant.h \ - callmanager-glue.h errors.h sflphone_const.h configurationmanager-glue.h instance-glue.h menus.h calltab.h calltree.h configwindow.h \ - accountlist.h accountwindow.h marshaller.h sliders.h $(STATUSICON_HEADER) timestamp.h searchfilter.h reqaccount.h addressbook-config.h hooks-config.h +noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \ + assistant.h timestamp.h reqaccount.h errors.h sflphone_const.h \ + menus.h accountlist.h marshaller.h sliders.h statusicon.h call.h toolbar.h EXTRA_DIST = marshaller.list -sflphone_gtk_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SEXY_LIBS) \ - ./contactlist/libcontact.la - - -AM_CPPFLAGS = $(DEPS_CFLAGS) \ - -DICONS_DIR=\""$(prefix)/share/sflphone"\" \ - -DCODECS_DIR=\""$(prefix)/lib/sflphone/codecs"\" +sflphone_gtk_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SFLPHONEGTK_LIBS) $(LIBSEXY_LIBS) $(LOG4C) # add symbolic link install-exec-local: diff --git a/sflphone-gtk/src/accountlist.c b/sflphone-gtk/src/accountlist.c index 455b68bd088d242de087eadf01410b56868625ed..3a0959c810e496c3ff9a199d67ee60a0e386322d 100644 --- a/sflphone-gtk/src/accountlist.c +++ b/sflphone-gtk/src/accountlist.c @@ -2,22 +2,22 @@ * Copyright (C) 2007 Savoir-Faire Linux inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + #include <accountlist.h> #include <actions.h> #include <string.h> @@ -26,7 +26,7 @@ GQueue * accountQueue; gchar* __CURRENT_ACCOUNT_ID = NULL; /* GCompareFunc to compare a accountID (gchar* and a account_t) */ -gint +gint is_accountID_struct ( gconstpointer a, gconstpointer b) { account_t * c = (account_t*)a; @@ -41,7 +41,7 @@ is_accountID_struct ( gconstpointer a, gconstpointer b) } /* GCompareFunc to get current call (gchar* and a account_t) */ -gint +gint get_state_struct ( gconstpointer a, gconstpointer b) { account_t * c = (account_t*)a; @@ -55,26 +55,26 @@ get_state_struct ( gconstpointer a, gconstpointer b) } } -void +void account_list_init () { accountQueue = g_queue_new (); } -void +void account_list_clean () { g_queue_free (accountQueue); } -void +void account_list_add (account_t * c) { g_queue_push_tail (accountQueue, (gpointer *) c); } -void +void account_list_remove (const gchar * accountID) { GList * c = g_queue_find_custom (accountQueue, accountID, is_accountID_struct); @@ -85,7 +85,7 @@ account_list_remove (const gchar * accountID) } -account_t * +account_t * account_list_get_by_state (account_state_t state ) { GList * c = g_queue_find_custom (accountQueue, &state, get_state_struct); @@ -93,11 +93,11 @@ account_list_get_by_state (account_state_t state ) { return (account_t *)c->data; } - else + else { return NULL; } - + } account_t * @@ -120,7 +120,7 @@ account_list_get_size ( ) return g_queue_get_length (accountQueue); } -account_t * +account_t * account_list_get_nth ( guint n ) { return g_queue_peek_nth (accountQueue, n); @@ -138,7 +138,7 @@ account_list_get_current( ) void account_list_set_current_id(const gchar * accountID) { - g_print("set current id = %s\n", accountID); + DEBUG("set current id = %s", accountID); __CURRENT_ACCOUNT_ID = g_strdup(accountID); } @@ -227,14 +227,14 @@ account_list_get_registered_accounts( void ) if( account_list_get_nth( i ) -> state == ( ACCOUNT_STATE_REGISTERED )) res ++; } - g_print(" %d registered accounts \n" , res ); + DEBUG(" %d registered accounts" , res ); return res; } gchar* account_list_get_current_id( void ){ if( __CURRENT_ACCOUNT_ID == NULL ) return ""; - else + else return __CURRENT_ACCOUNT_ID; } @@ -271,3 +271,15 @@ int account_list_get_iax_account_number( void ){ return n; } + +gchar * account_list_get_ordered_list (void) { + + gchar *order=""; + guint i; + + for( i=0; i<account_list_get_size(); i++ ) + { + order = g_strconcat (order, account_list_get_nth (i)->accountID, "/", NULL); + } + return order; +} diff --git a/sflphone-gtk/src/accountlist.h b/sflphone-gtk/src/accountlist.h index 1887ea974e9596770133b76533ee7551a4e41813..6456e521d09fa99859a57fcd8e29cf7ba0eeecfb 100644 --- a/sflphone-gtk/src/accountlist.h +++ b/sflphone-gtk/src/accountlist.h @@ -182,6 +182,7 @@ int account_list_get_sip_account_number( void ); */ int account_list_get_iax_account_number( void ); +gchar * account_list_get_ordered_list (void); #endif diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c index 4e850958329d331bf6b2c030b496f1a8a426a722..0f1b7eaf9729296be02377f7f3e0bb58876764e3 100644 --- a/sflphone-gtk/src/actions.c +++ b/sflphone-gtk/src/actions.c @@ -19,15 +19,12 @@ */ #include <actions.h> -#include <calltree.h> -#include <dbus.h> +#include <dbus/dbus.h> #include <mainwindow.h> #include <menus.h> #include <statusicon.h> -#include <calltab.h> -#include <searchfilter.h> -#include <contactlist/eds.h> - +#include <toolbar.h> +#include <contacts/searchbar.h> #include <gtk/gtk.h> #include <string.h> #include <glib/gprintf.h> @@ -72,12 +69,15 @@ sflphone_notify_voice_mail ( const gchar* accountID , guint count ) } void -status_bar_display_account( call_t* c) +status_bar_display_account () { gchar* msg; account_t* acc; - if(c->accountID != NULL){ - acc = account_list_get_by_id(c->accountID); + + statusbar_pop_message(__MSG_ACCOUNT_DEFAULT); + + acc = account_list_get_current (); + if(acc){ msg = g_markup_printf_escaped(_("%s account- %s") , (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE), (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS)); @@ -91,7 +91,7 @@ status_bar_display_account( call_t* c) sflphone_quit () { gboolean quit = FALSE; - guint count = call_list_get_size(current_calls); + guint count = calllist_get_size(current_calls); if(count > 0){ quit = main_window_ask_quit(); } @@ -114,7 +114,7 @@ sflphone_quit () sflphone_hold(call_t * c ) { c->state = CALL_STATE_HOLD; - update_call_tree(current_calls,c); + calltree_update_call(current_calls,c); update_menus(); } @@ -122,22 +122,20 @@ sflphone_hold(call_t * c ) sflphone_ringing(call_t * c ) { c->state = CALL_STATE_RINGING; - update_call_tree(current_calls,c); + calltree_update_call(current_calls,c); update_menus(); } void sflphone_hung_up( call_t * c) { - call_list_remove( current_calls, c->callID); - update_call_tree_remove(current_calls, c); + calllist_remove( current_calls, c->callID); + calltree_remove_call(current_calls, c); c->state = CALL_STATE_DIALING; update_menus(); #if GTK_CHECK_VERSION(2,10,0) status_tray_icon_blink( FALSE ); #endif - - statusbar_pop_message(__MSG_ACCOUNT_DEFAULT); } /** Internal to actions: Fill account list */ @@ -231,11 +229,8 @@ gboolean sflphone_init() { dbus_register(getpid(), "Gtk+ Client"); current_calls = calltab_init(NULL); - // history = calltab_init("history"); contacts = calltab_init("contacts"); history = calltab_init("history"); - histfilter = create_filter(GTK_TREE_MODEL(history->store)); - init(); account_list_init (); codec_list_init(); sflphone_fill_account_list(FALSE); @@ -248,7 +243,7 @@ gboolean sflphone_init() void sflphone_hang_up() { - call_t * selectedCall = call_get_selected(current_calls); + call_t * selectedCall = calltab_get_selected_call(current_calls); if(selectedCall) { switch(selectedCall->state) @@ -278,26 +273,26 @@ sflphone_hang_up() dbus_refuse (selectedCall); selectedCall->state = CALL_STATE_DIALING; selectedCall->_stop = 0; - g_print("from sflphone_hang_up : "); stop_notification(); + DEBUG("from sflphone_hang_up : "); stop_notification(); break; case CALL_STATE_TRANSFERT: dbus_hang_up (selectedCall); (void) time(&selectedCall->_stop); break; default: - g_warning("Should not happen in sflphone_hang_up()!"); + WARN("Should not happen in sflphone_hang_up()!"); break; } } - update_call_tree( history , selectedCall ); + calltree_update_call( history , selectedCall ); } void sflphone_pick_up() { - - call_t * selectedCall = call_get_selected(active_calltree); + + call_t * selectedCall = calltab_get_selected_call(active_calltree); if(selectedCall) { switch(selectedCall->state) @@ -307,9 +302,9 @@ sflphone_pick_up() break; case CALL_STATE_INCOMING: selectedCall->history_state = INCOMING; - update_call_tree( history , selectedCall ); + calltree_update_call( history , selectedCall ); dbus_accept (selectedCall); - g_print("from sflphone_pick_up : "); stop_notification(); + DEBUG("from sflphone_pick_up : "); stop_notification(); break; case CALL_STATE_HOLD: sflphone_new_call(); @@ -326,7 +321,7 @@ sflphone_pick_up() sflphone_new_call(); break; default: - g_warning("Should not happen in sflphone_pick_up()!"); + WARN("Should not happen in sflphone_pick_up()!"); break; } } @@ -335,7 +330,7 @@ sflphone_pick_up() void sflphone_on_hold () { - call_t * selectedCall = call_get_selected(current_calls); + call_t * selectedCall = calltab_get_selected_call(current_calls); if(selectedCall) { switch(selectedCall->state) @@ -348,7 +343,7 @@ sflphone_on_hold () break; default: - g_warning("Should not happen in sflphone_on_hold!"); + WARN("Should not happen in sflphone_on_hold!"); break; } } @@ -357,7 +352,7 @@ sflphone_on_hold () void sflphone_off_hold () { - call_t * selectedCall = call_get_selected(current_calls); + call_t * selectedCall = calltab_get_selected_call(current_calls); if(selectedCall) { switch(selectedCall->state) @@ -366,15 +361,19 @@ sflphone_off_hold () dbus_unhold (selectedCall); break; default: - g_warning("Should not happen in sflphone_off_hold ()!"); + WARN("Should not happen in sflphone_off_hold ()!"); break; } } - + if(dbus_get_is_recording(selectedCall)) - g_print("Currently recording! \n"); + { + DEBUG("Currently recording!"); + } else - g_print("Not recording currently \n"); + { + DEBUG("Not recording currently"); + } } @@ -382,7 +381,7 @@ sflphone_off_hold () sflphone_fail( call_t * c ) { c->state = CALL_STATE_FAILURE; - update_call_tree(current_calls,c); + calltree_update_call(current_calls,c); update_menus(); } @@ -390,7 +389,7 @@ sflphone_fail( call_t * c ) sflphone_busy( call_t * c ) { c->state = CALL_STATE_BUSY; - update_call_tree(current_calls, c); + calltree_update_call(current_calls, c); update_menus(); } @@ -400,7 +399,7 @@ sflphone_current( call_t * c ) if( c->state != CALL_STATE_HOLD ) (void) time(&c->_start); c->state = CALL_STATE_CURRENT; - update_call_tree(current_calls,c); + calltree_update_call(current_calls,c); update_menus(); } @@ -410,19 +409,19 @@ sflphone_record( call_t * c ) if( c->state != CALL_STATE_HOLD ) (void) time(&c->_start); c->state = CALL_STATE_RECORD; - update_call_tree(current_calls,c); + calltree_update_call(current_calls,c); update_menus(); } void sflphone_set_transfert() { - call_t * c = call_get_selected(current_calls); + call_t * c = calltab_get_selected_call(current_calls); if(c) { c->state = CALL_STATE_TRANSFERT; c->to = g_strdup(""); - update_call_tree(current_calls,c); + calltree_update_call(current_calls,c); update_menus(); } toolbar_update_buttons(); @@ -431,12 +430,12 @@ sflphone_set_transfert() void sflphone_unset_transfert() { - call_t * c = call_get_selected(current_calls); + call_t * c = calltab_get_selected_call(current_calls); if(c) { c->state = CALL_STATE_CURRENT; c->to = g_strdup(""); - update_call_tree(current_calls,c); + calltree_update_call(current_calls,c); update_menus(); } toolbar_update_buttons(); @@ -446,11 +445,11 @@ sflphone_unset_transfert() sflphone_incoming_call (call_t * c) { c->history_state = MISSED; - call_list_add ( current_calls, c ); - call_list_add( history, c ); - update_call_tree_add( current_calls , c ); + calllist_add ( current_calls, c ); + calllist_add( history, c ); + calltree_add_call( current_calls , c ); update_menus(); - display_calltree (current_calls); + calltree_display (current_calls); } void @@ -462,8 +461,8 @@ process_dialing(call_t * c, guint keyval, gchar * key) //dbus_play_dtmf( key ); } - g_print("process_dialing : keyval : %i \n",keyval); - g_print("process_dialing : key : %s \n",key); + DEBUG("process_dialing : keyval : %i",keyval); + DEBUG("process_dialing : key : %s",key); switch (keyval) { @@ -481,15 +480,15 @@ process_dialing(call_t * c, guint keyval, gchar * key) c->to = g_strndup(c->to, strlen(c->to) -1); g_free(before); - g_print("TO: backspace %s\n", c->to); + DEBUG("TO: backspace %s", c->to); if(c->state == CALL_STATE_DIALING) { g_free(c->from); c->from = g_strconcat("\"\" <", c->to, ">", NULL); } - update_call_tree(current_calls,c); - } + calltree_update_call(current_calls,c); + } else if(strlen(c->to) == 0) { if(c->state != CALL_STATE_TRANSFERT) @@ -506,21 +505,21 @@ process_dialing(call_t * c, guint keyval, gchar * key) default: // if (keyval < 255 || (keyval >65453 && keyval < 65466)) if (keyval < 127 || (keyval > 65400 && keyval < 65466)) - { + { if(c->state != CALL_STATE_TRANSFERT) dbus_play_dtmf( key ); gchar * before = c->to; c->to = g_strconcat(c->to, key, NULL); g_free(before); - g_print("TO:default %s\n", c->to); + DEBUG("TO:default %s", c->to); if(c->state == CALL_STATE_DIALING) { g_free(c->from); c->from = g_strconcat("\"\" <", c->to, ">", NULL); } - update_call_tree(current_calls,c); + calltree_update_call(current_calls,c); } break; } @@ -530,22 +529,22 @@ process_dialing(call_t * c, guint keyval, gchar * key) call_t * sflphone_new_call() { - + call_t *c; gchar *from, *to; sflphone_on_hold(); // Play a tone when creating a new call - if( call_list_get_size(current_calls) == 0 ) + if( calllist_get_size(current_calls) == 0 ) dbus_start_tone( TRUE , ( voice_mails > 0 )? TONE_WITH_MESSAGE : TONE_WITHOUT_MESSAGE) ; to = g_strdup(""); from = g_strconcat("\"\" <>", NULL); create_new_call (to, from, CALL_STATE_DIALING, "", &c); - call_list_add(current_calls,c); - update_call_tree_add(current_calls,c); + calllist_add(current_calls,c); + calltree_add_call(current_calls,c); update_menus(); return c; @@ -555,7 +554,7 @@ sflphone_new_call() void sflphone_keypad( guint keyval, gchar * key) { - call_t * c = call_get_selected(current_calls); + call_t * c = calltab_get_selected_call(current_calls); if((active_calltree != current_calls) || (active_calltree == current_calls && !c)) { @@ -568,14 +567,14 @@ sflphone_keypad( guint keyval, gchar * key) case 65307: /* ESCAPE */ break; default: - display_calltree (current_calls); + calltree_display (current_calls); process_dialing(sflphone_new_call(), keyval, key); break; } } else if(c) { - printf("call\n"); + DEBUG("call"); switch(c->state) { case CALL_STATE_DIALING: // Currently dialing => edit number @@ -588,7 +587,7 @@ sflphone_keypad( guint keyval, gchar * key) case 65307: /* ESCAPE */ dbus_hang_up(c); (void) time(&c->_stop); - update_call_tree( history , c ); + calltree_update_call( history , c ); break; default: // To play the dtmf when calling mail box for instance @@ -611,13 +610,13 @@ sflphone_keypad( guint keyval, gchar * key) case 65293: /* ENTER */ case 65421: /* ENTER numpad */ c->history_state = INCOMING; - update_call_tree( history , c ); + calltree_update_call( history , c ); dbus_accept(c); - g_print("from sflphone_keypad ( enter ) : "); stop_notification(); + DEBUG("from sflphone_keypad ( enter ) : "); stop_notification(); break; case 65307: /* ESCAPE */ dbus_refuse(c); - g_print("from sflphone_keypad ( escape ) : "); stop_notification(); + DEBUG("from sflphone_keypad ( escape ) : "); stop_notification(); break; } break; @@ -661,7 +660,7 @@ sflphone_keypad( guint keyval, gchar * key) case 65307: /* ESCAPE */ dbus_hang_up(c); c->_stop = 0; - update_call_tree( history , c ); + calltree_update_call( history , c ); break; } break; @@ -675,121 +674,131 @@ sflphone_keypad( guint keyval, gchar * key) * Place a call with the current account. * If there is no default account selected, place a call with the first * registered account of the account list - * Else, popup an error message + * Else, check if it an IP call. if not, popup an error message */ void sflphone_place_call ( call_t * c ) { - if(c->state == CALL_STATE_DIALING && strcmp(c->to, "") != 0) + if (c->state == CALL_STATE_DIALING && g_str_has_prefix (c->to, "ip:")) { - - //format_phone_number (&c->to); - - if( account_list_get_size() == 0 ) - { - notify_no_accounts(); - sflphone_fail(c); - } + dbus_place_call (c); + } - else if( account_list_get_by_state( ACCOUNT_STATE_REGISTERED ) == NULL ) - { - notify_no_registered_accounts(); - sflphone_fail(c); - } + else { - else + if(c->state == CALL_STATE_DIALING && strcmp(c->to, "") != 0) { - - - account_t * current; - - if(g_strcasecmp(c->accountID, "") != 0) { - current = account_list_get_by_id(c->accountID); - } else { - current = account_list_get_current(); + + //format_phone_number (&c->to); + + if( account_list_get_size() == 0 ) + { + notify_no_accounts(); + sflphone_fail(c); } - // printf("sflphone_place_call :: c->accountID : %i \n",c->accountID); - // account_t * current = c->accountID; - - - if( current ) + else if( account_list_get_by_state( ACCOUNT_STATE_REGISTERED ) == NULL ) { - - if(g_strcasecmp(g_hash_table_lookup( current->properties, "Status"),"REGISTERED")==0) + notify_no_registered_accounts(); + sflphone_fail(c); + } + + else + { + + account_t * current; + + if(g_strcasecmp(c->accountID, "") != 0) { + current = account_list_get_by_id(c->accountID); + } else { + current = account_list_get_current(); + } + // DEBUG("sflphone_place_call :: c->accountID : %i",c->accountID); + + // account_t * current = c->accountID; + + + if( current ) { - // OK, everything alright - the call is made with the current account - c -> accountID = current -> accountID; - status_bar_display_account(c); - dbus_place_call(c); + + if(g_strcasecmp(g_hash_table_lookup( current->properties, "Status"),"REGISTERED")==0) + { + // OK, everything alright - the call is made with the current account + c -> accountID = current -> accountID; + dbus_place_call(c); + } + else + { + // Current account is not registered + // So we place a call with the first registered account + // And we switch the current account + current = account_list_get_by_state( ACCOUNT_STATE_REGISTERED ); + c -> accountID = current -> accountID; + dbus_place_call(c); + notify_current_account( current ); + account_list_set_current_id( c-> accountID ); + } } else { - // Current account is not registered + + // No current accounts have been setup. // So we place a call with the first registered account - // And we switch the current account + // and we change the current account current = account_list_get_by_state( ACCOUNT_STATE_REGISTERED ); c -> accountID = current -> accountID; dbus_place_call(c); notify_current_account( current ); - status_bar_display_account(c); account_list_set_current_id( c-> accountID ); } } - else - { - - // No current accounts have been setup. - // So we place a call with the first registered account - // and we change the current account - current = account_list_get_by_state( ACCOUNT_STATE_REGISTERED ); - c -> accountID = current -> accountID; - dbus_place_call(c); - notify_current_account( current ); - status_bar_display_account(c); - account_list_set_current_id( c-> accountID ); - } + // Update history + c->history_state = OUTGOING; + calllist_add(history, c); } - // Update history - c->history_state = OUTGOING; - g_print ("add in history\n"); - call_list_add(history, c); } } - void sflphone_display_selected_codec (const gchar* codecName) { - - call_t * selectedCall = call_get_selected(current_calls); + + call_t * selectedCall; gchar* msg; account_t* acc; - if(selectedCall->accountID != NULL){ - acc = account_list_get_by_id(selectedCall->accountID); - msg = g_markup_printf_escaped(_("%s account- %s %s") , - (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE), - (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS), - codecName); - statusbar_push_message( msg , __MSG_ACCOUNT_DEFAULT); - g_free(msg); - } + selectedCall = calltab_get_selected_call(current_calls); + if (selectedCall) { + if(selectedCall->accountID != NULL){ + acc = account_list_get_by_id(selectedCall->accountID); + if (!acc) { + msg = g_markup_printf_escaped (_("IP call - %s"), codecName); + } + else { + msg = g_markup_printf_escaped(_("%s account- %s %s") , + (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE), + (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS), + codecName); + } + statusbar_push_message( msg , __MSG_ACCOUNT_DEFAULT); + g_free(msg); + } + } } gchar* sflphone_get_current_codec_name() { - call_t * selectedCall = call_get_selected(current_calls); + call_t * selectedCall = calltab_get_selected_call(current_calls); return dbus_get_current_codec_name(selectedCall); } void sflphone_rec_call() { - call_t * selectedCall = call_get_selected(current_calls); + call_t * selectedCall = calltab_get_selected_call(current_calls); dbus_set_record(selectedCall); @@ -802,14 +811,14 @@ sflphone_rec_call() selectedCall->state = CALL_STATE_CURRENT; break; default: - g_warning("Should not happen in sflphone_off_hold ()!"); + WARN("Should not happen in sflphone_off_hold ()!"); break; } - update_call_tree(current_calls,selectedCall); + calltree_update_call(current_calls,selectedCall); update_menus(); // gchar* codname = sflphone_get_current_codec_name(); - // printf("sflphone_get_current_codec_name: %s \n",codname); + // DEBUG("sflphone_get_current_codec_name: %s",codname); } /* Internal to action - set the __CURRENT_ACCOUNT variable */ @@ -838,7 +847,7 @@ sflphone_fill_codec_list() codec_t * c = g_new0(codec_t, 1); c->_payload = atoi(*order); details = (gchar **)dbus_codec_details(c->_payload); - //printf("Codec details: %s / %s / %s / %s\n",details[0],details[1],details[2],details[3]); + //DEBUG("Codec details: %s / %s / %s / %s",details[0],details[1],details[2],details[3]); c->name = details[0]; c->is_active = TRUE; c->sample_rate = atoi(details[1]); diff --git a/sflphone-gtk/src/actions.h b/sflphone-gtk/src/actions.h index 7c22eeb1b9cc7d9a57fb930ff14580bbc8294cf1..19a22694d6b11a29bf3700c4e02d41a74187c125 100644 --- a/sflphone-gtk/src/actions.h +++ b/sflphone-gtk/src/actions.h @@ -2,29 +2,27 @@ * Copyright (C) 2007 Savoir-Faire Linux inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + #ifndef __ACTIONS_H__ #define __ACTIONS_H__ #include <libintl.h> #include <locale.h> - -#include <calllist.h> #include <accountlist.h> #include <codeclist.h> #include <sflphone_const.h> @@ -38,7 +36,7 @@ /** - * Initialize lists and configurations + * Initialize lists and configurations * @return TRUE if succeeded, FALSE otherwise */ gboolean sflphone_init ( ) ; @@ -55,7 +53,7 @@ gboolean sflphone_quit ( ) ; void sflphone_hang_up (); /** - * Put the selected call on hold + * Put the selected call on hold */ void sflphone_on_hold (); @@ -124,7 +122,7 @@ void sflphone_fail( call_t * c ); void sflphone_current ( call_t * c); /** - * The callee has hung up + * The callee has hung up * @param c The current call */ void sflphone_hung_up( call_t * c); @@ -144,7 +142,7 @@ void sflphone_incoming_call ( call_t * c); void sflphone_keypad ( guint keyval, gchar * key); /** - * Place a call with a filled call_t.to + * Place a call with a filled call_t.to * @param c A call in CALL_STATE_DIALING state */ void sflphone_place_call ( call_t * c ); @@ -157,7 +155,7 @@ void sflphone_fill_account_list(gboolean toolbarInitialized); /** * Set an account as current. The current account is to one used to place calls with by default * The current account is the first in the account list ( index 0 ) - */ + */ void sflphone_set_current_account(); /** @@ -172,4 +170,7 @@ void sflphone_rec_call (void); gchar* sflphone_get_current_codec_name(); void sflphone_display_selected_codec (const gchar* codecName); -#endif + +void status_bar_display_account (); + +#endif diff --git a/sflphone-gtk/src/addressbook-config.c b/sflphone-gtk/src/addressbook-config.c deleted file mode 100644 index 4b2ae63008389d0050604ffbefc2f4be633376ab..0000000000000000000000000000000000000000 --- a/sflphone-gtk/src/addressbook-config.c +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (C) 2009 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "addressbook-config.h" - -AddressBook_Config *addressbook_config; - -void addressbook_load_parameters (AddressBook_Config **settings) { - - GHashTable *_params = NULL; - AddressBook_Config *_settings; - - // Allocate a struct - _settings = g_new0 (AddressBook_Config, 1); - - // Fetch the settings from D-Bus - _params = (GHashTable*) dbus_get_addressbook_settings (); - - if (_params == NULL) { - _settings->max_results = 30; - _settings->display_contact_photo = 0; - _settings->search_phone_business = 1; - _settings->search_phone_home = 1; - _settings->search_phone_mobile = 1; - } - else { - _settings->max_results = (guint)(g_hash_table_lookup (_params, ADDRESSBOOK_MAX_RESULTS)); - _settings->display_contact_photo = (guint) (g_hash_table_lookup (_params, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO)); - _settings->search_phone_business = (guint) (g_hash_table_lookup (_params, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS)); - _settings->search_phone_home = (guint) (g_hash_table_lookup (_params, ADDRESSBOOK_DISPLAY_PHONE_HOME)); - _settings->search_phone_mobile = (guint) (g_hash_table_lookup (_params, ADDRESSBOOK_DISPLAY_PHONE_MOBILE)); - } - - *settings = _settings; -} - -void addressbook_save_parameters (void) { - - GHashTable *params = NULL; - - params = g_hash_table_new (NULL, g_str_equal); - g_hash_table_replace (params, (gpointer)ADDRESSBOOK_MAX_RESULTS, (gpointer)addressbook_config->max_results); - g_hash_table_replace (params, (gpointer)ADDRESSBOOK_DISPLAY_CONTACT_PHOTO, (gpointer)addressbook_config->display_contact_photo); - g_hash_table_replace (params, (gpointer)ADDRESSBOOK_DISPLAY_PHONE_BUSINESS, (gpointer)addressbook_config->search_phone_business); - g_hash_table_replace (params, (gpointer)ADDRESSBOOK_DISPLAY_PHONE_HOME, (gpointer)addressbook_config->search_phone_home); - g_hash_table_replace (params, (gpointer)ADDRESSBOOK_DISPLAY_PHONE_MOBILE, (gpointer)addressbook_config->search_phone_mobile); - - dbus_set_addressbook_settings (params); - - // Decrement the reference count - g_hash_table_unref (params); -} - -static void max_results_cb (GtkRange* scale) { - - addressbook_config->max_results = (guint) gtk_range_get_value (GTK_RANGE (scale)); -} - -static void display_contact_photo_cb (GtkWidget *widget) { - - addressbook_config->display_contact_photo = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); -} - -static void search_phone_business_cb (GtkWidget *widget) { - - addressbook_config->search_phone_business = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); -} - -static void search_phone_home_cb (GtkWidget *widget) { - - addressbook_config->search_phone_home = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); -} - -static void search_phone_mobile_cb (GtkWidget *widget) { - - addressbook_config->search_phone_mobile = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); -} - -GtkWidget* create_addressbook_settings () { - - GtkWidget *ret, *result_frame, *table, *value, *label, *photo, *item; - - // Load the user value - addressbook_load_parameters (&addressbook_config); - - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - - result_frame = gtk_frame_new(_("Search Parameters")); - gtk_box_pack_start(GTK_BOX(ret), result_frame, FALSE, FALSE, 0); - gtk_widget_show (result_frame); - - table = gtk_table_new ( 5, 3, FALSE/* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_widget_show(table); - gtk_container_add( GTK_CONTAINER (result_frame) , table ); - - // SCALE BUTTON - NUMBER OF RESULTS - label = gtk_label_new (_("Maximum result number for a request: ")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); - value = gtk_hscale_new_with_range (25.0 , 50.0 , 5.0); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), value); - gtk_scale_set_digits (GTK_SCALE(value) , 0); - gtk_scale_set_value_pos (GTK_SCALE(value) , GTK_POS_RIGHT); - gtk_range_set_value (GTK_RANGE( value ) , addressbook_config->max_results); - g_signal_connect (G_OBJECT (value) , "value-changed" , G_CALLBACK(max_results_cb), NULL ); - gtk_table_attach ( GTK_TABLE( table ), value, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - // PHOTO DISPLAY - photo = gtk_check_button_new_with_mnemonic( _("_Display contact photo if available")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(photo), addressbook_config->display_contact_photo); - g_signal_connect (G_OBJECT(photo) , "clicked" , G_CALLBACK (display_contact_photo_cb), NULL); - gtk_table_attach ( GTK_TABLE( table ), photo, 0, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - label = gtk_label_new (_("Search for and display: ")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - item = gtk_check_button_new_with_mnemonic( _("_Business phone")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(item), addressbook_config->search_phone_business); - g_signal_connect (G_OBJECT(item) , "clicked" , G_CALLBACK (search_phone_business_cb) , NULL); - gtk_table_attach ( GTK_TABLE( table ), item, 1, 3, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - item = gtk_check_button_new_with_mnemonic( _("_Home phone")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(item), addressbook_config->search_phone_home); - g_signal_connect (G_OBJECT(item) , "clicked" , G_CALLBACK (search_phone_home_cb) , NULL); - gtk_table_attach ( GTK_TABLE( table ), item, 1, 3, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - item = gtk_check_button_new_with_mnemonic( _("_Mobile phone")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(item), addressbook_config->search_phone_mobile); - g_signal_connect (G_OBJECT(item) , "clicked" , G_CALLBACK (search_phone_mobile_cb) , NULL); - gtk_table_attach ( GTK_TABLE( table ), item, 1, 3, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); - - gtk_widget_show_all(ret); - - return ret; - -} - -gboolean addressbook_display (AddressBook_Config *settings, const gchar *field) { - - gboolean display = FALSE; - - if (g_strcasecmp (field, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO) == 0) - display = (settings->display_contact_photo == 1)? TRUE : FALSE; - - else if (g_strcasecmp (field, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS) == 0) - display = (settings->search_phone_business == 1)? TRUE : FALSE; - - else if (g_strcasecmp (field, ADDRESSBOOK_DISPLAY_PHONE_HOME) == 0) - display = (settings->search_phone_home == 1)? TRUE : FALSE; - - else if (g_strcasecmp (field, ADDRESSBOOK_DISPLAY_PHONE_MOBILE) == 0) - display = (settings->search_phone_mobile == 1)? TRUE : FALSE; - - else - display = FALSE; - - return display; -} diff --git a/sflphone-gtk/src/assistant.c b/sflphone-gtk/src/assistant.c index 97fbf8405859cda31e4e7e01cc651f658dee7257..b2d7c8fe6f52316f03f54e21090ea5a7cba845bb 100644 --- a/sflphone-gtk/src/assistant.c +++ b/sflphone-gtk/src/assistant.c @@ -6,7 +6,7 @@ * 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 @@ -22,7 +22,11 @@ #include <assistant.h> #include "reqaccount.h" +// From version 2.16, gtk provides the functionalities libsexy used to provide +#if GTK_CHECK_VERSION(2,16,0) +#else #include <libsexy/sexy-icon-entry.h> +#endif #if GTK_CHECK_VERSION(2,10,0) @@ -50,7 +54,7 @@ void prefill_sip(void) ; void set_account_type( GtkWidget* widget , gpointer data UNUSED ) { if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( widget )) ){ account_type = _SIP; - }else{ + }else{ account_type = _IAX ; } } @@ -101,7 +105,7 @@ static void sip_apply_callback( void ) { dbus_add_account( current ); account_list_set_current_id( current->accountID ); - sprintf(message, MESSAGE_SUMMARY, + sprintf(message, MESSAGE_SUMMARY, gtk_entry_get_text (GTK_ENTRY(wiz->sip_alias)), gtk_entry_get_text (GTK_ENTRY(wiz->sip_server)), gtk_entry_get_text (GTK_ENTRY(wiz->sip_username)), @@ -126,7 +130,7 @@ static void iax_apply_callback( void ) { g_hash_table_insert(current->properties, g_strdup(ACCOUNT_PASSWORD), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(wiz->iax_password)))); dbus_add_account( current ); account_list_set_current_id( current->accountID ); - sprintf(message, MESSAGE_SUMMARY, + sprintf(message, MESSAGE_SUMMARY, gtk_entry_get_text (GTK_ENTRY(wiz->iax_alias)), gtk_entry_get_text (GTK_ENTRY(wiz->iax_server)), gtk_entry_get_text (GTK_ENTRY(wiz->iax_username)), @@ -165,7 +169,7 @@ void build_wizard( void ) { build_summary(); g_signal_connect(G_OBJECT(wiz->assistant), "close" , G_CALLBACK(close_callback), NULL); - + g_signal_connect(G_OBJECT(wiz->assistant), "cancel" , G_CALLBACK(cancel_callback), NULL); gtk_widget_show_all(wiz->assistant); @@ -177,7 +181,7 @@ void build_wizard( void ) { GtkWidget* build_intro() { GtkWidget *label; - wiz->intro = create_vbox( GTK_ASSISTANT_PAGE_INTRO , _("SFLphone 0.9.3") , _("Welcome to SFLphone!")); + wiz->intro = create_vbox( GTK_ASSISTANT_PAGE_INTRO , "SFLphone 0.9.4" , _("Welcome to SFLphone!")); label = gtk_label_new(_("This installation wizard will help you configure an account.")) ; gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); @@ -198,9 +202,9 @@ GtkWidget* build_select_account() { gtk_box_pack_start( GTK_BOX(wiz->protocols) , sip , TRUE, TRUE, 0); iax = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(sip), "IAX2 (InterAsterix Exchange)"); gtk_box_pack_start( GTK_BOX(wiz->protocols) , iax , TRUE, TRUE, 0); - + g_signal_connect(G_OBJECT( sip ) , "clicked" , G_CALLBACK( set_account_type ) , NULL ); - + gtk_assistant_set_page_complete(GTK_ASSISTANT(wiz->assistant), wiz->protocols, TRUE); return wiz->protocols; } @@ -217,7 +221,7 @@ GtkWidget* build_sfl_or_account() { cus = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(sfl), _("Register an existing SIP or IAX2 account")); gtk_box_pack_start( GTK_BOX(wiz->sflphone_org) , cus , TRUE, TRUE, 0); g_signal_connect(G_OBJECT( sfl ) , "clicked" , G_CALLBACK( set_sflphone_org ) , NULL ); - + return wiz->sflphone_org; } @@ -227,13 +231,13 @@ GtkWidget* build_sip_account_configuration( void ) { GtkWidget* label; GtkWidget* image; - wiz->sip_account = create_vbox( GTK_ASSISTANT_PAGE_CONTENT , _("SIP account configuration") , _("Please fill the following information:")); + wiz->sip_account = create_vbox( GTK_ASSISTANT_PAGE_CONTENT , _("SIP account configuration") , _("Please fill the following information:")); // table table = gtk_table_new ( 4, 2 , FALSE/* homogeneous */); gtk_table_set_row_spacings( GTK_TABLE(table), 10); gtk_table_set_col_spacings( GTK_TABLE(table), 10); gtk_box_pack_start( GTK_BOX(wiz->sip_account) , table , TRUE, TRUE, 0); - + // alias field label = gtk_label_new_with_mnemonic (_("_Alias")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); @@ -241,7 +245,7 @@ GtkWidget* build_sip_account_configuration( void ) { wiz->sip_alias = gtk_entry_new(); gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_alias); gtk_table_attach ( GTK_TABLE( table ), wiz->sip_alias, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + // server field label = gtk_label_new_with_mnemonic (_("_Host name")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); @@ -249,28 +253,38 @@ GtkWidget* build_sip_account_configuration( void ) { wiz->sip_server = gtk_entry_new(); gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_server); gtk_table_attach ( GTK_TABLE( table ), wiz->sip_server, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + // username field label = gtk_label_new_with_mnemonic (_("_User name")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); +#if GTK_CHECK_VERSION(2,16,0) + wiz->sip_username = gtk_entry_new(); + gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (wiz->sip_username), GTK_ENTRY_ICON_PRIMARY, gdk_pixbuf_new_from_file(ICONS_DIR "/stock_person.svg", NULL)); +#else wiz->sip_username = sexy_icon_entry_new(); image = gtk_image_new_from_file( ICONS_DIR "/stock_person.svg" ); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(wiz->sip_username), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(wiz->sip_username), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); +#endif gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_username); gtk_table_attach ( GTK_TABLE( table ), wiz->sip_username, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + // password field label = gtk_label_new_with_mnemonic (_("_Password")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); +#if GTK_CHECK_VERSION(2,16,0) + wiz->sip_password = gtk_entry_new(); + gtk_entry_set_icon_from_stock (GTK_ENTRY (wiz->sip_password), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_DIALOG_AUTHENTICATION); +#else wiz->sip_password = sexy_icon_entry_new(); image = gtk_image_new_from_stock( GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR ); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(wiz->sip_password), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(wiz->sip_password), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); +#endif gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->sip_password); gtk_entry_set_visibility(GTK_ENTRY(wiz->sip_password), FALSE); gtk_table_attach ( GTK_TABLE( table ), wiz->sip_password, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + //gtk_assistant_set_page_complete(GTK_ASSISTANT(wiz->assistant), wiz->sip_account, TRUE); return wiz->sip_account; } @@ -279,13 +293,13 @@ GtkWidget* build_email_configuration( void ) { GtkWidget* label; GtkWidget* table; - wiz->email = create_vbox( GTK_ASSISTANT_PAGE_CONTENT , _("Optional Email Address ") , _("This email address will be use to send your voicemail messages")); + wiz->email = create_vbox( GTK_ASSISTANT_PAGE_CONTENT , _("Optional Email Address ") , _("This email address will be use to send your voicemail messages")); table = gtk_table_new ( 4, 2 , FALSE/* homogeneous */); gtk_table_set_row_spacings( GTK_TABLE(table), 10); gtk_table_set_col_spacings( GTK_TABLE(table), 10); gtk_box_pack_start( GTK_BOX(wiz->email) , table , TRUE, TRUE, 0); - + // email field label = gtk_label_new_with_mnemonic (_("_Email")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); @@ -296,19 +310,19 @@ GtkWidget* build_email_configuration( void ) { return wiz->email; } - + GtkWidget* build_iax_account_configuration( void ) { GtkWidget* label; GtkWidget* table; GtkWidget* image; - wiz->iax_account = create_vbox( GTK_ASSISTANT_PAGE_CONFIRM , _("IAX2 account configuration") , _("Please fill the following information:")); - + wiz->iax_account = create_vbox( GTK_ASSISTANT_PAGE_CONFIRM , _("IAX2 account configuration") , _("Please fill the following information:")); + table = gtk_table_new ( 4, 2 , FALSE/* homogeneous */); gtk_table_set_row_spacings( GTK_TABLE(table), 10); gtk_table_set_col_spacings( GTK_TABLE(table), 10); gtk_box_pack_start( GTK_BOX(wiz->iax_account) , table , TRUE, TRUE, 0); - + // alias field label = gtk_label_new_with_mnemonic (_("_Alias")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); @@ -316,7 +330,7 @@ GtkWidget* build_iax_account_configuration( void ) { wiz->iax_alias = gtk_entry_new(); gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_alias); gtk_table_attach ( GTK_TABLE( table ), wiz->iax_alias, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + // server field label = gtk_label_new_with_mnemonic (_("_Host name")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); @@ -324,30 +338,41 @@ GtkWidget* build_iax_account_configuration( void ) { wiz->iax_server = gtk_entry_new(); gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_server); gtk_table_attach ( GTK_TABLE( table ), wiz->iax_server, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + // username field label = gtk_label_new_with_mnemonic (_("_User name")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); +#if GTK_CHECK_VERSION(2,16,0) + wiz->iax_username = gtk_entry_new(); + gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (wiz->iax_username), GTK_ENTRY_ICON_PRIMARY, gdk_pixbuf_new_from_file(ICONS_DIR "/stock_person.svg", NULL)); +#else wiz->iax_username = sexy_icon_entry_new(); - image = gtk_image_new_from_stock( GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR ); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(wiz->iax_username), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + image = gtk_image_new_from_file( ICONS_DIR "/stock_person.svg" ); + sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(wiz->iax_username), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); +#endif gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_username); gtk_table_attach ( GTK_TABLE( table ), wiz->iax_username, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - + // password field label = gtk_label_new_with_mnemonic (_("_Password")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); +#if GTK_CHECK_VERSION(2,16,0) + wiz->iax_password = gtk_entry_new(); + gtk_entry_set_icon_from_stock (GTK_ENTRY (wiz->iax_password), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_DIALOG_AUTHENTICATION); +#else wiz->iax_password = sexy_icon_entry_new(); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(wiz->iax_password), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + image = gtk_image_new_from_stock( GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR ); + sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(wiz->iax_password), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); +#endif gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->iax_password); gtk_entry_set_visibility(GTK_ENTRY(wiz->iax_password), FALSE); gtk_table_attach ( GTK_TABLE( table ), wiz->iax_password, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - + + current -> state = ACCOUNT_STATE_UNREGISTERED; - + g_signal_connect( G_OBJECT( wiz->assistant ) , "apply" , G_CALLBACK( iax_apply_callback ), NULL); return wiz->iax_account; @@ -356,22 +381,22 @@ GtkWidget* build_iax_account_configuration( void ) { GtkWidget* build_nat_settings( void ) { GtkWidget* label; GtkWidget* table; - - wiz->nat = create_vbox( GTK_ASSISTANT_PAGE_CONFIRM , _("Network Address Translation") , _("You should probably enable this if you are behind a firewall.")); - + + wiz->nat = create_vbox( GTK_ASSISTANT_PAGE_CONFIRM , _("Network Address Translation") , _("You should probably enable this if you are behind a firewall.")); + // table table = gtk_table_new ( 2, 2 , FALSE/* homogeneous */); gtk_table_set_row_spacings( GTK_TABLE(table), 10); gtk_table_set_col_spacings( GTK_TABLE(table), 10); gtk_box_pack_start( GTK_BOX(wiz->nat), table , TRUE, TRUE, 0); - + // enable wiz->enable = gtk_check_button_new_with_mnemonic(_("E_nable STUN")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wiz->enable), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wiz->enable), FALSE); gtk_table_attach ( GTK_TABLE( table ), wiz->enable, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_set_sensitive( GTK_WIDGET( wiz->enable ) , TRUE ); g_signal_connect( G_OBJECT( GTK_TOGGLE_BUTTON(wiz->enable)) , "toggled" , G_CALLBACK( enable_stun ), NULL); - + // server address label = gtk_label_new_with_mnemonic (_("_STUN server")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); @@ -380,9 +405,9 @@ GtkWidget* build_nat_settings( void ) { gtk_label_set_mnemonic_widget (GTK_LABEL (label), wiz->addr); gtk_table_attach ( GTK_TABLE( table ), wiz->addr, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_set_sensitive( GTK_WIDGET( wiz->addr ), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wiz->enable))); - + g_signal_connect( G_OBJECT( wiz->assistant ) , "apply" , G_CALLBACK( sip_apply_callback ), NULL); - + return wiz->nat; } @@ -396,20 +421,20 @@ GtkWidget* build_summary() { gtk_label_set_line_wrap(GTK_LABEL(wiz->label_summary), TRUE); //gtk_widget_set_size_request(GTK_WIDGET(wiz->label_summary), 380, -1); gtk_box_pack_start(GTK_BOX(wiz->summary), wiz->label_summary, FALSE, TRUE, 0); - + return wiz->summary; } GtkWidget* build_registration_error() { GtkWidget *label; wiz->reg_failed = create_vbox( GTK_ASSISTANT_PAGE_SUMMARY , "Account Registration" , "Registration error"); - + label = gtk_label_new(" Please correct the information.") ; gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_widget_set_size_request(GTK_WIDGET(label), 380, -1); gtk_box_pack_start(GTK_BOX(wiz->reg_failed), label, FALSE, TRUE, 0); - + return wiz->reg_failed; } @@ -450,7 +475,7 @@ typedef enum { PAGE_SUMMARY } assistant_state; -static gint forward_page_func( gint current_page , gpointer data) { +static gint forward_page_func( gint current_page , gpointer data UNUSED) { gint next_page = 0; switch( current_page ){ @@ -461,32 +486,32 @@ static gint forward_page_func( gint current_page , gpointer data) { if (use_sflphone_org) { next_page = PAGE_EMAIL; } else - next_page = PAGE_TYPE; + next_page = PAGE_TYPE; break; case PAGE_TYPE: if( account_type == _SIP ) { set_sip_infos_sentivite(TRUE); - next_page = PAGE_SIP; + next_page = PAGE_SIP; } else - next_page = PAGE_IAX; + next_page = PAGE_IAX; break; - case PAGE_SIP: - next_page = PAGE_STUN; + case PAGE_SIP: + next_page = PAGE_STUN; break; - case PAGE_EMAIL: - next_page = PAGE_STUN; + case PAGE_EMAIL: + next_page = PAGE_STUN; break; case PAGE_STUN: - next_page = PAGE_SUMMARY; + next_page = PAGE_SUMMARY; break; case PAGE_IAX: - next_page = PAGE_SUMMARY; + next_page = PAGE_SUMMARY; break; case PAGE_SUMMARY: - next_page = PAGE_SUMMARY; + next_page = PAGE_SUMMARY; break; default: - next_page = -1; + next_page = -1; } return next_page; } @@ -499,7 +524,7 @@ static GtkWidget* create_vbox(GtkAssistantPageType type, const gchar *title, con vbox = gtk_vbox_new(FALSE, 6); gtk_container_set_border_width(GTK_CONTAINER(vbox), 24); - + gtk_assistant_append_page(GTK_ASSISTANT(wiz->assistant), vbox); gtk_assistant_set_page_type(GTK_ASSISTANT(wiz->assistant), vbox, type); str = g_strdup_printf(" %s", title); @@ -508,7 +533,7 @@ static GtkWidget* create_vbox(GtkAssistantPageType type, const gchar *title, con g_free(str); gtk_assistant_set_page_complete(GTK_ASSISTANT(wiz->assistant), vbox, TRUE); - + wiz->logo = gdk_pixbuf_new_from_file(ICONS_DIR "/sflphone.png", NULL); gtk_assistant_set_page_header_image(GTK_ASSISTANT(wiz->assistant),vbox, wiz->logo); g_object_unref(wiz->logo); @@ -524,4 +549,4 @@ static GtkWidget* create_vbox(GtkAssistantPageType type, const gchar *title, con return vbox; } -#endif // GTK_CHECK_VERSION +#endif // GTK_CHECK_VERSION diff --git a/sflphone-gtk/src/call.c b/sflphone-gtk/src/call.c new file mode 100644 index 0000000000000000000000000000000000000000..5ab52ee258452e52d2dd907cb93f90ceee3198d4 --- /dev/null +++ b/sflphone-gtk/src/call.c @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <call.h> + +/* GCompareFunc to compare a callID (gchar* and a call_t) */ +gint +is_callID_callstruct ( gconstpointer a, gconstpointer b) +{ + call_t * c = (call_t*)a; + if(g_strcasecmp(c->callID, (const gchar*) b) == 0) + { + return 0; + } + else + { + return 1; + } +} + +/* GCompareFunc to get current call (gchar* and a call_t) */ +gint +get_state_callstruct ( gconstpointer a, gconstpointer b) +{ + call_t * c = (call_t*)a; + if( c->state == *((call_state_t*)b)) + { + return 0; + } + else + { + return 1; + } +} + +gchar * +call_get_name (const call_t * c) +{ + gchar * end = g_strrstr(c->from, "\""); + if (!end) { + return g_strndup(c->from, 0); + } else { + gchar * name = c->from +1; + return g_strndup(name, end - name); + } +} + +gchar * +call_get_number (const call_t * c) +{ + gchar * number = g_strrstr(c->from, "<") + 1; + gchar * end = g_strrstr(c->from, ">"); + number = g_strndup(number, end - number ); + return number; +} + +gchar * +call_get_recipient( const call_t * c ) +{ + return c->to; +} + +void create_new_call (gchar *to, gchar *from, call_state_t state, gchar *accountID, call_t **new_call) { + + gchar *call_id; + call_t *call; + + call = g_new0 (call_t, 1); + call->to = g_strdup (to); + call->from = g_strdup (from); + call->state = state; + call->accountID = g_strdup (accountID); + call->_start = 0; + call->_stop = 0; + + call_id = g_new0(gchar, 30); + g_sprintf(call_id, "%d", rand()); + call->callID = g_strdup (call_id); + + *new_call = call; +} + +void create_new_call_from_details (const gchar *call_id, GHashTable *details, call_t **call) +{ + gchar *from, *to, *accountID; + call_t *new_call; + // GHashTable *call_details; + + accountID = g_hash_table_lookup (details, "ACCOUNTID"); + to = g_hash_table_lookup (details, "PEER_NUMBER"); + from = g_markup_printf_escaped("\"\" <%s>", to); + + create_new_call (from, from, CALL_STATE_DIALING, accountID, &new_call); + *call = new_call; +} + + + void +free_call_t (call_t *c) +{ + g_free (c->callID); + g_free (c->accountID); + g_free (c->from); + g_free (c->to); + g_free (c); +} + +void attach_thumbnail (call_t *call, GdkPixbuf *pixbuf) { + call->contact_thumbnail = pixbuf; +} diff --git a/sflphone-gtk/src/calllist.h b/sflphone-gtk/src/call.h similarity index 51% rename from sflphone-gtk/src/calllist.h rename to sflphone-gtk/src/call.h index a4f63806eba764779f2b7646027b7e2b116d7cb3..b32ba9920ce0a95ca27853e6b982bccca77f08c7 100644 --- a/sflphone-gtk/src/calllist.h +++ b/sflphone-gtk/src/call.h @@ -1,6 +1,6 @@ /* - * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 @@ -17,14 +17,47 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef __CALLLIST_H__ -#define __CALLLIST_H__ +#ifndef __CALLL_H__ +#define __CALLL_H__ #include <gtk/gtk.h> +#include <glib/gprintf.h> +#include <stdlib.h> + +/** + * @enum history_state + * This enum have all the state a call can take in the history + */ +typedef enum +{ + NONE, + INCOMING, + OUTGOING, + MISSED +} history_state_t; + +/** + * @enum contact_type + * This enum have all types of contacts: HOME phone, cell phone, etc... + */ +typedef enum +{ + CONTACT_PHONE_HOME, + CONTACT_PHONE_BUSINESS, + CONTACT_PHONE_MOBILE +} contact_type_t; + +/** + * @enum call_type + * This enum have all types of call + */ +typedef enum +{ + CALL, + HISTORY, + CONTACT +} call_type_t; -/** @file calllist.h - * @brief A list to hold calls. - */ /** @enum call_state_t * This enum have all the states a call can take. @@ -52,39 +85,6 @@ typedef enum CALL_STATE_RECORD } call_state_t; -/** - * @enum history_state - * This enum have all the state a call can take in the history - */ -typedef enum -{ - NONE, - INCOMING, - OUTGOING, - MISSED -} history_state_t; - -/** - * @enum call_type - * This enum have all types of call - */ -typedef enum -{ - CALL, - HISTORY, - CONTACT -} call_type_t; - -/** - * @enum contact_type - * This enum have all types of contacts: HOME phone, cell phone, etc... - */ -typedef enum -{ - CONTACT_PHONE_HOME, - CONTACT_PHONE_BUSINESS, - CONTACT_PHONE_MOBILE -} contact_type_t; /** @struct call_t * @brief Call information. @@ -114,102 +114,42 @@ typedef struct { } call_t; -typedef struct { - GtkListStore* store; - GtkWidget* view; - GtkWidget* tree; - - GtkWidget* searchbar; - // GtkTreeModel* histfilter; - - // Calllist vars - GQueue* callQueue; - call_t* selectedCall; -} calltab_t; - -calltab_t* current_calls; -calltab_t* history; -calltab_t* contacts; -/** This function initialize a call list. */ -void call_list_init (calltab_t* tab); +/* GCompareFunc to compare a callID (gchar* and a call_t) */ +gint +is_callID_callstruct ( gconstpointer, gconstpointer); -/** This function empty and free the call list. */ -void call_list_clean(calltab_t* tab); - -/** This function empty, free the call list and allocate a new one. */ -void call_list_reset (calltab_t* tab); - -/** Get the maximun number of calls in the history calltab */ -gdouble call_history_get_max_calls( void ); - -/** Set the maximun number of calls in the history calltab */ -void call_history_set_max_calls( const gdouble number ); - -/** This function append a call to list. - * @param c The call you want to add - * */ -void call_list_add (calltab_t* tab, call_t * c); - -/** This function remove a call from list. - * @param callID The callID of the call you want to remove - */ -void call_list_remove (calltab_t* tab, const gchar * callID); - -/** Return the first call that corresponds to the state. - * This is usefull for unique states as DIALING and CURRENT. - * @param state The state - * @return A call or NULL */ -call_t * call_list_get_by_state (calltab_t* tab, call_state_t state); - -/** Return the number of calls in the list - * @return The number of calls in the list */ -guint call_list_get_size (calltab_t* tab); - -/** Return the call at the nth position in the list - * @param n The position of the call you want - * @return A call or NULL */ -call_t * call_list_get_nth (calltab_t* tab, guint n ); - -/** Return the call corresponding to the callID - * @param n The callID of the call you want - * @return A call or NULL */ -call_t * call_list_get (calltab_t* tab, const gchar * callID ); +/* GCompareFunc to get current call (gchar* and a call_t) */ +gint +get_state_callstruct ( gconstpointer, gconstpointer); /** This function parse the call_t.from field to return the name * @param c The call * @return The full name of the caller or an empty string */ -gchar * call_get_name ( const call_t * c); +gchar * +call_get_name (const call_t *); /** * This function parse the call_t.from field to return the number * @param c The call * @return The number of the caller */ -gchar * call_get_number (const call_t * c); +gchar * +call_get_number (const call_t *); -/** Mark a call as selected. There can be only one selected call. This call - * is the currently highlighted one in the list. - * @param c The call */ -void call_select (calltab_t* tab, call_t * c ); +gchar * +call_get_recipient( const call_t *); -/** Return the selected call. - * @return The number of the caller */ -call_t * call_get_selected (calltab_t* tab); +void +create_new_call (gchar *, gchar *, call_state_t, gchar *, call_t **); -/** - * Clean the history. Delete all calls - */ -void call_list_clean_history(); - -/** - * Remove one specified call from the history list - * @param c The call to remove - */ -void call_list_remove_from_history( call_t* c); +void +create_new_call_from_details (const gchar *, GHashTable *, call_t **); -void create_new_call (gchar *to, gchar *from, call_state_t state, gchar *accountID, call_t **new_call); +void +attach_thumbnail (call_t *, GdkPixbuf *); -void attach_thumbnail (call_t *call, GdkPixbuf *pixbuf); +void +free_call_t (call_t *c); #endif diff --git a/sflphone-gtk/src/calllist.c b/sflphone-gtk/src/calllist.c deleted file mode 100644 index 8bc082c668236e153a69a21b8709fc7145429f21..0000000000000000000000000000000000000000 --- a/sflphone-gtk/src/calllist.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.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 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <calllist.h> -#include <calltree.h> -#include <dbus.h> - -#include <glib/gprintf.h> - -/* - * GQueue * callQueue = NULL; - * call_t * selectedCall = NULL; - */ - -/* GCompareFunc to compare a callID (gchar* and a call_t) */ -gint -is_callID_callstruct ( gconstpointer a, gconstpointer b) -{ - call_t * c = (call_t*)a; - if(g_strcasecmp(c->callID, (const gchar*) b) == 0) - { - return 0; - } - else - { - return 1; - } -} - -/* GCompareFunc to get current call (gchar* and a call_t) */ -gint -get_state_callstruct ( gconstpointer a, gconstpointer b) -{ - call_t * c = (call_t*)a; - if( c->state == *((call_state_t*)b)) - { - return 0; - } - else - { - return 1; - } -} - -void -call_list_init (calltab_t* tab) -{ - tab->callQueue = g_queue_new (); - tab->selectedCall = NULL; -} - -void -call_list_clean (calltab_t* tab) -{ - g_queue_free (tab->callQueue); -} - -void -call_list_reset (calltab_t* tab) -{ - g_queue_free (tab->callQueue); - tab->callQueue = g_queue_new(); -} - -void -call_list_add (calltab_t* tab, call_t * c) -{ - if( tab == history ) - { - // First case: can still add calls to the list - if( call_list_get_size(tab) < dbus_get_max_calls() ) - { - g_queue_push_tail (tab->callQueue, (gpointer *) c); - update_call_tree_add( history , c ); - } - // List full -> Remove the last call from history and preprend the new call to the list - else - { - update_call_tree_remove( history , (call_t*)g_queue_pop_head( tab -> callQueue ) ); - g_queue_push_tail (tab->callQueue, (gpointer *) c); - update_call_tree_add( history , c ); - } - } - else - g_queue_push_tail (tab->callQueue, (gpointer *) c); -} - -void -call_list_clean_history( void ) -{ - unsigned int i; - guint size = call_list_get_size( history ); - g_print("history list size = %i\n", call_list_get_size( history )); - for( i = 0 ; i < size ; i++ ) - { - g_print("Delete calls"); - call_t* c = call_list_get_nth( history , i ); - // Delete the call from the call tree - g_print("Delete calls"); - update_call_tree_remove(history , c); - } - call_list_reset( history ); -} - -void -call_list_remove_from_history( call_t* c ) -{ - call_list_remove( history, c->callID ); - update_call_tree_remove( history, c ); - g_print("Size of history = %i\n" , call_list_get_size( history )); -} - -void -call_list_remove (calltab_t* tab, const gchar * callID) -{ - call_t * c = call_list_get(tab, callID); - if (c) - { - g_queue_remove(tab->callQueue, c); - } -} - - -call_t * -call_list_get_by_state (calltab_t* tab, call_state_t state ) -{ - GList * c = g_queue_find_custom (tab->callQueue, &state, get_state_callstruct); - if (c) - { - return (call_t *)c->data; - } - else - { - return NULL; - } - -} - -guint -call_list_get_size (calltab_t* tab) -{ - return g_queue_get_length (tab->callQueue); -} - -call_t * -call_list_get_nth (calltab_t* tab, guint n ) -{ - return g_queue_peek_nth (tab->callQueue, n); -} - -gchar * -call_get_name (const call_t * c) -{ - gchar * end = g_strrstr(c->from, "\""); - if (!end) { - return g_strndup(c->from, 0); - } else { - gchar * name = c->from +1; - return g_strndup(name, end - name); - } -} - -gchar * -call_get_number (const call_t * c) -{ - gchar * number = g_strrstr(c->from, "<") + 1; - gchar * end = g_strrstr(c->from, ">"); - number = g_strndup(number, end - number ); - return number; -} - -gchar * -call_get_recipient( const call_t * c ) -{ - return c->to; -} - - -call_t * -call_list_get (calltab_t* tab, const gchar * callID ) -{ - GList * c = g_queue_find_custom (tab->callQueue, callID, is_callID_callstruct); - if (c) - { - return (call_t *)c->data; - } - else - { - return NULL; - } -} - -void -call_select (calltab_t* tab, call_t * c ) -{ - tab->selectedCall = c; -} - - -call_t * -call_get_selected (calltab_t* tab) -{ - return tab->selectedCall; -} - -void create_new_call (gchar *to, gchar *from, call_state_t state, gchar *accountID, call_t **new_call) { - - gchar *call_id; - call_t *call; - - call = g_new0 (call_t, 1); - call->to = g_strdup (to); - call->from = g_strdup (from); - call->state = state; - call->accountID = g_strdup (accountID); - call->_start = 0; - call->_stop = 0; - - call_id = g_new0(gchar, 30); - g_sprintf(call_id, "%d", rand()); - call->callID = g_strdup (call_id); - - *new_call = call; -} - -void attach_thumbnail (call_t *call, GdkPixbuf *pixbuf) { - call->contact_thumbnail = pixbuf; -} diff --git a/sflphone-gtk/src/calltree.c b/sflphone-gtk/src/calltree.c deleted file mode 100644 index ab6cbfa05cc68149bd19ebc4d2a737e61d6fe65c..0000000000000000000000000000000000000000 --- a/sflphone-gtk/src/calltree.c +++ /dev/null @@ -1,1025 +0,0 @@ -/* - * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <stdlib.h> -#include <glib/gprintf.h> - -#include <gtk/gtk.h> -#include <actions.h> -#include <calltree.h> -#include <calllist.h> -#include <calltab.h> -#include <menus.h> -#include <dbus.h> -#include <contactlist/eds.h> -#include "addressbook-config.h" - -GtkWidget * toolbar; -GtkToolItem * pickupButton; -GtkToolItem * callButton; -GtkToolItem * hangupButton; -GtkToolItem * holdButton; -GtkToolItem * transfertButton; -GtkToolItem * unholdButton; -GtkToolItem * mailboxButton; -GtkToolItem * recButton; -GtkToolItem * historyButton; -GtkToolItem * contactButton; - -guint transfertButtonConnId; //The button toggled signal connection ID - -void -free_call_t (call_t *c) -{ - g_free (c->callID); - g_free (c->accountID); - g_free (c->from); - g_free (c->to); - g_free (c); -} - -/** - * Show popup menu - */ - static gboolean -popup_menu (GtkWidget *widget, - gpointer user_data UNUSED) -{ - show_popup_menu(widget, NULL); - return TRUE; -} - - static gboolean -is_inserted( GtkWidget* button ) -{ - return ( GTK_WIDGET(button)->parent == GTK_WIDGET( toolbar ) ); -} - - static gboolean -button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data UNUSED) -{ - if (event->button == 3 && event->type == GDK_BUTTON_PRESS) - { - if( active_calltree == current_calls ) - { - show_popup_menu(widget, event); - return TRUE; - } - else - { - show_popup_menu_history(widget, event); - return TRUE; - } - } - return FALSE; -} -/** - * Make a call - */ - static void -call_button( GtkWidget *widget UNUSED, gpointer data UNUSED) -{ - g_print("------ call_button ----- \n"); - call_t * selectedCall; - call_t* new_call; - gchar *to, *from; - - selectedCall = call_get_selected(active_calltree); - - if(call_list_get_size(current_calls)>0) - sflphone_pick_up(); - - else if(call_list_get_size(active_calltree) > 0){ - if( selectedCall) - { - printf("Calling a called num\n"); - - to = g_strdup(call_get_number(selectedCall)); - from = g_strconcat("\"\" <", call_get_number(selectedCall), ">",NULL); - - create_new_call (to, from, CALL_STATE_DIALING, "", &new_call); - - printf("call : from : %s to %s\n", new_call->from, new_call->to); - - call_list_add(current_calls, new_call); - update_call_tree_add(current_calls, new_call); - sflphone_place_call(new_call); - display_calltree (current_calls); - } - else - { - sflphone_new_call(); - display_calltree(current_calls); - } - } - else - { - sflphone_new_call(); - display_calltree(current_calls); - } -} - -/** - * Hang up the line - */ - static void -hang_up( GtkWidget *widget UNUSED, gpointer data UNUSED) -{ - sflphone_hang_up(); -} - -/** - * Hold the line - */ - static void -hold( GtkWidget *widget UNUSED, gpointer data UNUSED) -{ - sflphone_on_hold(); -} - -/** - * Transfert the line - */ - static void -transfert (GtkToggleToolButton *toggle_tool_button, - gpointer user_data UNUSED ) -{ - gboolean up = gtk_toggle_tool_button_get_active(toggle_tool_button); - if(up) - { - sflphone_set_transfert(); - } - else - { - sflphone_unset_transfert(); - } -} - -/** - * Unhold call - */ - static void -unhold( GtkWidget *widget UNUSED, gpointer data UNUSED) -{ - sflphone_off_hold(); -} - -static void toggle_button_cb (GtkToggleToolButton *widget, gpointer user_data) -{ - calltab_t * to_switch; - gboolean toggle; - - to_switch = (calltab_t*) user_data; - toggle = gtk_toggle_tool_button_get_active (widget); - - g_print ("%i\n", toggle); - - (toggle)? display_calltree (to_switch) : display_calltree (current_calls); -} - - -void create_new_entry_in_contactlist (gchar *contact_name, gchar *contact_phone, contact_type_t type, GdkPixbuf *photo){ - - gchar *from; - call_t *new_call; - GdkPixbuf *pixbuf; - - /* Check if the information is valid */ - if (g_strcasecmp (contact_phone, EMPTY_ENTRY) != 0){ - from = g_strconcat("\"" , contact_name, "\"<", contact_phone, ">", NULL); - create_new_call (from, from, CALL_STATE_DIALING, "", &new_call); - - // Attach a pixbuf to a contact - if (photo) { - attach_thumbnail (new_call, photo); - } - else { - switch (type) { - case CONTACT_PHONE_BUSINESS: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/face-monkey.svg", NULL); - break; - case CONTACT_PHONE_HOME: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/home.svg", NULL); - break; - case CONTACT_PHONE_MOBILE: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/users.svg", NULL); - break; - default: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/contact_default.svg", NULL); - break; - } - attach_thumbnail (new_call, pixbuf); - } - - call_list_add (contacts, new_call); - update_call_tree_add(contacts, new_call); - } -} - - static void -call_mailbox( GtkWidget* widget UNUSED, gpointer data UNUSED) -{ - account_t* current; - call_t *mailbox_call; - gchar *to, *from, *account_id; - - current = account_list_get_current (); - if( current == NULL ) // Should not happens - return; - - to = g_strdup(g_hash_table_lookup(current->properties, ACCOUNT_MAILBOX)); - from = g_markup_printf_escaped(_("\"Voicemail\" <%s>"), to); - account_id = g_strdup (current->accountID); - - create_new_call (to, from, CALL_STATE_DIALING, account_id, &mailbox_call); - g_print("TO : %s\n" , mailbox_call->to); - call_list_add( current_calls , mailbox_call ); - update_call_tree_add( current_calls , mailbox_call ); - update_menus(); - sflphone_place_call( mailbox_call ); - display_calltree(current_calls); -} - - - -/** - * Static rec_button - */ -static void -rec_button( GtkWidget *widget UNUSED, gpointer data UNUSED) -{ - sflphone_rec_call(); -} - - - void -toolbar_update_buttons () -{ - gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), FALSE); - gtk_widget_set_sensitive( GTK_WIDGET(holdButton), FALSE); - gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), FALSE); - gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton) , FALSE); - gtk_widget_set_sensitive( GTK_WIDGET(unholdButton), FALSE); - gtk_widget_set_sensitive( GTK_WIDGET(recButton), FALSE); - g_object_ref(holdButton); - g_object_ref(unholdButton); - if( is_inserted( GTK_WIDGET(holdButton) ) ) gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(holdButton)); - if( is_inserted( GTK_WIDGET(unholdButton) ) ) gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(unholdButton)); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), holdButton, 3); - g_object_ref(callButton); - g_object_ref(pickupButton); - if( is_inserted( GTK_WIDGET(callButton) ) ) gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); - if( is_inserted( GTK_WIDGET(pickupButton) ) ) gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(pickupButton)); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), callButton, 0); - //gtk_toolbar_insert(GTK_TOOLBAR(toolbar), recButton, 0); - - - gtk_signal_handler_block(GTK_OBJECT(transfertButton),transfertButtonConnId); - gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transfertButton), FALSE); - gtk_signal_handler_unblock(transfertButton, transfertButtonConnId); - - call_t * selectedCall = call_get_selected(active_calltree); - if (selectedCall) - { - switch(selectedCall->state) - { - case CALL_STATE_INCOMING: - gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - g_object_ref(callButton); - gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), pickupButton, 0); - break; - case CALL_STATE_HOLD: - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(unholdButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); - g_object_ref(holdButton); - gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(holdButton)); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), unholdButton, 3); - break; - case CALL_STATE_RINGING: - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); - break; - case CALL_STATE_DIALING: - if( active_calltree == current_calls ) gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE); - g_object_ref(callButton); - gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), pickupButton, 0); - break; - case CALL_STATE_CURRENT: - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(holdButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(recButton), TRUE); - break; - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - break; - case CALL_STATE_TRANSFERT: - gtk_signal_handler_block(GTK_OBJECT(transfertButton),transfertButtonConnId); - gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transfertButton), TRUE); - gtk_signal_handler_unblock(transfertButton, transfertButtonConnId); - gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(holdButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), TRUE); - break; - case CALL_STATE_RECORD: - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(holdButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(recButton), TRUE); - break; - default: - g_warning("Toolbar update - Should not happen!"); - break; - } - } - else - { - if( account_list_get_size() > 0 ) - { - gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE ); - gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton), TRUE ); - } - else - { - gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); - } - } -} - - - -/* Call back when the user click on a call in the list */ - static void -selected(GtkTreeSelection *sel, void* data UNUSED ) -{ - g_print("---- selected --- \n"); - GtkTreeIter iter; - GValue val; - GtkTreeModel *model = (GtkTreeModel*)active_calltree->store; - - if (! gtk_tree_selection_get_selected (sel, &model, &iter)) - return; - - val.g_type = 0; - gtk_tree_model_get_value (model, &iter, 2, &val); - - call_select(active_calltree, (call_t*) g_value_get_pointer(&val)); - g_value_unset(&val); - - toolbar_update_buttons(); -} - -/* A row is activated when it is double clicked */ -void row_activated(GtkTreeView *tree_view UNUSED, - GtkTreePath *path UNUSED, - GtkTreeViewColumn *column UNUSED, - void * data UNUSED) -{ - call_t* selectedCall; - call_t* new_call; - gchar *to, *from, *account_id; - - g_print("double click action\n"); - - selectedCall = call_get_selected( active_calltree ); - - if (selectedCall) - { - // Get the right event from the right calltree - if( active_calltree == current_calls ) - { - switch(selectedCall->state) - { - case CALL_STATE_INCOMING: - dbus_accept(selectedCall); - stop_notification(); - break; - case CALL_STATE_HOLD: - dbus_unhold(selectedCall); - break; - case CALL_STATE_RINGING: - case CALL_STATE_CURRENT: - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - break; - case CALL_STATE_DIALING: - sflphone_place_call (selectedCall); - break; - default: - g_warning("Row activated - Should not happen!"); - break; - } - } - - // If history or contact: double click action places a new call - else - { - to = g_strdup(call_get_number(selectedCall)); - from = g_strconcat("\"\" <", call_get_number(selectedCall), ">",NULL); - account_id = g_strdup (selectedCall->accountID); - - // Create a new call - create_new_call (to, from, CALL_STATE_DIALING, account_id, &new_call); - - call_list_add(current_calls, new_call); - update_call_tree_add(current_calls, new_call); - sflphone_place_call(new_call); - display_calltree(current_calls); - } - } -} - - GtkWidget * -create_toolbar () -{ - GtkWidget *ret; - GtkWidget *image; - - ret = gtk_toolbar_new(); - toolbar = ret; - - gtk_toolbar_set_orientation(GTK_TOOLBAR(ret), GTK_ORIENTATION_HORIZONTAL); - gtk_toolbar_set_style(GTK_TOOLBAR(ret), GTK_TOOLBAR_ICONS); - - image = gtk_image_new_from_file( ICONS_DIR "/call.svg"); - callButton = gtk_tool_button_new (image, _("Place a call")); -#if GTK_CHECK_VERSION(2,12,0) - gtk_widget_set_tooltip_text(GTK_WIDGET(callButton), _("Place a call")); -#endif - g_signal_connect (G_OBJECT (callButton), "clicked", - G_CALLBACK (call_button), NULL); - gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(callButton), -1); - - image = gtk_image_new_from_file( ICONS_DIR "/accept.svg"); - pickupButton = gtk_tool_button_new(image, _("Pick up")); -#if GTK_CHECK_VERSION(2,12,0) - gtk_widget_set_tooltip_text(GTK_WIDGET(pickupButton), _("Pick up")); -#endif - gtk_widget_set_state( GTK_WIDGET(pickupButton), GTK_STATE_INSENSITIVE); - g_signal_connect(G_OBJECT (pickupButton), "clicked", - G_CALLBACK (call_button), NULL); - gtk_widget_show_all(GTK_WIDGET(pickupButton)); - - image = gtk_image_new_from_file( ICONS_DIR "/hang_up.svg"); - hangupButton = gtk_tool_button_new (image, _("Hang up")); -#if GTK_CHECK_VERSION(2,12,0) - gtk_widget_set_tooltip_text(GTK_WIDGET(hangupButton), _("Hang up")); -#endif - gtk_widget_set_state( GTK_WIDGET(hangupButton), GTK_STATE_INSENSITIVE); - g_signal_connect (G_OBJECT (hangupButton), "clicked", - G_CALLBACK (hang_up), NULL); - gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(hangupButton), -1); - - image = gtk_image_new_from_file( ICONS_DIR "/unhold.svg"); - unholdButton = gtk_tool_button_new (image, _("Off Hold")); -#if GTK_CHECK_VERSION(2,12,0) - gtk_widget_set_tooltip_text(GTK_WIDGET(unholdButton), _("Off Hold")); -#endif - gtk_widget_set_state( GTK_WIDGET(unholdButton), GTK_STATE_INSENSITIVE); - g_signal_connect (G_OBJECT (unholdButton), "clicked", - G_CALLBACK (unhold), NULL); - //gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(unholdButton), -1); - gtk_widget_show_all(GTK_WIDGET(unholdButton)); - - image = gtk_image_new_from_file( ICONS_DIR "/hold.svg"); - holdButton = gtk_tool_button_new (image, _("On Hold")); -#if GTK_CHECK_VERSION(2,12,0) - gtk_widget_set_tooltip_text(GTK_WIDGET(holdButton), _("On Hold")); -#endif - gtk_widget_set_state( GTK_WIDGET(holdButton), GTK_STATE_INSENSITIVE); - g_signal_connect (G_OBJECT (holdButton), "clicked", - G_CALLBACK (hold), NULL); - gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(holdButton), -1); - - image = gtk_image_new_from_file( ICONS_DIR "/transfert.svg"); - transfertButton = gtk_toggle_tool_button_new (); - gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(transfertButton), image); -#if GTK_CHECK_VERSION(2,12,0) - gtk_widget_set_tooltip_text(GTK_WIDGET(transfertButton), _("Transfer")); -#endif - gtk_tool_button_set_label(GTK_TOOL_BUTTON(transfertButton), _("Transfer")); - gtk_widget_set_state( GTK_WIDGET(transfertButton), GTK_STATE_INSENSITIVE); - transfertButtonConnId = g_signal_connect (G_OBJECT (transfertButton), "toggled", - G_CALLBACK (transfert), NULL); - gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(transfertButton), -1); - - image = gtk_image_new_from_file( ICONS_DIR "/history2.svg"); - historyButton = gtk_toggle_tool_button_new(); - gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (historyButton), image); -#if GTK_CHECK_VERSION(2,12,0) - gtk_widget_set_tooltip_text(GTK_WIDGET(historyButton), _("History")); -#endif - gtk_tool_button_set_label (GTK_TOOL_BUTTON (historyButton), _("History")); - g_signal_connect (G_OBJECT (historyButton), "toggled", G_CALLBACK (toggle_button_cb), history); - gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(historyButton), -1); - active_calltree = current_calls; - - image = gtk_image_new_from_file( ICONS_DIR "/addressbook.svg"); - contactButton = gtk_toggle_tool_button_new(); - gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (contactButton), image); -#if GTK_CHECK_VERSION(2,12,0) - gtk_widget_set_tooltip_text(GTK_WIDGET(contactButton), _("Address book")); -#endif - gtk_tool_button_set_label (GTK_TOOL_BUTTON (contactButton), _("Address book")); - g_signal_connect (G_OBJECT (contactButton), "toggled", G_CALLBACK (toggle_button_cb), contacts); - gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(contactButton), -1); - - image = gtk_image_new_from_file( ICONS_DIR "/mailbox.svg"); - mailboxButton = gtk_tool_button_new( image , _("Voicemail")); - gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(mailboxButton), image); - if( account_list_get_size() ==0 ) gtk_widget_set_state( GTK_WIDGET(mailboxButton), GTK_STATE_INSENSITIVE ); -#if GTK_CHECK_VERSION(2,12,0) - gtk_widget_set_tooltip_text(GTK_WIDGET(mailboxButton), _("Voicemail")); -#endif - g_signal_connect (G_OBJECT (mailboxButton), "clicked", - G_CALLBACK (call_mailbox), NULL); - gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(mailboxButton), -1); - - recButton = gtk_tool_button_new_from_stock (GTK_STOCK_MEDIA_RECORD); -#if GTK_CHECK_VERSION(2,12,0) - gtk_widget_set_tooltip_text(GTK_WIDGET(recButton), _("Record a call")); -#endif - gtk_widget_set_state( GTK_WIDGET(recButton), GTK_STATE_INSENSITIVE); - g_signal_connect (G_OBJECT (recButton), "clicked", - G_CALLBACK (rec_button), NULL); - gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(recButton), -1); - - - return ret; - -} -static gboolean -on_key_released (GtkWidget *widget UNUSED, - GdkEventKey *event, - gpointer user_data UNUSED) -{ - // If a modifier key is pressed, it's a shortcut, pass along - if(event->state & GDK_CONTROL_MASK || - event->state & GDK_MOD1_MASK || - event->keyval == 60 || // < - event->keyval == 62 || // > - event->keyval == 34 || // " - event->keyval == 65361 || // left arrow - event->keyval == 65363 || // right arrow - event->keyval >= 65470 || // F-keys - event->keyval == 32 // space - ) - return FALSE; - else - sflphone_keypad(event->keyval, event->string); - return TRUE; -} - -/** - * Reset call tree - */ - void -reset_call_tree (calltab_t* tab) -{ - gtk_list_store_clear (tab->store); -} - - void - create_call_tree (calltab_t* tab, gchar* searchbar_type) -{ - GtkWidget *sw; - GtkCellRenderer *rend; - GtkTreeViewColumn *col; - GtkTreeSelection *sel; - - tab->tree = gtk_vbox_new(FALSE, 10); - - gtk_container_set_border_width (GTK_CONTAINER (tab->tree), 0); - - sw = gtk_scrolled_window_new( NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); - g_signal_connect (G_OBJECT ( sw ), "key-release-event",G_CALLBACK (on_key_released), NULL); - - tab->store = gtk_list_store_new (3, - GDK_TYPE_PIXBUF,// Icon - G_TYPE_STRING, // Description - G_TYPE_POINTER // Pointer to the Object - ); - - tab->view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(tab->store)); - gtk_tree_view_set_enable_search( GTK_TREE_VIEW(tab->view), FALSE); - gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(tab->view), FALSE); - g_signal_connect (G_OBJECT (tab->view), "row-activated", - G_CALLBACK (row_activated), - NULL); - - // Connect the popup menu - g_signal_connect (G_OBJECT (tab->view), "popup-menu", - G_CALLBACK (popup_menu), - NULL); - g_signal_connect (G_OBJECT (tab->view), "button-press-event", - G_CALLBACK (button_pressed), - NULL); - - - rend = gtk_cell_renderer_pixbuf_new(); - col = gtk_tree_view_column_new_with_attributes ("Icon", - rend, - "pixbuf", 0, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(tab->view), col); - - rend = gtk_cell_renderer_text_new(); - col = gtk_tree_view_column_new_with_attributes ("Description", - rend, - "markup", 1, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(tab->view), col); - - g_object_unref(G_OBJECT(tab->store)); - gtk_container_add(GTK_CONTAINER(sw), tab->view); - - sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tab->view)); - g_signal_connect (G_OBJECT (sel), "changed", - G_CALLBACK (selected), - NULL); - - gtk_box_pack_start(GTK_BOX(tab->tree), sw, TRUE, TRUE, 0); - - // no search bar if tab is either "history" or "addressbook" - if(searchbar_type){ - create_searchbar(tab,searchbar_type); - gtk_box_pack_start(GTK_BOX(tab->tree), tab->searchbar, FALSE, TRUE, 0); - } - - gtk_widget_show(tab->tree); - - - // gtk_widget_show(tab->searchbar); - - //toolbar_update_buttons(); - -} - - - - void -update_call_tree_remove (calltab_t* tab, call_t * c) -{ - GtkTreeIter iter; - GValue val; - call_t * iterCall; - GtkListStore* store = tab->store; - - int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); - int i; - for( i = 0; i < nbChild; i++) - { - if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i)) - { - val.g_type = 0; - gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter, 2, &val); - - iterCall = (call_t*) g_value_get_pointer(&val); - g_value_unset(&val); - - if(iterCall == c) - { - gtk_list_store_remove(store, &iter); - } - } - } - call_t * selectedCall = call_get_selected(tab); - if(selectedCall == c) - call_select(tab, NULL); - toolbar_update_buttons(); -} - - void -update_call_tree (calltab_t* tab, call_t * c) -{ - g_print("update call tree\n"); - GdkPixbuf *pixbuf=NULL; - GtkTreeIter iter; - GValue val; - call_t * iterCall; - GtkListStore* store = tab->store; - - int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); - int i; - for( i = 0; i < nbChild; i++) - { - if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i)) - { - val.g_type = 0; - gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter, 2, &val); - - iterCall = (call_t*) g_value_get_pointer(&val); - g_value_unset(&val); - - if(iterCall == c) - { - // Existing call in the list - gchar * description; - gchar * date=""; - gchar * duration=""; - if(c->state == CALL_STATE_TRANSFERT) - { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>Transfert to:</i> %s", - call_get_number(c), - call_get_name(c), - c->to); - } - else - { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", - call_get_number(c), - call_get_name(c)); - } - - if( tab == current_calls ) - { - switch(c->state) - { - case CALL_STATE_HOLD: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/hold.svg", NULL); - break; - case CALL_STATE_RINGING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); - break; - case CALL_STATE_CURRENT: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL); - break; - case CALL_STATE_DIALING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); - break; - case CALL_STATE_FAILURE: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/fail.svg", NULL); - break; - case CALL_STATE_BUSY: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/busy.svg", NULL); - break; - case CALL_STATE_TRANSFERT: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/transfert.svg", NULL); - break; - case CALL_STATE_RECORD: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/rec_call.svg", NULL); - break; - default: - g_warning("Update calltree - Should not happen!"); - } - } - else - { - switch(c->history_state) - { - case OUTGOING: - g_print("Outgoing state\n"); - pixbuf = gdk_pixbuf_new_from_file( ICONS_DIR "/outgoing.svg", NULL); - break; - case INCOMING: - g_print("Incoming state\n"); - pixbuf = gdk_pixbuf_new_from_file( ICONS_DIR "/incoming.svg", NULL); - break; - case MISSED: - g_print("Missed state\n"); - pixbuf = gdk_pixbuf_new_from_file( ICONS_DIR "/missed.svg", NULL); - break; - default: - g_print("No history state\n"); - break; - } - date = timestamp_get_call_date(); - duration = process_call_duration(c); - duration = g_strconcat( date , duration , NULL); - description = g_strconcat( description , duration, NULL); - } - //Resize it - if(pixbuf) - { - if(gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32) - { - pixbuf = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); - } - } - gtk_list_store_set(store, &iter, - 0, pixbuf, // Icon - 1, description, // Description - -1); - - if (pixbuf != NULL) - g_object_unref(G_OBJECT(pixbuf)); - - } - } - - } - toolbar_update_buttons(); -} - -void -create_searchbar(calltab_t* tab, gchar* searchbar_type) -{ - // g_strcmp0 returns 0 if str1 == str2 - if(g_strcmp0(searchbar_type,"history") == 0){ - - tab->searchbar = create_filter_entry_history(); - - } - - else if(g_strcmp0(searchbar_type,"contacts") == 0) - tab->searchbar = create_filter_entry_contact(); - -} - - void -update_call_tree_add (calltab_t* tab, call_t * c) -{ - if( tab == history && ( call_list_get_size( tab ) > dbus_get_max_calls() ) ) - return; - - GdkPixbuf *pixbuf=NULL; - GtkTreeIter iter; - GtkTreeSelection* sel; - - // New call in the list - gchar * description; - gchar * date=""; - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", - call_get_number(c), - call_get_name(c)); - - - gtk_list_store_prepend (tab->store, &iter); - - if( tab == current_calls ) - { - switch(c->state) - { - case CALL_STATE_INCOMING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); - break; - case CALL_STATE_DIALING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); - break; - case CALL_STATE_RINGING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); - break; - default: - g_warning("Update calltree add - Should not happen!"); - } - } - - else if (tab == history) { - switch(c->history_state) - { - case INCOMING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/incoming.svg", NULL); - break; - case OUTGOING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/outgoing.svg", NULL); - break; - case MISSED: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/missed.svg", NULL); - break; - default: - g_warning("History - Should not happen!"); - } - date = timestamp_get_call_date(); - description = g_strconcat( date , description , NULL); - } - - else if (tab == contacts) { - pixbuf = c->contact_thumbnail; - description = g_strconcat( description , NULL); - } - - else { - g_warning ("This widget doesn't exist - This is a bug in the application\n."); - } - - - //Resize it - if(pixbuf) - { - if(gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32) - { - pixbuf = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); - } - } - gtk_list_store_set(tab->store, &iter, - 0, pixbuf, // Icon - 1, description, // Description - 2, c, // Pointer - -1); - - if (pixbuf != NULL) - g_object_unref(G_OBJECT(pixbuf)); - - sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tab->view)); - gtk_tree_selection_select_iter(GTK_TREE_SELECTION(sel), &iter); - toolbar_update_buttons(); -} - -void display_calltree (calltab_t *tab) { - - GtkTreeSelection *sel; - - g_print ("display_calltree called\n"); - - /* If we already are displaying the specified calltree */ - if (active_calltree == tab) - return; - - /* case 1: we want to display the main calltree */ - if (tab==current_calls) { - - g_print ("display main tab\n"); - - if (active_calltree==contacts) { - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, FALSE); - } else { - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, FALSE); - } - - } - - /* case 2: we want to display the history */ - else if (tab==history) { - - g_print ("display history tab\n"); - - if (active_calltree==contacts) { - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, FALSE); - } - - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, TRUE); - } - - else if (tab==contacts) { - - g_print ("display contact tab\n"); - - if (active_calltree==history) { - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, FALSE); - } - - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, TRUE); - } - - else - g_print ("calltree.c line 1050 . This is probably a bug in the application\n"); - - - gtk_widget_hide (active_calltree->tree); - active_calltree = tab; - gtk_widget_show (active_calltree->tree); - - sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view)); - g_signal_emit_by_name(sel, "changed"); - toolbar_update_buttons(); - //gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(histfilter)); -} - - - - - - - - - - - - - - - - - - - - diff --git a/sflphone-gtk/src/codeclist.c b/sflphone-gtk/src/codeclist.c index 2227456746db1006de4a48565ab80b72530f6c47..1978022146ecc325eb38cc7c8d3b31fde4dcf1dc 100644 --- a/sflphone-gtk/src/codeclist.c +++ b/sflphone-gtk/src/codeclist.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.net> + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.net> * * 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 @@ -66,13 +66,13 @@ codec_list_add(codec_t * c) } -void +void codec_set_active(gchar* name) { codec_t * c = codec_list_get(name); if(c) { - printf("%s set active\n", c->name); + DEBUG("%s set active", c->name); c->is_active = TRUE; } } @@ -116,7 +116,7 @@ codec_set_prefered_order(guint index) } /** - * + * */ void codec_list_move_codec_up(guint index) @@ -126,16 +126,16 @@ codec_list_move_codec_up(guint index) gpointer codec = g_queue_pop_nth(codecQueue, index); g_queue_push_nth(codecQueue, codec, index-1); } - + // DEBUG unsigned int i; - printf("\nCodec list\n"); + DEBUG("Codec list"); for(i=0; i < codecQueue->length; i++) - printf("%s\n", codec_list_get_nth(i)->name); + DEBUG("%s", codec_list_get_nth(i)->name); } /** - * + * */ void codec_list_move_codec_down(guint index) @@ -148,29 +148,29 @@ codec_list_move_codec_down(guint index) // PRINT unsigned int i; - printf("\nCodec list\n"); + DEBUG("Codec list"); for(i=0; i < codecQueue->length; i++) - printf("%s\n", codec_list_get_nth(i)->name); + DEBUG("%s", codec_list_get_nth(i)->name); } /** - * + * */ void codec_list_update_to_daemon() { // String listing of all codecs payloads const gchar** codecList; - + // Length of the codec list int length = codecQueue->length; - + // Initiate double array char list for one string codecList = (void*)malloc(sizeof(void*)); - + // Get all codecs in queue int i, c = 0; - printf("List of active codecs :"); + DEBUG("List of active codecs :"); for(i = 0; i < length; i++) { codec_t* currentCodec = codec_list_get_nth(i); @@ -189,18 +189,16 @@ codec_list_update_to_daemon() // Put payload string in char array sprintf(payload, "%d", currentCodec->_payload); strcpy((char*)*(codecList+c), payload); - g_print(" %s", *(codecList+c)); + DEBUG(" %s", *(codecList+c)); c++; } } } - + // Allocate NULL array at the end for Dbus codecList = (void*)realloc(codecList, (c+1)*sizeof(void*)); *(codecList+c) = NULL; - printf("\n"); - // call dbus function with array of strings dbus_set_active_codec_list(codecList); diff --git a/sflphone-gtk/src/config/Makefile.am b/sflphone-gtk/src/config/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..8f8bbbc8abf9b634627cbcb1fbef63cd90fb0016 --- /dev/null +++ b/sflphone-gtk/src/config/Makefile.am @@ -0,0 +1,14 @@ +include ../../globals.mak + +noinst_LTLIBRARIES = libconfig.la + +libconfig_la_SOURCES = \ + addressbook-config.c \ + configwindow.c \ + accountwindow.c \ + hooks-config.c \ + audioconf.c + +libconfig_la_LDFLAGS = @DEPS_LDFLAGS@ + +libconfig_la_CFLAGS = @DEPS_CFLAGS@ diff --git a/sflphone-gtk/src/accountwindow.c b/sflphone-gtk/src/config/accountwindow.c similarity index 88% rename from sflphone-gtk/src/accountwindow.c rename to sflphone-gtk/src/config/accountwindow.c index 5e66e14587271f2d4ee8693dac0c130843040ef9..738318e82735eb22bc30070da02d86fd6cc59081 100644 --- a/sflphone-gtk/src/accountwindow.c +++ b/sflphone-gtk/src/config/accountwindow.c @@ -2,17 +2,17 @@ * Copyright (C) 2007-2008 Savoir-Faire Linux inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -22,9 +22,14 @@ #include <mainwindow.h> #include <accountlist.h> +// From version 2.16, gtk provides the functionalities libsexy used to provide +#if GTK_CHECK_VERSION(2,16,0) +#else #include <libsexy/sexy-icon-entry.h> +#endif + #include <string.h> -#include <dbus.h> +#include <dbus/dbus.h> #include <config.h> #include <gtk/gtk.h> @@ -52,13 +57,13 @@ change_protocol (account_t * currentAccount UNUSED) (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(entryProtocol)); } - int + int is_iax_enabled(void) { int res = dbus_is_iax2_enabled(); - if(res == 1) + if(res == 1) return TRUE; - else + else return FALSE; } @@ -123,7 +128,7 @@ show_account_window (account_t * a) gtk_container_add( GTK_CONTAINER( frame) , table ); -#ifdef DEBUG +#ifdef DEBUG label = gtk_label_new_with_mnemonic ("ID:"); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); @@ -132,11 +137,11 @@ show_account_window (account_t * a) gtk_entry_set_text(GTK_ENTRY(entryID), curAccountID); gtk_widget_set_sensitive( GTK_WIDGET(entryID), FALSE); gtk_table_attach ( GTK_TABLE( table ), entryID, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); -#endif +#endif entryEnabled = gtk_check_button_new_with_mnemonic(_("_Enabled")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(entryEnabled), - g_strcasecmp(curAccountEnabled,"TRUE") == 0 ? TRUE: FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(entryEnabled), + g_strcasecmp(curAccountEnabled,"TRUE") == 0 ? TRUE: FALSE); gtk_table_attach ( GTK_TABLE( table ), entryEnabled, 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_set_sensitive( GTK_WIDGET( entryEnabled ) , TRUE ); @@ -167,7 +172,7 @@ show_account_window (account_t * a) { /* Should never come here, add debug message. */ gtk_combo_box_append_text(GTK_COMBO_BOX(entryProtocol), _("Unknown")); - gtk_combo_box_set_active(GTK_COMBO_BOX(entryProtocol),2); + gtk_combo_box_set_active(GTK_COMBO_BOX(entryProtocol),2); } gtk_table_attach ( GTK_TABLE( table ), entryProtocol, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); @@ -187,10 +192,14 @@ show_account_window (account_t * a) label = gtk_label_new_with_mnemonic (_("_User name")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); +#if GTK_CHECK_VERSION(2,16,0) + entryUsername = gtk_entry_new(); + gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (entryUsername), GTK_ENTRY_ICON_PRIMARY, gdk_pixbuf_new_from_file(ICONS_DIR "/stock_person.svg", NULL)); +#else entryUsername = sexy_icon_entry_new(); - //image = gtk_image_new_from_stock( GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR ); image = gtk_image_new_from_file( ICONS_DIR "/stock_person.svg" ); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(entryUsername), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(entryUsername), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); +#endif gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryUsername); gtk_entry_set_text(GTK_ENTRY(entryUsername), curUsername); gtk_table_attach ( GTK_TABLE( table ), entryUsername, 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); @@ -198,9 +207,14 @@ show_account_window (account_t * a) label = gtk_label_new_with_mnemonic (_("_Password")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 7, 8, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); +#if GTK_CHECK_VERSION(2,16,0) + entryPassword = gtk_entry_new(); + gtk_entry_set_icon_from_stock (GTK_ENTRY (entryPassword), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_DIALOG_AUTHENTICATION); +#else entryPassword = sexy_icon_entry_new(); image = gtk_image_new_from_stock( GTK_STOCK_DIALOG_AUTHENTICATION , GTK_ICON_SIZE_SMALL_TOOLBAR ); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(entryPassword), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(entryPassword), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); +#endif gtk_entry_set_visibility(GTK_ENTRY(entryPassword), FALSE); gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryPassword); gtk_entry_set_text(GTK_ENTRY(entryPassword), curPassword); @@ -216,10 +230,10 @@ show_account_window (account_t * a) gtk_widget_show_all( table ); gtk_container_set_border_width (GTK_CONTAINER(table), 10); - + // Toggle enabled/disabled widgets if (strcmp(curAccountType, "SIP") == 0) { - //gtk_widget_set_sesitive( GTK_WIDGET(entryUserPart), TRUE);< + //gtk_widget_set_sesitive( GTK_WIDGET(entryUserPart), TRUE);< } else if (strcmp(curAccountType, "IAX") == 0) { //gtk_widget_set_sensitive( GTK_WIDGET(stunEnable), FALSE); @@ -235,32 +249,32 @@ show_account_window (account_t * a) { gchar* proto = (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(entryProtocol)); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_ENABLED), + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_ENABLED), g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entryEnabled)) ? "TRUE": "FALSE")); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_ALIAS), + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_ALIAS), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryAlias)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_TYPE), + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_TYPE), g_strdup(proto)); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_HOSTNAME), + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_HOSTNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryHostname)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_USERNAME), + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_USERNAME), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryUsername)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_PASSWORD), + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_PASSWORD), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryPassword)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_MAILBOX), + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_MAILBOX), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryMailbox)))); - if (strcmp(proto, "SIP") == 0) { + if (strcmp(proto, "SIP") == 0) { guint i, size; account_t * account; - gchar * stun_srv; + gchar * stun_srv; gchar * stun_enable; gboolean flag = FALSE; @@ -272,26 +286,26 @@ show_account_window (account_t * a) { stun_srv = g_hash_table_lookup(account->properties, ACCOUNT_SIP_STUN_SERVER); stun_enable = g_hash_table_lookup(account->properties, ACCOUNT_SIP_STUN_ENABLED); - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_SERVER), + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_SERVER), g_strdup(stun_srv)); - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED), + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED), g_strdup(stun_enable)); flag = TRUE; break; } } - + // Otherelse set a default value if(!flag) { g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_SERVER), (gchar*)""); - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED), + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED), "FALSE"); } config_window_set_stun_visible(); } - + /** @todo Verify if it's the best condition to check */ if (currentAccount->accountID == NULL) { dbus_add_account(currentAccount); diff --git a/sflphone-gtk/src/accountwindow.h b/sflphone-gtk/src/config/accountwindow.h similarity index 100% rename from sflphone-gtk/src/accountwindow.h rename to sflphone-gtk/src/config/accountwindow.h diff --git a/sflphone-gtk/src/config/addressbook-config.c b/sflphone-gtk/src/config/addressbook-config.c new file mode 100644 index 0000000000000000000000000000000000000000..9851ce64338fb884ca94fbcc4610ea90508bf913 --- /dev/null +++ b/sflphone-gtk/src/config/addressbook-config.c @@ -0,0 +1,376 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "addressbook-config.h" +#include <contacts/addressbook/eds.h> +#include <string.h> +#include <stdlib.h> + +AddressBook_Config *addressbook_config; +GtkWidget *book_tree_view; + +enum +{ + COLUMN_BOOK_ACTIVE, COLUMN_BOOK_NAME, COLUMN_BOOK_UID +}; + +void +addressbook_config_load_parameters(AddressBook_Config **settings) +{ + + GHashTable *_params = NULL; + AddressBook_Config *_settings; + + // Allocate a struct + _settings = g_new0 (AddressBook_Config, 1); + + // Fetch the settings from D-Bus + _params = (GHashTable*) dbus_get_addressbook_settings(); + + if (_params == NULL) + { + _settings->max_results = 30; + _settings->display_contact_photo = 0; + _settings->search_phone_business = 1; + _settings->search_phone_home = 1; + _settings->search_phone_mobile = 1; + } + else + { + _settings->max_results = (guint) (g_hash_table_lookup(_params, + ADDRESSBOOK_MAX_RESULTS)); + _settings->display_contact_photo = (guint) (g_hash_table_lookup(_params, + ADDRESSBOOK_DISPLAY_CONTACT_PHOTO)); + _settings->search_phone_business = (guint) (g_hash_table_lookup(_params, + ADDRESSBOOK_DISPLAY_PHONE_BUSINESS)); + _settings->search_phone_home = (guint) (g_hash_table_lookup(_params, + ADDRESSBOOK_DISPLAY_PHONE_HOME)); + _settings->search_phone_mobile = (guint) (g_hash_table_lookup(_params, + ADDRESSBOOK_DISPLAY_PHONE_MOBILE)); + } + + *settings = _settings; +} + +void +addressbook_config_save_parameters(void) +{ + + GHashTable *params = NULL; + + params = g_hash_table_new(NULL, g_str_equal); + g_hash_table_replace(params, (gpointer) ADDRESSBOOK_MAX_RESULTS, + (gpointer) addressbook_config->max_results); + g_hash_table_replace(params, (gpointer) ADDRESSBOOK_DISPLAY_CONTACT_PHOTO, + (gpointer) addressbook_config->display_contact_photo); + g_hash_table_replace(params, (gpointer) ADDRESSBOOK_DISPLAY_PHONE_BUSINESS, + (gpointer) addressbook_config->search_phone_business); + g_hash_table_replace(params, (gpointer) ADDRESSBOOK_DISPLAY_PHONE_HOME, + (gpointer) addressbook_config->search_phone_home); + g_hash_table_replace(params, (gpointer) ADDRESSBOOK_DISPLAY_PHONE_MOBILE, + (gpointer) addressbook_config->search_phone_mobile); + + dbus_set_addressbook_settings(params); + + // Decrement the reference count + g_hash_table_unref(params); +} + +static void +max_results_cb(GtkRange* scale) +{ + + addressbook_config->max_results = (guint) gtk_range_get_value(GTK_RANGE (scale)); +} + +static void +display_contact_photo_cb(GtkWidget *widget) +{ + + addressbook_config->display_contact_photo + = (guint) gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); +} + +static void +search_phone_business_cb(GtkWidget *widget) +{ + + addressbook_config->search_phone_business + = (guint) gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); +} + +static void +search_phone_home_cb(GtkWidget *widget) +{ + + addressbook_config->search_phone_home = (guint) gtk_toggle_button_get_active( + GTK_TOGGLE_BUTTON(widget)); +} + +static void +search_phone_mobile_cb(GtkWidget *widget) +{ + + addressbook_config->search_phone_mobile + = (guint) gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); +} + +/** + * Toggle active value of book on click and update changes to the deamon + * and in configuration files + */ +static void +addressbook_config_book_active_toggled( + GtkCellRendererToggle *renderer UNUSED, gchar *path, gpointer data) +{ + GtkTreeIter iter; + GtkTreePath *treePath; + GtkTreeModel *model; + gboolean active; + gchar* name; + gchar* uid; + + // Get path of clicked book active toggle box + treePath = gtk_tree_path_new_from_string(path); + model = gtk_tree_view_get_model(GTK_TREE_VIEW(data)); + gtk_tree_model_get_iter(model, &iter, treePath); + + // Get active value at iteration + gtk_tree_model_get(model, &iter, COLUMN_BOOK_ACTIVE, &active, + COLUMN_BOOK_UID, &uid, COLUMN_BOOK_NAME, &name, -1); + + // Toggle active value + active = !active; + + // Store value + gtk_list_store_set(GTK_LIST_STORE(model), &iter, COLUMN_BOOK_ACTIVE, active, -1); + + gtk_tree_path_free(treePath); + + // Update current memory stored books data + books_get_book_data_by_uid(uid)->active = active; + + // Save data + + gboolean valid; + + // Initiate double array char list for one string + const gchar** list = (void*) malloc(sizeof(void*)); + int c = 0; + + /* Get the first iter in the list */ + valid = gtk_tree_model_get_iter_first(model, &iter); + + while (valid) + { + // Get active value at iteration + gtk_tree_model_get(model, &iter, COLUMN_BOOK_ACTIVE, &active, + COLUMN_BOOK_UID, &uid, COLUMN_BOOK_NAME, &name, -1); + + if (active) + { + // Reallocate memory each time + if (c != 0) + list = (void*) realloc(list, (c + 1) * sizeof(void*)); + + *(list + c) = uid; + c++; + } + + valid = gtk_tree_model_iter_next(model, &iter); + } + + // Allocate NULL array at the end for Dbus + list = (void*) realloc(list, (c + 1) * sizeof(void*)); + *(list + c) = NULL; + + // Call daemon to store in config file + dbus_set_addressbook_list(list); + + free(list); +} + +static void +addressbook_config_fill_book_list() +{ + GtkTreeIter list_store_iterator; + GSList *book_list_iterator; + GtkListStore *store; + book_data_t *book_data; + GSList *books_data = addressbook_get_books_data(); + + // Get model of view and clear it + store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(book_tree_view))); + gtk_list_store_clear(store); + + // Populate window + for (book_list_iterator = books_data; book_list_iterator != NULL; book_list_iterator + = book_list_iterator->next) + { + book_data = (book_data_t *) book_list_iterator->data; + gtk_list_store_append(store, &list_store_iterator); + gtk_list_store_set(store, &list_store_iterator, COLUMN_BOOK_ACTIVE, + book_data->active, COLUMN_BOOK_UID, book_data->uid, COLUMN_BOOK_NAME, + book_data->name, -1); + } + + store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(book_tree_view))); +} + +GtkWidget* +create_addressbook_settings() +{ + + GtkWidget *ret, *result_frame, *table, *value, *label, *photo, *item; + + GtkListStore *store; + GtkCellRenderer *renderer; + GtkTreeSelection *tree_selection; + GtkTreeViewColumn *tree_view_column; + GtkWidget *scrolled_window, *hbox; + + // Load the user value + addressbook_config_load_parameters(&addressbook_config); + + ret = gtk_vbox_new(FALSE, 10); + gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + + result_frame = gtk_frame_new(_("General")); + gtk_box_pack_start(GTK_BOX(ret), result_frame, FALSE, FALSE, 0); + gtk_widget_show (result_frame); + + table = gtk_table_new ( 5, 3, FALSE/* homogeneous */); + gtk_table_set_row_spacings( GTK_TABLE(table), 10); + gtk_table_set_col_spacings( GTK_TABLE(table), 10); + gtk_widget_show(table); + gtk_container_add( GTK_CONTAINER (result_frame) , table ); + + // SCALE BUTTON - NUMBER OF RESULTS + hbox = gtk_hbox_new(FALSE, 0); + label = gtk_label_new (_("Maximum results: ")); + gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); + value = gtk_hscale_new_with_range (25.0 , 50.0 , 5.0); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), value); + gtk_scale_set_digits (GTK_SCALE(value) , 0); + gtk_scale_set_value_pos (GTK_SCALE(value) , GTK_POS_RIGHT); + gtk_range_set_value (GTK_RANGE( value ) , addressbook_config->max_results); + g_signal_connect (G_OBJECT (value) , "value-changed" , G_CALLBACK(max_results_cb), NULL ); + gtk_box_pack_start(GTK_BOX(hbox),value,TRUE,TRUE,10); + gtk_table_attach ( GTK_TABLE( table ), hbox, 1, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND |GTK_FILL, 0, 0); + gtk_widget_show_all(hbox); + + // PHOTO DISPLAY + photo = gtk_check_button_new_with_mnemonic( _("_Display contact photo if available")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(photo), addressbook_config->display_contact_photo); + g_signal_connect (G_OBJECT(photo) , "clicked" , G_CALLBACK (display_contact_photo_cb), NULL); + gtk_table_attach ( GTK_TABLE( table ), photo, 1, 3, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + result_frame = gtk_frame_new(_("Fields")); + gtk_box_pack_start(GTK_BOX(ret), result_frame, FALSE, FALSE, 0); + gtk_widget_show (result_frame); + + table = gtk_table_new ( 5, 3, FALSE); + gtk_table_set_row_spacings( GTK_TABLE(table), 10); + gtk_table_set_col_spacings( GTK_TABLE(table), 10); + gtk_widget_show(table); + gtk_container_add( GTK_CONTAINER (result_frame) , table ); + + item = gtk_check_button_new_with_mnemonic( _("_Business phone")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(item), addressbook_config->search_phone_business); + g_signal_connect (G_OBJECT(item) , "clicked" , G_CALLBACK (search_phone_business_cb) , NULL); + gtk_table_attach ( GTK_TABLE( table ), item, 1, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + item = gtk_check_button_new_with_mnemonic( _("_Home phone")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(item), addressbook_config->search_phone_home); + g_signal_connect (G_OBJECT(item) , "clicked" , G_CALLBACK (search_phone_home_cb) , NULL); + gtk_table_attach ( GTK_TABLE( table ), item, 1, 3, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + item = gtk_check_button_new_with_mnemonic( _("_Mobile phone")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(item), addressbook_config->search_phone_mobile); + g_signal_connect (G_OBJECT(item) , "clicked" , G_CALLBACK (search_phone_mobile_cb) , NULL); + gtk_table_attach ( GTK_TABLE( table ), item, 1, 3, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + result_frame = gtk_frame_new(_("Books")); + gtk_box_pack_start(GTK_BOX(ret), result_frame, TRUE, TRUE, 0); + gtk_widget_show (result_frame); + + scrolled_window = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_window), GTK_SHADOW_IN); + + gtk_container_add( GTK_CONTAINER (result_frame) , scrolled_window ); + + store = gtk_list_store_new(3, + G_TYPE_BOOLEAN, // Active + G_TYPE_STRING, // uid + G_TYPE_STRING // Name + ); + + // Create tree view with list store + book_tree_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); + + // Get tree selection manager + tree_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(book_tree_view)); + + // Active column + renderer = gtk_cell_renderer_toggle_new(); + tree_view_column = gtk_tree_view_column_new_with_attributes("", renderer, "active", COLUMN_BOOK_ACTIVE, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(book_tree_view), tree_view_column); + + // Toggle active property on clicked + g_signal_connect(G_OBJECT(renderer), "toggled", G_CALLBACK(addressbook_config_book_active_toggled), (gpointer)book_tree_view); + + // Name column + renderer = gtk_cell_renderer_text_new(); + tree_view_column = gtk_tree_view_column_new_with_attributes(_("Name"), renderer, "markup", COLUMN_BOOK_NAME, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(book_tree_view), tree_view_column); + + g_object_unref(G_OBJECT(store)); + gtk_container_add(GTK_CONTAINER(scrolled_window), book_tree_view); + + addressbook_config_fill_book_list(); + + gtk_widget_show_all(ret); + + return ret; +} + +gboolean +addressbook_display(AddressBook_Config *settings, const gchar *field) +{ + + gboolean display = FALSE; + + if (g_strcasecmp(field, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO) == 0) + display = (settings->display_contact_photo == 1) ? TRUE : FALSE; + + else if (g_strcasecmp(field, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS) == 0) + display = (settings->search_phone_business == 1) ? TRUE : FALSE; + + else if (g_strcasecmp(field, ADDRESSBOOK_DISPLAY_PHONE_HOME) == 0) + display = (settings->search_phone_home == 1) ? TRUE : FALSE; + + else if (g_strcasecmp(field, ADDRESSBOOK_DISPLAY_PHONE_MOBILE) == 0) + display = (settings->search_phone_mobile == 1) ? TRUE : FALSE; + + else + display = FALSE; + + return display; +} diff --git a/sflphone-gtk/src/addressbook-config.h b/sflphone-gtk/src/config/addressbook-config.h similarity index 76% rename from sflphone-gtk/src/addressbook-config.h rename to sflphone-gtk/src/config/addressbook-config.h index f880d726bb33500eca10b4f3b302eb26195fe001..ec7a8d16360e56090421b60120bcd26cd63221b7 100644 --- a/sflphone-gtk/src/addressbook-config.h +++ b/sflphone-gtk/src/config/addressbook-config.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2009 Savoir-Faire Linux inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -33,29 +33,34 @@ G_BEGIN_DECLS #define ADDRESSBOOK_DISPLAY_PHONE_HOME "ADDRESSBOOK_DISPLAY_PHONE_HOME" #define ADDRESSBOOK_DISPLAY_PHONE_MOBILE "ADDRESSBOOK_DISPLAY_PHONE_MOBILE" -typedef struct _AddressBook_Config { - guint max_results; - guint display_contact_photo; - guint search_phone_home; - guint search_phone_business; - guint search_phone_mobile; +typedef struct _AddressBook_Config +{ + guint max_results; + guint display_contact_photo; + guint search_phone_home; + guint search_phone_business; + guint search_phone_mobile; } AddressBook_Config; /** * Save the parameters through D-BUS */ -void addressbook_save_parameters (void); +void +addressbook_config_save_parameters(void); /** * Initialize the address book structure, and retrieve the saved parameters through D-Bus * - * @param settings The addressbook structure + * @param settings The addressbook structure */ -void addressbook_load_parameters (AddressBook_Config **settings); +void +addressbook_config_load_parameters(AddressBook_Config **settings); -gboolean addressbook_display (AddressBook_Config *settings, const gchar *field); +gboolean +addressbook_display(AddressBook_Config *settings, const gchar *field); -GtkWidget* create_addressbook_settings (); +GtkWidget* +create_addressbook_settings(); G_END_DECLS diff --git a/sflphone-gtk/src/audioconf.c b/sflphone-gtk/src/config/audioconf.c similarity index 96% rename from sflphone-gtk/src/audioconf.c rename to sflphone-gtk/src/config/audioconf.c index 8ff1348a6a91149e02420c00657b790e7624ec67..44cd9c104f5a6e5128932402e4173bb02940a282 100644 --- a/sflphone-gtk/src/audioconf.c +++ b/sflphone-gtk/src/config/audioconf.c @@ -1,17 +1,17 @@ /* * Copyright (C) 2008 Savoir-Faire Linux inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -62,7 +62,7 @@ config_window_fill_codec_list() for(i = 0; i < codec_list_get_size(); i++) { codec_t *c = codec_list_get_nth(i); - printf("%s\n", c->name); + DEBUG("%s", c->name); if(c) { gtk_list_store_append(codecStore, &iter); @@ -151,7 +151,7 @@ select_active_output_audio_device() // Select active output device on server devices = dbus_get_current_audio_devices_index(); currentDeviceIndex = atoi(devices[0]); - printf(_("audio device index for output = %d\n"), currentDeviceIndex); + DEBUG(_("audio device index for output = %d"), currentDeviceIndex); model = gtk_combo_box_get_model(GTK_COMBO_BOX(output)); // Find the currently set output device @@ -167,7 +167,7 @@ select_active_output_audio_device() } while(gtk_tree_model_iter_next(model, &iter)); // No index was found, select first one - g_print("Warning : No active output device found"); + WARN("Warning : No active output device found"); gtk_combo_box_set_active(GTK_COMBO_BOX(output), 0); } } @@ -233,7 +233,7 @@ select_active_input_audio_device() } while(gtk_tree_model_iter_next(model, &iter)); // No index was found, select first one - g_print("Warning : No active input device found"); + WARN("Warning : No active input device found"); gtk_combo_box_set_active(GTK_COMBO_BOX(input), 0); } } @@ -255,7 +255,7 @@ select_output_audio_plugin(GtkComboBox* widget, gpointer data UNUSED) { model = gtk_combo_box_get_model(widget); gtk_combo_box_get_active_iter(widget, &iter); - gtk_tree_model_get(model, &iter, 0, &pluginName, -1); + gtk_tree_model_get(model, &iter, 0, &pluginName, -1); dbus_set_output_audio_plugin(pluginName); //update_combo_box( pluginName); } @@ -291,7 +291,7 @@ select_active_output_audio_plugin() } while(gtk_tree_model_iter_next(model, &iter)); // No index was found, select first one - g_print("Warning : No active output device found\n"); + WARN("Warning : No active output device found"); gtk_combo_box_set_active(GTK_COMBO_BOX(plugin), 0); } @@ -386,7 +386,7 @@ codec_active_toggled(GtkCellRendererToggle *renderer UNUSED, gchar *path, gpoint COLUMN_CODEC_NAME, &name, -1); - printf("%s\n", name); + DEBUG("%s", name); // Toggle active value active = !active; @@ -398,7 +398,7 @@ codec_active_toggled(GtkCellRendererToggle *renderer UNUSED, gchar *path, gpoint gtk_tree_path_free(treePath); - // Modify codec queue to represent change + // Modify codec queue to represent change if(active) codec_set_active(name); else @@ -487,16 +487,16 @@ codec_move_down(GtkButton *button UNUSED, gpointer data) codec_move(FALSE, data); } - int + int is_ringtone_enabled( void ) { - return dbus_is_ringtone_enabled(); + return dbus_is_ringtone_enabled(); } - void + void ringtone_enabled( void ) { - dbus_ringtone_enabled(); + dbus_ringtone_enabled(); } void @@ -604,24 +604,24 @@ GtkWidget* codecs_box() select_audio_manager( void ) { - g_print("audio manager selected\n"); + DEBUG("audio manager selected"); if( !SHOW_ALSA_CONF && !gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) ) ) { dbus_set_audio_manager( ALSA ); - g_print(" display alsa conf panel\n"); + DEBUG(" display alsa conf panel"); alsabox = alsa_box(); gtk_container_add( GTK_CONTAINER(alsa_conf ) , alsabox); - gtk_widget_show( alsa_conf ); + gtk_widget_show( alsa_conf ); } else if( SHOW_ALSA_CONF && gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) )) { dbus_set_audio_manager( PULSEAUDIO ); - g_print(" remove alsa conf panel\n"); + DEBUG(" remove alsa conf panel"); gtk_container_remove( GTK_CONTAINER(alsa_conf) , alsabox ); } else - g_print("alsa conf panel...nothing\n"); + DEBUG("alsa conf panel...nothing"); //gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) )? dbus_set_audio_manager( PULSEAUDIO ):dbus_set_audio_manager( ALSA ); } @@ -662,7 +662,7 @@ GtkWidget* alsa_box() gtk_box_pack_start( GTK_BOX(ret) , table , TRUE , TRUE , 1); gtk_widget_show(table); - g_print("plugin\n"); + DEBUG("plugin"); item = gtk_label_new(_("ALSA plugin")); gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); gtk_table_attach(GTK_TABLE(table), item, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); @@ -684,7 +684,7 @@ GtkWidget* alsa_box() // Device : Output device // Create title label - g_print("output\n"); + DEBUG("output"); item = gtk_label_new(_("Output")); gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); gtk_table_attach(GTK_TABLE(table), item, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); @@ -706,7 +706,7 @@ GtkWidget* alsa_box() // Device : Input device // Create title label - g_print("input\n"); + DEBUG("input"); item = gtk_label_new(_("Input")); gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); gtk_table_attach(GTK_TABLE(table), item, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); @@ -728,7 +728,7 @@ GtkWidget* alsa_box() gtk_widget_show_all(ret); - g_print("done\n"); + DEBUG("done"); return ret; } @@ -746,8 +746,8 @@ GtkWidget* ringtones_box() g_signal_connect(G_OBJECT( enableTone) , "clicked" , G_CALLBACK( ringtone_enabled ) , NULL); // file chooser button fileChooser = gtk_file_chooser_button_new(_("Choose a ringtone"), GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( fileChooser) , g_get_home_dir()); - gtk_file_chooser_set_filename(GTK_FILE_CHOOSER( fileChooser) , get_ringtone_choice()); + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( fileChooser) , g_get_home_dir()); + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER( fileChooser) , get_ringtone_choice()); g_signal_connect( G_OBJECT( fileChooser ) , "selection_changed" , G_CALLBACK( ringtone_changed ) , NULL ); GtkFileFilter *filter = gtk_file_filter_new(); gtk_file_filter_set_name( filter , _("Audio Files") ); @@ -775,7 +775,7 @@ GtkWidget* noise_box() gtk_widget_set_sensitive(GTK_WIDGET(noise_conf), FALSE); //TODO Add a callback function //g_signal_connect(G_OBJECT( enableNoiseReduction) , "clicked" , NULL , NULL); - + return ret; } diff --git a/sflphone-gtk/src/audioconf.h b/sflphone-gtk/src/config/audioconf.h similarity index 100% rename from sflphone-gtk/src/audioconf.h rename to sflphone-gtk/src/config/audioconf.h diff --git a/sflphone-gtk/src/configwindow.c b/sflphone-gtk/src/config/configwindow.c similarity index 97% rename from sflphone-gtk/src/configwindow.c rename to sflphone-gtk/src/config/configwindow.c index 60e6787c828aa7f6a901a387673c170fed5baaac..4ea6fa7daa96f0c58609ab57565c057ba7834751 100644 --- a/sflphone-gtk/src/configwindow.c +++ b/sflphone-gtk/src/config/configwindow.c @@ -3,17 +3,17 @@ * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -25,7 +25,8 @@ #include <accountwindow.h> #include <actions.h> #include <config.h> -#include <dbus.h> +#include <toolbar.h> +#include <dbus/dbus.h> #include <mainwindow.h> #include <audioconf.h> #include <addressbook-config.h> @@ -90,7 +91,7 @@ config_window_fill_account_list() account_t * a = account_list_get_nth (i); if (a) { - g_print("fill account list : %s\n" , (gchar*)g_hash_table_lookup(a->properties, ACCOUNT_ENABLED)); + DEBUG("fill account list : %s" , (gchar*)g_hash_table_lookup(a->properties, ACCOUNT_ENABLED)); gtk_list_store_append (accountStore, &iter); gtk_list_store_set(accountStore, &iter, COLUMN_ACCOUNT_ALIAS, g_hash_table_lookup(a->properties, ACCOUNT_ALIAS), // Name @@ -116,7 +117,7 @@ delete_account(GtkWidget *widget UNUSED, gpointer data UNUSED) if(selectedAccount) { dbus_remove_account(selectedAccount->accountID); - if(account_list_get_sip_account_number() == 1 && + if(account_list_get_sip_account_number() == 1 && strcmp(g_hash_table_lookup(selectedAccount->properties, ACCOUNT_TYPE), "SIP")==0 ) gtk_widget_set_sensitive(GTK_WIDGET(stunFrame), FALSE); } @@ -176,7 +177,7 @@ update_max_value( GtkRange* scale ) void clean_history( void ) { - call_list_clean_history(); + calllist_clean_history(); } /** @@ -210,7 +211,7 @@ select_account(GtkTreeSelection *selection, GtkTreeModel *model) gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), TRUE); gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), TRUE); } - g_print("select"); + DEBUG("select"); } static void @@ -241,7 +242,7 @@ enable_account(GtkCellRendererToggle *rend UNUSED, gchar* path, gpointer data ) gtk_tree_path_free(treePath); - // Modify account state + // Modify account state g_hash_table_replace( acc->properties , g_strdup(ACCOUNT_ENABLED) , g_strdup((enable == 1)? "TRUE":"FALSE")); dbus_send_register( acc->accountID , enable ); } @@ -299,6 +300,10 @@ account_move(gboolean moveUp, gpointer data) account_list_move_up(indice); else account_list_move_down(indice); + + + // Set the order in the configuration file + dbus_set_accounts_order (account_list_get_ordered_list ()); } /** @@ -348,7 +353,7 @@ create_accounts_tab() selectedAccount = NULL; - ret = gtk_vbox_new(FALSE, 10); + ret = gtk_vbox_new(FALSE, 10); gtk_container_set_border_width(GTK_CONTAINER (ret), 10); scrolledWindow = gtk_scrolled_window_new(NULL, NULL); @@ -422,7 +427,7 @@ create_accounts_tab() gtk_box_set_spacing(GTK_BOX(buttonBox), 10); //GAIM_HIG_BOX_SPACE gtk_button_box_set_layout(GTK_BUTTON_BOX(buttonBox), GTK_BUTTONBOX_SPREAD); gtk_box_pack_start(GTK_BOX(ret), buttonBox, FALSE, FALSE, 0); - gtk_widget_show (buttonBox); + gtk_widget_show (buttonBox); addButton = gtk_button_new_from_stock (GTK_STOCK_ADD); g_signal_connect_swapped(G_OBJECT(addButton), "clicked", @@ -451,7 +456,7 @@ create_accounts_tab() void stun_state( void ) { - + guint stun_enabled = 0; gboolean stunActive = (gboolean)gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( stunEnable )); @@ -459,7 +464,7 @@ void stun_state( void ) // Check if we actually change the state stun_enabled = dbus_stun_is_enabled(); - + if( (stunActive && stun_enabled ==0 ) || (!stunActive && stun_enabled ==1)) { gtk_widget_set_sensitive( GTK_WIDGET( applyButton ) , TRUE ); @@ -613,7 +618,7 @@ create_general_settings () value = gtk_hscale_new_with_range(0.0 , 50.0 , 5.0); gtk_label_set_mnemonic_widget (GTK_LABEL (label), value); gtk_scale_set_digits( GTK_SCALE(value) , 0); - gtk_scale_set_value_pos( GTK_SCALE(value) , GTK_POS_RIGHT); + gtk_scale_set_value_pos( GTK_SCALE(value) , GTK_POS_RIGHT); gtk_range_set_value( GTK_RANGE( value ) , dbus_get_max_calls()); gtk_box_pack_start( GTK_BOX(vbox) , value , TRUE , TRUE , 0); g_signal_connect( G_OBJECT( value) , "value-changed" , G_CALLBACK( update_max_value ) , NULL); @@ -637,7 +642,7 @@ create_general_settings () g_signal_connect(G_OBJECT( widg ) , "clicked" , G_CALLBACK( set_pulse_app_volume_control ) , NULL); n = account_list_get_sip_account_number(); - printf("sip account number = %i\n", n); + DEBUG("sip account number = %i", n); /** SIP port information */ curPort = dbus_get_sip_port(); @@ -693,7 +698,7 @@ create_recording_settings () GtkWidget *savePathFrame; GtkWidget *folderChooser; gchar *dftPath; - + /* Get the path where to save audio files */ dftPath = dbus_get_record_path (); @@ -705,19 +710,19 @@ create_recording_settings () savePathFrame = gtk_frame_new(_("General")); gtk_box_pack_start(GTK_BOX(ret), savePathFrame, FALSE, FALSE, 5); gtk_widget_show(savePathFrame); - + table = gtk_table_new(1, 2, FALSE); gtk_table_set_row_spacings( GTK_TABLE(table), 10); gtk_table_set_col_spacings( GTK_TABLE(table), 10); gtk_widget_show(table); gtk_container_add(GTK_CONTAINER(savePathFrame), table); - // label + // label label = gtk_label_new_with_mnemonic(_("_Destination folder")); gtk_table_attach( GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - + // folder chooser button folderChooser = gtk_file_chooser_button_new(_("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( folderChooser), dftPath); @@ -768,22 +773,22 @@ show_config_window () gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); // Audio tab - tab = create_audio_configuration(); + tab = create_audio_configuration(); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Audio Settings"))); gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); // Recording tab - tab = create_recording_settings(); + tab = create_recording_settings(); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Record"))); gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); // Addressbook tab - tab = create_addressbook_settings(); + tab = create_addressbook_settings(); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Address Book"))); gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); // HookS tab - tab = create_hooks_settings(); + tab = create_hooks_settings(); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Hooks"))); gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); @@ -839,7 +844,7 @@ show_accounts_window( void ) gtk_widget_show(stunFrame); gtk_container_add(GTK_CONTAINER(stunFrame), create_stun_tab()); - + if( account_list_get_sip_account_number() == 0 ) { gtk_widget_set_sensitive(GTK_WIDGET(stunFrame), FALSE); @@ -847,9 +852,12 @@ show_accounts_window( void ) gtk_dialog_run( dialog ); + status_bar_display_account (); + accDialogOpen=FALSE; + gtk_widget_destroy(GTK_WIDGET(dialog)); - if( account_list_get_size() >0 && account_list_get_current()==NULL ) + if( account_list_get_size() >0 && account_list_get_current()==NULL ) account_list_set_current_pos(0); toolbar_update_buttons(); } @@ -861,7 +869,7 @@ void config_window_set_stun_visible() void save_configuration_parameters (void) { - addressbook_save_parameters (); + addressbook_config_save_parameters (); hooks_save_parameters (); } diff --git a/sflphone-gtk/src/configwindow.h b/sflphone-gtk/src/config/configwindow.h similarity index 100% rename from sflphone-gtk/src/configwindow.h rename to sflphone-gtk/src/config/configwindow.h diff --git a/sflphone-gtk/src/config/hooks-config.c b/sflphone-gtk/src/config/hooks-config.c new file mode 100644 index 0000000000000000000000000000000000000000..e692bda503c3ca367d678e4090336fe061ec4edd --- /dev/null +++ b/sflphone-gtk/src/config/hooks-config.c @@ -0,0 +1,190 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "hooks-config.h" + +URLHook_Config *_urlhook_config; + +GtkWidget *field, *command, *prefix; + +void hooks_load_parameters (URLHook_Config** settings){ + + GHashTable *_params = NULL; + URLHook_Config *_settings; + + // Allocate a struct + _settings = g_new0 (URLHook_Config, 1); + + // Fetch the settings from D-Bus + _params = (GHashTable*) dbus_get_hook_settings (); + + if (_params == NULL) { + _settings->sip_field = DEFAULT_SIP_URL_FIELD; + _settings->command = DEFAULT_URL_COMMAND; + _settings->sip_enabled = "0"; + _settings->iax2_enabled = "0"; + _settings->phone_number_enabled = "0"; + _settings->phone_number_prefix = ""; + } + else { + _settings->sip_field = (gchar*)(g_hash_table_lookup (_params, URLHOOK_SIP_FIELD)); + _settings->command = (gchar*)(g_hash_table_lookup (_params, URLHOOK_COMMAND)); + _settings->sip_enabled = (gchar*)(g_hash_table_lookup (_params, URLHOOK_SIP_ENABLED)); + _settings->iax2_enabled = (gchar*)(g_hash_table_lookup (_params, URLHOOK_IAX2_ENABLED)); + _settings->phone_number_enabled = (gchar*)(g_hash_table_lookup (_params, PHONE_NUMBER_HOOK_ENABLED )); + _settings->phone_number_prefix = (gchar*)(g_hash_table_lookup (_params, PHONE_NUMBER_HOOK_ADD_PREFIX )); + } + + *settings = _settings; +} + + +void hooks_save_parameters (void){ + + GHashTable *params = NULL; + + params = g_hash_table_new (NULL, g_str_equal); + g_hash_table_replace (params, (gpointer)URLHOOK_SIP_FIELD, + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(field)))); + g_hash_table_replace (params, (gpointer)URLHOOK_COMMAND, + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(command)))); + g_hash_table_replace (params, (gpointer)URLHOOK_SIP_ENABLED, + (gpointer)g_strdup(_urlhook_config->sip_enabled)); + g_hash_table_replace (params, (gpointer)URLHOOK_IAX2_ENABLED, + (gpointer)g_strdup(_urlhook_config->iax2_enabled)); + g_hash_table_replace (params, (gpointer)PHONE_NUMBER_HOOK_ENABLED, + (gpointer)g_strdup(_urlhook_config->phone_number_enabled)); + g_hash_table_replace (params, (gpointer)PHONE_NUMBER_HOOK_ADD_PREFIX, + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(prefix)))); + + dbus_set_hook_settings (params); + + // Decrement the reference count + g_hash_table_unref (params); + +} + +static void sip_enabled_cb (GtkWidget *widget) { + + guint check; + + check = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); + if (check) + _urlhook_config->sip_enabled="1"; + else + _urlhook_config->sip_enabled="0"; +} + +static void iax2_enabled_cb (GtkWidget *widget) { + + guint check; + + check = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); + if (check) + _urlhook_config->iax2_enabled="1"; + else + _urlhook_config->iax2_enabled="0"; +} + +static void phone_number_enabled_cb (GtkWidget *widget) { + + guint check; + + check = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); + if (check){ + _urlhook_config->phone_number_enabled="1"; + gtk_widget_set_sensitive (GTK_WIDGET (prefix), TRUE); + }else{ + _urlhook_config->phone_number_enabled="0"; + gtk_widget_set_sensitive (GTK_WIDGET (prefix), FALSE); + } +} + + +GtkWidget* create_hooks_settings (){ + + GtkWidget *ret, *frame, *table, *label, *widg; + + // Load the user value + hooks_load_parameters (&_urlhook_config); + + ret = gtk_vbox_new(FALSE, 10); + gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + + frame = gtk_frame_new(_("URL argument")); + gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); + gtk_widget_show (frame); + + table = gtk_table_new ( 5, 3, FALSE/* homogeneous */); + gtk_table_set_row_spacings( GTK_TABLE(table), 10); + gtk_table_set_col_spacings( GTK_TABLE(table), 10); + gtk_widget_show(table); + gtk_container_add( GTK_CONTAINER (frame) , table ); + + widg = gtk_check_button_new_with_mnemonic( _("_SIP protocol")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widg), (g_strcasecmp (_urlhook_config->sip_enabled, "1")==0)?TRUE:FALSE); + g_signal_connect (G_OBJECT(widg) , "clicked" , G_CALLBACK (sip_enabled_cb), NULL); + gtk_table_attach ( GTK_TABLE( table ), widg, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + label = gtk_label_new_with_mnemonic (_("_SIP Header: ")); + gtk_table_attach ( GTK_TABLE( table ), label, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + field = gtk_entry_new (); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), field); + gtk_entry_set_text(GTK_ENTRY(field), _urlhook_config->sip_field); + gtk_table_attach ( GTK_TABLE( table ), field, 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + widg = gtk_check_button_new_with_mnemonic( _("_IAX2 protocol")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widg), (g_strcasecmp (_urlhook_config->iax2_enabled, "1")==0)?TRUE:FALSE); + g_signal_connect (G_OBJECT(widg) , "clicked" , G_CALLBACK (iax2_enabled_cb), NULL); + gtk_table_attach ( GTK_TABLE( table ), widg, 0, 3, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + label = gtk_label_new_with_mnemonic (_("_Command: ")); + gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + command = gtk_entry_new (); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), command); + gtk_entry_set_text(GTK_ENTRY(command), _urlhook_config->command); + gtk_table_attach ( GTK_TABLE( table ), command, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); + + frame = gtk_frame_new(_("Phone number formatting")); + gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); + gtk_widget_show (frame); + + table = gtk_table_new ( 2, 2, FALSE/* homogeneous */); + gtk_table_set_row_spacings( GTK_TABLE(table), 10); + gtk_table_set_col_spacings( GTK_TABLE(table), 10); + gtk_widget_show(table); + gtk_container_add( GTK_CONTAINER (frame) , table ); + + widg = gtk_check_button_new_with_mnemonic( _("_Add phone number prefix")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widg), (g_strcasecmp (_urlhook_config->phone_number_enabled, "1")==0)?TRUE:FALSE); + g_signal_connect (G_OBJECT(widg) , "clicked" , G_CALLBACK (phone_number_enabled_cb), NULL); + gtk_table_attach ( GTK_TABLE( table ), widg, 0, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + label = gtk_label_new_with_mnemonic (_("_Prepend: ")); + gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + prefix = gtk_entry_new (); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), prefix); + gtk_entry_set_text(GTK_ENTRY(prefix), _urlhook_config->phone_number_prefix); + gtk_widget_set_sensitive (GTK_WIDGET (prefix), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widg))); + gtk_table_attach ( GTK_TABLE( table ), prefix, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); + + gtk_widget_show_all(ret); + + return ret; +} diff --git a/sflphone-gtk/src/hooks-config.h b/sflphone-gtk/src/config/hooks-config.h similarity index 84% rename from sflphone-gtk/src/hooks-config.h rename to sflphone-gtk/src/config/hooks-config.h index 41ee59b718cc88938129305efe9b760aef24352a..fe9c92c62f0be2ea37ba16869303e481297d6ef6 100644 --- a/sflphone-gtk/src/hooks-config.h +++ b/sflphone-gtk/src/config/hooks-config.h @@ -32,12 +32,18 @@ G_BEGIN_DECLS #define URLHOOK_COMMAND "URLHOOK_COMMAND" #define URLHOOK_SIP_FIELD "URLHOOK_SIP_FIELD" #define URLHOOK_SIP_ENABLED "URLHOOK_SIP_ENABLED" +#define URLHOOK_IAX2_ENABLED "URLHOOK_IAX2_ENABLED" +#define PHONE_NUMBER_HOOK_ENABLED "PHONE_NUMBER_HOOK_ENABLED" +#define PHONE_NUMBER_HOOK_ADD_PREFIX "PHONE_NUMBER_HOOK_ADD_PREFIX" typedef struct _URLHook_Config { gchar *sip_enabled; + gchar *iax2_enabled; gchar *sip_field; gchar *command; + gchar *phone_number_enabled; + gchar *phone_number_prefix; }URLHook_Config; /** diff --git a/sflphone-gtk/src/contactlist/Makefile.am b/sflphone-gtk/src/contactlist/Makefile.am deleted file mode 100644 index d603d369c831b92052444431560433b399f92747..0000000000000000000000000000000000000000 --- a/sflphone-gtk/src/contactlist/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -noinst_LTLIBRARIES = libcontact.la - -libcontact_la_SOURCES = \ - eds.c - -libcontact_la_LDFLAGS=@DEPS_LDFLAGS@ - -libcontact_la_CFLAGS=@DEPS_CFLAGS@ diff --git a/sflphone-gtk/src/contactlist/TODO b/sflphone-gtk/src/contactlist/TODO deleted file mode 100644 index d520dd99e7feff8a03b173935df27517818fb38f..0000000000000000000000000000000000000000 --- a/sflphone-gtk/src/contactlist/TODO +++ /dev/null @@ -1,7 +0,0 @@ -Ref trac http://dev.savoirfairelinux.net/sflphone/report/3 - -* Ticket #163 -* Ticket #164 -* Ticket #165 -* Ticket #166 - diff --git a/sflphone-gtk/src/contactlist/eds.c b/sflphone-gtk/src/contactlist/eds.c deleted file mode 100644 index b2a6d4c9e445c16a5158214b44a008bb03016ac0..0000000000000000000000000000000000000000 --- a/sflphone-gtk/src/contactlist/eds.c +++ /dev/null @@ -1,379 +0,0 @@ -/* - * Copyright (C) 2009 Savoir-Faire Linux inc. - * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> - * - * File originally copied from evolution module of deskbar-applet 2.24.1 - * Authors : - * Nigel Tao <nigel.tao@myrealbox.com> - * Raphaël Slinckx <raphael@slinckx.net> - * Mikkel Kamstrup Erlandsen <kamstrup@daimi.au.dk> - * Sebastian Pölsterl <marduk@k-d-w.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <glib.h> -#include <glib/gstring.h> -#include <string.h> -#include <pango/pango.h> -#include "eds.h" - -typedef struct _Handler_And_Data { - int search_id; - SearchAsyncHandler handler; - gpointer user_data; - GList *hits; - int max_results_remaining; - int book_views_remaining; -} Handler_And_Data; - -static GSList *books = NULL; -static int pixbuf_size = 32; - -static EContactField search_fields[] = { E_CONTACT_FULL_NAME, E_CONTACT_PHONE_BUSINESS, E_CONTACT_NICKNAME, 0 }; -static int n_search_fields = G_N_ELEMENTS (search_fields) - 1; - - void -free_hit (Hit *h) -{ - g_free (h->name); - g_free (h->phone_business); - g_free (h->phone_home); - g_free (h->phone_mobile); - g_free (h); -} - -/** - * Split a string of tokens separated by whitespace into an array of tokens. - */ - static GArray * -split_query_string (const gchar *str) -{ - GArray *parts = g_array_sized_new (FALSE, FALSE, sizeof (char *), 2); - PangoLogAttr *attrs; - guint str_len = strlen (str), word_start = 0, i; - - attrs = g_new0 (PangoLogAttr, str_len + 1); - /* TODO: do we need to specify a particular language or is NULL ok? */ - pango_get_log_attrs (str, -1, -1, NULL, attrs, str_len + 1); - - for (i = 0; i < str_len + 1; i++) { - char *start_word, *end_word, *word; - if (attrs[i].is_word_end) { - start_word = g_utf8_offset_to_pointer (str, word_start); - end_word = g_utf8_offset_to_pointer (str, i); - word = g_strndup (start_word, end_word - start_word); - g_array_append_val (parts, word); - } - if (attrs[i].is_word_start) { - word_start = i; - } - } - g_free (attrs); - return parts; -} - -/** - * Create a query which looks for the specified string in a contact's full name, email addresses and - * nick name. - */ - static EBookQuery* -create_query (const char* s) -{ - EBookQuery *query; - GArray *parts = split_query_string (s); - EBookQuery ***field_queries; - EBookQuery **q; - EBookQuery **phone; - guint j; - int i; - - q = g_new0 (EBookQuery *, n_search_fields); - field_queries = g_new0 (EBookQuery **, n_search_fields); - - for (i = 0; i < n_search_fields; i++) { - field_queries[i] = g_new0 (EBookQuery *, parts->len); - for (j = 0; j < parts->len; j++) { - field_queries[i][j] = e_book_query_field_test (search_fields[i], E_BOOK_QUERY_CONTAINS, g_array_index (parts, gchar *, j)); - } - q[i] = e_book_query_and (parts->len, field_queries[i], TRUE); - } - g_array_free (parts, TRUE); - - phone = g_new0 (EBookQuery *, 3); - phone[0] = e_book_query_field_exists (E_CONTACT_PHONE_BUSINESS); - phone[1] = e_book_query_field_exists (E_CONTACT_PHONE_HOME); - phone[2] = e_book_query_field_exists (E_CONTACT_PHONE_MOBILE); - - query = e_book_query_andv (e_book_query_or (n_search_fields, q, FALSE), e_book_query_or (3, phone, FALSE), NULL); - - for (i = 0; i < n_search_fields; i++) { - g_free (field_queries[i]); - } - g_free (field_queries); - g_free (q); - g_free (phone); - - return query; -} - -static GdkPixbuf* -pixbuf_from_contact (EContact *contact) -{ - GdkPixbuf *pixbuf = NULL; - EContactPhoto *photo = e_contact_get (contact, E_CONTACT_PHOTO); - if (photo) { - GdkPixbufLoader *loader; - - loader = gdk_pixbuf_loader_new (); - - if (photo->type == E_CONTACT_PHOTO_TYPE_INLINED) { - if (gdk_pixbuf_loader_write (loader, (guchar *) photo->data.inlined.data, photo->data.inlined.length, NULL)) - pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); - } - - if (pixbuf) { - GdkPixbuf *tmp; - gint width = gdk_pixbuf_get_width (pixbuf); - gint height = gdk_pixbuf_get_height (pixbuf); - double scale = 1.0; - - if (height > width) { - scale = pixbuf_size / (double) height; - } else { - scale = pixbuf_size / (double) width; - } - - if (scale < 1.0) { - tmp = gdk_pixbuf_scale_simple (pixbuf, width * scale, height * scale, GDK_INTERP_BILINEAR); - g_object_unref (pixbuf); - pixbuf = tmp; - } - } - e_contact_photo_free (photo); - } - return pixbuf; -} - -/** - * Initialize address book - */ - void -init (void) -{ - GSList *list, *l; - ESourceList *source_list; - source_list = e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources"); - - if (source_list == NULL) { - return; - } - list = e_source_list_peek_groups (source_list); - - for (l = list; l != NULL; l = l->next) { - ESourceGroup *group = l->data; - GSList *sources = NULL, *m; - sources = e_source_group_peek_sources (group); - for (m = sources; m != NULL; m = m->next) { - ESource *source = m->data; - EBook *book = e_book_new (source, NULL); - if (book != NULL) { - books = g_slist_prepend (books, book); - e_book_open(book, TRUE, NULL); - } - } - } - - current_search_id = 0; - - g_object_unref (source_list); -} - -/** - * Final callback after all books have been processed. - */ - static void -view_finish (EBookView *book_view, Handler_And_Data *had) -{ - GList *i; - SearchAsyncHandler had_handler = had->handler; - GList *had_hits = had->hits; - gpointer had_user_data = had->user_data; - int search_id = had->search_id; - g_free (had); - - g_return_if_fail (book_view != NULL); - g_object_unref (book_view); - - if(search_id == current_search_id) - { - // Reinitialize search id to prevent overflow - if(current_search_id > 5000) - current_search_id = 0; - - // Call display callback - had_handler (had_hits, had_user_data); - } - else - { - // Some hits could have been processed but will not be used - for (i = had_hits; i != NULL; i = i->next) - { - Hit *entry; - entry = i->data; - free_hit(entry); - } - g_list_free(had_hits); - } -} - -/** - * Callback called after each ebook search completed. - * Used to store book search results. - */ - static void -view_contacts_added_cb (EBookView *book_view, GList *contacts, gpointer user_data) -{ - GdkPixbuf *photo; - - Handler_And_Data *had = (Handler_And_Data *) user_data; - - if(had->search_id != current_search_id) - { - e_book_view_stop (book_view); - return; - } - - if (had->max_results_remaining <= 0) { - e_book_view_stop (book_view); - had->book_views_remaining--; - if (had->book_views_remaining == 0) { - view_finish (book_view, had); - return; - } - } - for (; contacts != NULL; contacts = g_list_next (contacts)) { - EContact *contact; - Hit *hit; - gchar *number; - - contact = E_CONTACT (contacts->data); - hit = g_new (Hit, 1); - - /* Get the photo contact */ - photo = pixbuf_from_contact (contact); - hit->photo = photo; - - /* Get business phone information */ - fetch_information_from_contact (contact, E_CONTACT_PHONE_BUSINESS, &number); - hit->phone_business = g_strdup (number); - - /* Get home phone information */ - fetch_information_from_contact (contact, E_CONTACT_PHONE_HOME, &number); - hit->phone_home = g_strdup (number); - - /* Get mobile phone information */ - fetch_information_from_contact (contact, E_CONTACT_PHONE_MOBILE, &number); - hit->phone_mobile = g_strdup (number); - - hit->name = g_strdup ((char*) e_contact_get_const (contact, E_CONTACT_NAME_OR_ORG)); - if(! hit->name) - hit->name = ""; - - had->hits = g_list_append (had->hits, hit); - had->max_results_remaining--; - if (had->max_results_remaining <= 0) { - e_book_view_stop (book_view); - had->book_views_remaining--; - if (had->book_views_remaining == 0) { - view_finish (book_view, had); - } - break; - } - } -} - -/** - * Callback called after each ebook search completed. - * Used to call final callback when all books have been read. - */ - static void -view_completed_cb (EBookView *book_view, EBookViewStatus status, gpointer user_data) -{ - Handler_And_Data *had = (Handler_And_Data *) user_data; - had->book_views_remaining--; - if (had->book_views_remaining == 0) { - view_finish (book_view, had); - } -} - - - void -search_async (const char *query, - int max_results, - SearchAsyncHandler handler, - gpointer user_data) -{ - // Increment search id - current_search_id++; - - // If query is null - if(strlen(query) < 1) - { - // If data displayed (from previous search), directly call callback - handler(NULL, user_data); - - return; - } - - GSList *iter; - EBookQuery* book_query = create_query (query); - Handler_And_Data *had = g_new (Handler_And_Data, 1); - - had->search_id = current_search_id; - had->handler = handler; - had->user_data = user_data; - had->hits = NULL; - had->max_results_remaining = max_results; - had->book_views_remaining = 0; - for (iter = books; iter != NULL; iter = iter->next) { - EBook *book = (EBook *) iter->data; - EBookView *book_view = NULL; - e_book_get_book_view (book, book_query, NULL, max_results, &book_view, NULL); - if (book_view != NULL) { - had->book_views_remaining++; - g_signal_connect (book_view, "contacts_added", (GCallback) view_contacts_added_cb, had); - g_signal_connect (book_view, "sequence_complete", (GCallback) view_completed_cb, had); - e_book_view_start (book_view); - } - } - if (had->book_views_remaining == 0) { - g_free (had); - } - - e_book_query_unref (book_query); -} - -void fetch_information_from_contact (EContact *contact, EContactField field, gchar **info){ - - gchar *to_fetch; - - to_fetch = g_strdup ((char*) e_contact_get_const (contact, field)); - if(! to_fetch) { - to_fetch = g_strdup (EMPTY_ENTRY); - } - - *info = g_strdup (to_fetch); -} diff --git a/sflphone-gtk/src/contacts/Makefile.am b/sflphone-gtk/src/contacts/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..8afd0f4dc01a53dfd633191c6663ade77b3fcd8e --- /dev/null +++ b/sflphone-gtk/src/contacts/Makefile.am @@ -0,0 +1,19 @@ +include ../../globals.mak + +SUBDIRS = addressbook + +noinst_LTLIBRARIES = libcontacts.la + +libcontacts_la_SOURCES = \ + searchbar.c \ + calllist.c \ + calltab.c \ + calltree.c \ + history.c \ + addressbook.c + +libcontacts_la_LDFLAGS = @DEPS_LDFLAGS@ + +libcontacts_la_CFLAGS = @DEPS_CFLAGS@ + +libcontacts_la_LIBADD = ./addressbook/libaddressbook.la \ No newline at end of file diff --git a/sflphone-gtk/src/contacts/addressbook.c b/sflphone-gtk/src/contacts/addressbook.c new file mode 100644 index 0000000000000000000000000000000000000000..c9fa4dcbcf230668ed5e21958886d3dcaebcce00 --- /dev/null +++ b/sflphone-gtk/src/contacts/addressbook.c @@ -0,0 +1,171 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <addressbook.h> +#include <searchbar.h> +#include <toolbar.h> +#include <string.h> +#include <addressbook-config.h> + +static void +handler_async_search(GList *, gpointer); + +/** + * Perform a search on address book + */ +void +addressbook_search(GtkEntry* entry) +{ + + AddressBook_Config *addressbook_config; + + // Activate waiting layer + activateWaitingLayer(); + + // Load the address book parameters + addressbook_config_load_parameters(&addressbook_config); + + // Start the asynchronous search as soon as we have an entry */ + search_async(gtk_entry_get_text(GTK_ENTRY (entry)), addressbook_config->max_results, &handler_async_search, + addressbook_config); +} + +/** + * Return addressbook state + */ +gboolean +addressbook_is_ready() +{ + return books_ready(); +} + +/** + * Asynchronous open callback. + * Used to handle activation of books. + */ +static void +addressbook_config_books() +{ + gchar **config_book_uid; + book_data_t *book_data; + gchar **list; + + // Retrieve list of books + list = (gchar **) dbus_get_addressbook_list(); + + if (list) + { + for (config_book_uid = list; *config_book_uid; config_book_uid++) + { + // Get corresponding book data + book_data = books_get_book_data_by_uid(*config_book_uid); + + // If book_data exists + if (book_data != NULL) + { + book_data->active = TRUE; + } + } + g_strfreev(list); + } + + // Update buttons + toolbar_update_buttons(); +} + +/** + * Good method to get books_data + */ +GSList * +addressbook_get_books_data() +{ + addressbook_config_books(); + return books_data; +} + +/** + * Initialize books. + * Set active/inactive status depending on config. + */ +void +addressbook_init() +{ + // Call books initialization + init(&addressbook_config_books); +} + +/** + * Callback called after all book have been processed + */ +static void +handler_async_search(GList *hits, gpointer user_data) +{ + + GList *i; + GdkPixbuf *photo = NULL; + AddressBook_Config *addressbook_config; + call_t *j; + + // freeing calls + while ((j = (call_t *) g_queue_pop_tail(contacts->callQueue)) != NULL) + { + free_call_t(j); + } + + // Retrieve the address book parameters + addressbook_config = (AddressBook_Config*) user_data; + + // reset previous results + calltree_reset(contacts); + calllist_reset(contacts); + + for (i = hits; i != NULL; i = i->next) + { + Hit *entry; + entry = i->data; + if (entry) + { + // Get the photo + if (addressbook_display(addressbook_config, + ADDRESSBOOK_DISPLAY_CONTACT_PHOTO)) + photo = entry->photo; + // Create entry for business phone information + if (addressbook_display(addressbook_config, + ADDRESSBOOK_DISPLAY_PHONE_BUSINESS)) + calllist_add_contact(entry->name, entry->phone_business, + CONTACT_PHONE_BUSINESS, photo); + // Create entry for home phone information + if (addressbook_display(addressbook_config, + ADDRESSBOOK_DISPLAY_PHONE_HOME)) + calllist_add_contact(entry->name, entry->phone_home, + CONTACT_PHONE_HOME, photo); + // Create entry for mobile phone information + if (addressbook_display(addressbook_config, + ADDRESSBOOK_DISPLAY_PHONE_MOBILE)) + calllist_add_contact(entry->name, entry->phone_mobile, + CONTACT_PHONE_MOBILE, photo); + } + free_hit(entry); + } + g_list_free(hits); + + // Deactivate waiting image + deactivateWaitingLayer(); +} + diff --git a/sflphone-gtk/src/contacts/addressbook.h b/sflphone-gtk/src/contacts/addressbook.h new file mode 100644 index 0000000000000000000000000000000000000000..f83aefaf5bf6a93f1ec61c8e51e6c1dce87c75ba --- /dev/null +++ b/sflphone-gtk/src/contacts/addressbook.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/** + * This file contains functions specific for addressbook. + * It is used as a "mapping" between real search implementation + * and search bar. + */ + +#ifndef __ADDRESSBOOK_H__ +#define __ADDRESSBOOK_H__ + +#include <gtk/gtk.h> +#include <addressbook/eds.h> + +/** + * Return addressbook state + */ +gboolean +addressbook_is_ready(); + +/** + * Perform a search in addressbook + */ +void +addressbook_search(GtkEntry*); + +/** + * Initialize addressbook + */ +void +addressbook_init(); + +#endif diff --git a/sflphone-gtk/src/contacts/addressbook/Makefile.am b/sflphone-gtk/src/contacts/addressbook/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..9864cf7e3bca2eda4da100ae545187c8364893dd --- /dev/null +++ b/sflphone-gtk/src/contacts/addressbook/Makefile.am @@ -0,0 +1,9 @@ +include ../../../globals.mak + +noinst_LTLIBRARIES = libaddressbook.la + +libaddressbook_la_SOURCES = eds.c + +libaddressbook_la_LDFLAGS = @DEPS_LDFLAGS@ + +libaddressbook_la_CFLAGS = @DEPS_CFLAGS@ diff --git a/sflphone-gtk/src/contacts/addressbook/eds.c b/sflphone-gtk/src/contacts/addressbook/eds.c new file mode 100644 index 0000000000000000000000000000000000000000..8d26070a47af2268db4a84020bccb0061c03ad9f --- /dev/null +++ b/sflphone-gtk/src/contacts/addressbook/eds.c @@ -0,0 +1,547 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> + * + * File originally copied from evolution module of deskbar-applet 2.24.1 + * Authors : + * Nigel Tao <nigel.tao@myrealbox.com> + * Raphaël Slinckx <raphael@slinckx.net> + * Mikkel Kamstrup Erlandsen <kamstrup@daimi.au.dk> + * Sebastian Pölsterl <marduk@k-d-w.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <glib.h> +#include <glib/gstring.h> +#include <string.h> +#include <pango/pango.h> +#include "eds.h" + +/** + * Structure used to store search callback and data + */ +typedef struct _Search_Handler_And_Data +{ + int search_id; + SearchAsyncHandler handler; + gpointer user_data; + GList *hits; + int max_results_remaining; + int book_views_remaining; +} Search_Handler_And_Data; + +/** + * Structure used to store open callback and data + */ +typedef struct _Open_Handler_And_Data +{ + OpenAsyncHandler handler; +} Open_Handler_And_Data; + +/** + * Size of image that will be displayed in contact list + */ +static int pixbuf_size = 32; + +/** + * Remaining books to open (asynchronous) + */ +int remaining_books_to_open; + +/** + * Fields on which search will be performed + */ +static EContactField search_fields[] = + { E_CONTACT_FULL_NAME, E_CONTACT_PHONE_BUSINESS, E_CONTACT_NICKNAME, 0 }; + +static int n_search_fields = G_N_ELEMENTS (search_fields) - 1; + +/** + * Freeing a hit instance + */ +void +free_hit(Hit *h) +{ + g_free(h->name); + g_free(h->phone_business); + g_free(h->phone_home); + g_free(h->phone_mobile); + g_free(h); +} + +/** + * Public way to know if we can perform a search + */ +gboolean +books_ready() +{ + return (g_slist_length(books_data) > 0); +} + +/** + * Get a specific book data by UID + */ +book_data_t * +books_get_book_data_by_uid(gchar *uid) +{ + GSList *book_list_iterator; + book_data_t *book_data; + + // Iterate throw the list + for (book_list_iterator = books_data; book_list_iterator != NULL; book_list_iterator + = book_list_iterator->next) + { + book_data = (book_data_t *) book_list_iterator->data; + if (strcmp(book_data->uid, uid) == 0) + return book_data; + } + + // If no result + return NULL; +} + +/** + * Split a string of tokens separated by whitespace into an array of tokens. + */ +static GArray * +split_query_string(const gchar *str) +{ + GArray *parts = g_array_sized_new(FALSE, FALSE, sizeof (char *), 2); + PangoLogAttr *attrs; + guint str_len = strlen (str), word_start = 0, i; + + attrs = g_new0 (PangoLogAttr, str_len + 1); + /* TODO: do we need to specify a particular language or is NULL ok? */ + pango_get_log_attrs (str, -1, -1, NULL, attrs, str_len + 1); + + for (i = 0; i < str_len + 1; i++) + { + char *start_word, *end_word, *word; + if (attrs[i].is_word_end) + { + start_word = g_utf8_offset_to_pointer (str, word_start); + end_word = g_utf8_offset_to_pointer (str, i); + word = g_strndup (start_word, end_word - start_word); + g_array_append_val (parts, word); + } + if (attrs[i].is_word_start) + { + word_start = i; + } + } + g_free (attrs); + return parts; +} + + /** + * Create a query which looks for the specified string in a contact's full name, email addresses and + * nick name. + */ +static EBookQuery* +create_query(const char* s) +{ + EBookQuery *query; + GArray *parts = split_query_string(s); + EBookQuery ***field_queries; + EBookQuery **q; + EBookQuery **phone; + guint j; + int i; + + q = g_new0 (EBookQuery *, n_search_fields); + field_queries = g_new0 (EBookQuery **, n_search_fields); + + for (i = 0; i < n_search_fields; i++) + { + field_queries[i] = g_new0 (EBookQuery *, parts->len); + for (j = 0; j < parts->len; j++) + { + field_queries[i][j] = e_book_query_field_test(search_fields[i], + E_BOOK_QUERY_CONTAINS, g_array_index (parts, gchar *, j)); + } + q[i] = e_book_query_and(parts->len, field_queries[i], TRUE); + } + g_array_free(parts, TRUE); + + phone = g_new0 (EBookQuery *, 3); + phone[0] = e_book_query_field_exists(E_CONTACT_PHONE_BUSINESS); + phone[1] = e_book_query_field_exists(E_CONTACT_PHONE_HOME); + phone[2] = e_book_query_field_exists(E_CONTACT_PHONE_MOBILE); + + query = e_book_query_andv(e_book_query_or(n_search_fields, q, FALSE), + e_book_query_or(3, phone, FALSE), NULL); + + for (i = 0; i < n_search_fields; i++) + { + g_free(field_queries[i]); + } + g_free(field_queries); + g_free(q); + g_free(phone); + + return query; +} + +/** + * Retrieve the contact's picture + */ +static GdkPixbuf* +pixbuf_from_contact(EContact *contact) +{ + + GdkPixbuf *pixbuf = NULL; + EContactPhoto *photo = e_contact_get(contact, E_CONTACT_PHOTO); + if (photo) + { + GdkPixbufLoader *loader; + + loader = gdk_pixbuf_loader_new(); + + if (photo->type == E_CONTACT_PHOTO_TYPE_INLINED) + { + if (gdk_pixbuf_loader_write(loader, + (guchar *) photo->data.inlined.data, photo->data.inlined.length, + NULL)) + pixbuf = gdk_pixbuf_loader_get_pixbuf(loader); + } + + // If pixbuf has been found, check size and resize if needed + if (pixbuf) + { + GdkPixbuf *tmp; + gint width = gdk_pixbuf_get_width(pixbuf); + gint height = gdk_pixbuf_get_height(pixbuf); + double scale = 1.0; + + if (height > width) + { + scale = pixbuf_size / (double) height; + } + else + { + scale = pixbuf_size / (double) width; + } + + if (scale < 1.0) + { + tmp = gdk_pixbuf_scale_simple(pixbuf, width * scale, height + * scale, GDK_INTERP_BILINEAR); + g_object_unref(pixbuf); + pixbuf = tmp; + } + } + e_contact_photo_free(photo); + } + return pixbuf; +} + +/** + * Callback for asynchronous open of books + */ +static void +eds_async_open_callback(EBook *book, EBookStatus status, gpointer closure) +{ + Open_Handler_And_Data *had = (Open_Handler_And_Data *) closure; + + remaining_books_to_open--; + + if (status == E_BOOK_ERROR_OK) + { + book_data_t *book_data = g_new(book_data_t, 1); + book_data->active = FALSE; + book_data->name = g_strdup(e_source_peek_name(e_book_get_source(book))); + book_data->uid = g_strdup(e_source_peek_uid(e_book_get_source(book))); + book_data->ebook = book; + books_data = g_slist_prepend(books_data, book_data); + had->handler(); + } + else + { + WARN("Got error %d when opening book", status); + } +} + +/** + * Initialize address book + */ +void +init(OpenAsyncHandler callback) +{ + GSList *list, *l; + ESourceList *source_list; + remaining_books_to_open = 0; + books_data = NULL; + + source_list = e_source_list_new_for_gconf_default( + "/apps/evolution/addressbook/sources"); + if (source_list == NULL) + { + return; + } + + list = e_source_list_peek_groups(source_list); + + Open_Handler_And_Data *had = g_new (Open_Handler_And_Data, 1); + had->handler = callback; + + for (l = list; l != NULL; l = l->next) + { + ESourceGroup *group = l->data; + GSList *sources = NULL, *m; + sources = e_source_group_peek_sources(group); + for (m = sources; m != NULL; m = m->next) + { + ESource *source = m->data; + EBook *book = e_book_new(source, NULL); + if (book != NULL) + { + // Keep count of remaining books to open + remaining_books_to_open++; + + // Asynchronous open + e_book_async_open(book, TRUE, eds_async_open_callback, had); + } + } + } + current_search_id = 0; + + g_object_unref(source_list); +} + +/** + * Final callback after all books have been processed. + */ +static void +view_finish(EBookView *book_view, Search_Handler_And_Data *had) +{ + GList *i; + SearchAsyncHandler had_handler = had->handler; + GList *had_hits = had->hits; + gpointer had_user_data = had->user_data; + int search_id = had->search_id; + g_free(had); + + if (book_view != NULL) + g_object_unref(book_view); + + if (search_id == current_search_id) + { + // Reinitialize search id to prevent overflow + if (current_search_id > 5000) + current_search_id = 0; + + // Call display callback + had_handler(had_hits, had_user_data); + } + else + { + // Some hits could have been processed but will not be used + for (i = had_hits; i != NULL; i = i->next) + { + Hit *entry; + entry = i->data; + free_hit(entry); + } + g_list_free(had_hits); + } +} + +/** + * Callback called after each ebook search completed. + * Used to store book search results. + */ +static void +view_contacts_added_cb(EBookView *book_view, GList *contacts, + gpointer user_data) +{ + GdkPixbuf *photo; + + Search_Handler_And_Data *had = (Search_Handler_And_Data *) user_data; + + // If it's not the last search launched, stop it + if (had->search_id != current_search_id) + { + e_book_view_stop(book_view); + return; + } + + // If we reached max results + if (had->max_results_remaining <= 0) + { + e_book_view_stop(book_view); + had->book_views_remaining--; + + // All books have been computed + if (had->book_views_remaining == 0) + { + view_finish(book_view, had); + return; + } + } + + // For each contact + for (; contacts != NULL; contacts = g_list_next (contacts)) + { + EContact *contact; + Hit *hit; + gchar *number; + + contact = E_CONTACT (contacts->data); + hit = g_new (Hit, 1); + + // Get the photo contact + photo = pixbuf_from_contact(contact); + hit->photo = photo; + + // Get business phone information + fetch_information_from_contact(contact, E_CONTACT_PHONE_BUSINESS, &number); + hit->phone_business = g_strdup(number); + + // Get home phone information + fetch_information_from_contact(contact, E_CONTACT_PHONE_HOME, &number); + hit->phone_home = g_strdup(number); + + // Get mobile phone information + fetch_information_from_contact(contact, E_CONTACT_PHONE_MOBILE, &number); + hit->phone_mobile = g_strdup(number); + + hit->name = g_strdup((char*) e_contact_get_const(contact, + E_CONTACT_NAME_OR_ORG)); + if (!hit->name) + hit->name = ""; + + // Append list of contacts + had->hits = g_list_append(had->hits, hit); + had->max_results_remaining--; + + // If we reached max results + if (had->max_results_remaining <= 0) + { + e_book_view_stop(book_view); + had->book_views_remaining--; + if (had->book_views_remaining == 0) + { + view_finish(book_view, had); + } + break; + } + } +} + +/** + * Callback called after each ebook search completed. + * Used to call final callback when all books have been read. + */ +static void +view_completed_cb(EBookView *book_view, EBookViewStatus status UNUSED, +gpointer user_data) +{ + Search_Handler_And_Data *had = (Search_Handler_And_Data *) user_data; + had->book_views_remaining--; + + // All books have been prcessed + if (had->book_views_remaining == 0) + { + // Call finish function + view_finish(book_view, had); + } +} + +/** + * Perform an asynchronous search + */ +void +search_async(const char *query, int max_results, SearchAsyncHandler handler, + gpointer user_data) +{ + // Increment search id + current_search_id++; + + // If query is null + if (strlen(query) < 1 || g_slist_length(books_data) == 0) + { + // If data displayed (from previous search), directly call callback + handler(NULL, user_data); + + return; + } + + GSList *iter; + EBookQuery* book_query = create_query(query); + Search_Handler_And_Data *had = g_new (Search_Handler_And_Data, 1); + int search_count = 0; + + // Initialize search data + had->search_id = current_search_id; + had->handler = handler; + had->user_data = user_data; + had->hits = NULL; + had->max_results_remaining = max_results; + had->book_views_remaining = 0; + + // Iterate throw books data + for (iter = books_data; iter != NULL; iter = iter->next) + { + book_data_t *book_data = (book_data_t *) iter->data; + + // If book is active + if (book_data->active) + { + EBookView *book_view = NULL; + e_book_get_book_view(book_data->ebook, book_query, NULL, max_results, + &book_view, NULL); + + // If book view exists + if (book_view != NULL) + { + // Perform search + had->book_views_remaining++; + g_signal_connect (book_view, "contacts_added", (GCallback) view_contacts_added_cb, had); + g_signal_connect (book_view, "sequence_complete", (GCallback) view_completed_cb, had); + e_book_view_start(book_view); + search_count++; + } + } + } + + e_book_query_unref(book_query); + + // If no search has been executed (no book selected) + if (search_count == 0) + { + // Call last callback anyway + view_finish(NULL, had); + } +} + +/** + * Fetch information for a specific contact + */ +void +fetch_information_from_contact(EContact *contact, EContactField field, + gchar **info) +{ + gchar *to_fetch; + + to_fetch = g_strdup((char*) e_contact_get_const(contact, field)); + if (!to_fetch) + { + to_fetch = g_strdup(EMPTY_ENTRY); + } + + *info = g_strdup(to_fetch); +} + diff --git a/sflphone-gtk/src/contactlist/eds.h b/sflphone-gtk/src/contacts/addressbook/eds.h similarity index 60% rename from sflphone-gtk/src/contactlist/eds.h rename to sflphone-gtk/src/contacts/addressbook/eds.h index 64d464e04f70c044111d2ba898e37993a5f5da2f..7248c2c3a0f481b21e053b0810910904d37843c3 100644 --- a/sflphone-gtk/src/contactlist/eds.h +++ b/sflphone-gtk/src/contacts/addressbook/eds.h @@ -30,53 +30,99 @@ #include <glib/gtypes.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <libebook/e-book.h> +#include <sflphone_const.h> #define EMPTY_ENTRY "empty" G_BEGIN_DECLS +/** + * Current search id used to prevent processing + * of previous search + */ int current_search_id; /** - * Reprsent a contact entry + * Represent a contact entry */ typedef struct _Hit { - gchar *name; - GdkPixbuf *photo; - gchar *phone_business; - gchar *phone_home; - gchar *phone_mobile; + gchar *name; + GdkPixbuf *photo; + gchar *phone_business; + gchar *phone_home; + gchar *phone_mobile; } Hit; +/** + * Book structure for "outside world" + */ +typedef struct +{ + gchar *uid; + gchar *name; + gboolean active; + EBook *ebook; +} book_data_t; + +GSList *books_data; + /** * Free a contact entry */ -void free_hit (Hit *h); +void +free_hit(Hit *h); /** * Template callback function for the asynchronous search */ -typedef void (* SearchAsyncHandler) (GList *hits, gpointer user_data); +typedef void +(* SearchAsyncHandler)(GList *hits, gpointer user_data); + +/** + * Template callback function for the asynchronous open + */ +typedef void +(* OpenAsyncHandler)(); /** * Initialize the address book. * Connection to evolution data server */ -void init (void); +void +init(OpenAsyncHandler); /** * Asynchronous search function */ -void search_async (const char *query, - int max_results, - SearchAsyncHandler handler, - gpointer user_data); +void +search_async(const char *query, int max_results, SearchAsyncHandler handler, + gpointer user_data); /** * Retrieve the specified information from the contact */ -void fetch_information_from_contact (EContact *contact, EContactField field, gchar **info); +void +fetch_information_from_contact(EContact *contact, EContactField field, + gchar **info); + +GSList* +get_books(void); + +book_data_t * +books_get_book_data_by_uid(gchar *uid); + +/** + * Public way to know if we can perform a search + */ +gboolean +books_ready(); + +/** + * Good method to retrieve books_data (handle async) + */ +GSList * +addressbook_get_books_data(); G_END_DECLS diff --git a/sflphone-gtk/src/contacts/calllist.c b/sflphone-gtk/src/contacts/calllist.c new file mode 100644 index 0000000000000000000000000000000000000000..d92589553b357c92ce49ea3b1714fd48c45bb665 --- /dev/null +++ b/sflphone-gtk/src/contacts/calllist.c @@ -0,0 +1,183 @@ +/* + * Copyright (C) 2007 Savoir-Faire Linux inc. + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <calllist.h> +#include <calltree.h> +#include <contacts/searchbar.h> + +// TODO : sflphoneGTK : try to do this more generic +void calllist_add_contact (gchar *contact_name, gchar *contact_phone, contact_type_t type, GdkPixbuf *photo){ + + gchar *from; + call_t *new_call; + GdkPixbuf *pixbuf; + + /* Check if the information is valid */ + if (g_strcasecmp (contact_phone, EMPTY_ENTRY) != 0){ + from = g_strconcat("\"" , contact_name, "\"<", contact_phone, ">", NULL); + create_new_call (from, from, CALL_STATE_DIALING, "", &new_call); + + // Attach a pixbuf to a contact + if (photo) { + attach_thumbnail (new_call, gdk_pixbuf_copy(photo)); + } + else { + switch (type) { + case CONTACT_PHONE_BUSINESS: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/face-monkey.svg", NULL); + break; + case CONTACT_PHONE_HOME: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/home.svg", NULL); + break; + case CONTACT_PHONE_MOBILE: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/users.svg", NULL); + break; + default: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/contact_default.svg", NULL); + break; + } + attach_thumbnail (new_call, pixbuf); + } + + calllist_add (contacts, new_call); + calltree_add_call(contacts, new_call); + } +} + +void +calllist_init (calltab_t* tab) +{ + tab->callQueue = g_queue_new (); + tab->selectedCall = NULL; +} + +void +calllist_clean (calltab_t* tab) +{ + g_queue_free (tab->callQueue); +} + +void +calllist_reset (calltab_t* tab) +{ + g_queue_free (tab->callQueue); + tab->callQueue = g_queue_new(); +} + +void +calllist_add (calltab_t* tab, call_t * c) +{ + if( tab == history ) + { + // First case: can still add calls to the list + if( calllist_get_size(tab) < dbus_get_max_calls() ) + { + g_queue_push_tail (tab->callQueue, (gpointer *) c); + calltree_add_call( history , c ); + } + // List full -> Remove the last call from history and preprend the new call to the list + else + { + calltree_remove_call( history , (call_t*)g_queue_pop_head( tab -> callQueue ) ); + g_queue_push_tail (tab->callQueue, (gpointer *) c); + calltree_add_call( history , c ); + } + } + else + g_queue_push_tail (tab->callQueue, (gpointer *) c); +} + +// TODO : sflphoneGTK : try to do this more generic +void +calllist_clean_history( void ) +{ + unsigned int i; + guint size = calllist_get_size( history ); + DEBUG("history list size = %i", calllist_get_size( history )); + for( i = 0 ; i < size ; i++ ) + { + DEBUG("Delete calls"); + call_t* c = calllist_get_nth( history , i ); + // Delete the call from the call tree + DEBUG("Delete calls"); + calltree_remove_call(history , c); + } + calllist_reset( history ); +} + +// TODO : sflphoneGTK : try to do this more generic +void +calllist_remove_from_history( call_t* c ) +{ + calllist_remove( history, c->callID ); + calltree_remove_call( history, c ); + DEBUG("Size of history = %i" , calllist_get_size( history )); +} + +void +calllist_remove (calltab_t* tab, const gchar * callID) +{ + call_t * c = calllist_get(tab, callID); + if (c) + { + g_queue_remove(tab->callQueue, c); + } +} + + +call_t * +calllist_get_by_state (calltab_t* tab, call_state_t state ) +{ + GList * c = g_queue_find_custom (tab->callQueue, &state, get_state_callstruct); + if (c) + { + return (call_t *)c->data; + } + else + { + return NULL; + } + +} + +guint +calllist_get_size (calltab_t* tab) +{ + return g_queue_get_length (tab->callQueue); +} + +call_t * +calllist_get_nth (calltab_t* tab, guint n ) +{ + return g_queue_peek_nth (tab->callQueue, n); +} + +call_t * +calllist_get (calltab_t* tab, const gchar * callID ) +{ + GList * c = g_queue_find_custom (tab->callQueue, callID, is_callID_callstruct); + if (c) + { + return (call_t *)c->data; + } + else + { + return NULL; + } +} diff --git a/sflphone-gtk/src/contacts/calllist.h b/sflphone-gtk/src/contacts/calllist.h new file mode 100644 index 0000000000000000000000000000000000000000..d1e308eca3acc965a1f8f14d88db0c91deccc0e2 --- /dev/null +++ b/sflphone-gtk/src/contacts/calllist.h @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2007 Savoir-Faire Linux inc. + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __CALLLIST_H__ +#define __CALLLIST_H__ + +#include <call.h> +#include <gtk/gtk.h> + +/** @file calllist.h + * @brief A list to hold calls. + */ + +typedef struct { + GtkListStore* store; + GtkWidget* view; + GtkWidget* tree; + GtkWidget* searchbar; + + // Calllist vars + GQueue* callQueue; + call_t* selectedCall; +} calltab_t; + +void +calllist_add_contact (gchar *, gchar *, contact_type_t, GdkPixbuf *); + +/** This function initialize a call list. */ +void +calllist_init (calltab_t* tab); + +/** This function empty and free the call list. */ +void +calllist_clean(calltab_t* tab); + +/** This function empty, free the call list and allocate a new one. */ +void +calllist_reset (calltab_t* tab); + +/** Get the maximun number of calls in the history calltab */ +gdouble +call_history_get_max_calls( void ); + +/** Set the maximun number of calls in the history calltab */ +void +call_history_set_max_calls( const gdouble number ); + +/** This function append a call to list. + * @param c The call you want to add + * */ +void +calllist_add (calltab_t* tab, call_t * c); + +/** This function remove a call from list. + * @param callID The callID of the call you want to remove + */ +void +calllist_remove (calltab_t* tab, const gchar * callID); + +/** Return the first call that corresponds to the state. + * This is usefull for unique states as DIALING and CURRENT. + * @param state The state + * @return A call or NULL */ +call_t * +calllist_get_by_state (calltab_t* tab, call_state_t state); + +/** Return the number of calls in the list + * @return The number of calls in the list */ +guint +calllist_get_size (calltab_t* tab); + +/** Return the call at the nth position in the list + * @param n The position of the call you want + * @return A call or NULL */ +call_t * +calllist_get_nth (calltab_t* tab, guint n ); + +/** Return the call corresponding to the callID + * @param n The callID of the call you want + * @return A call or NULL */ +call_t * +calllist_get (calltab_t* tab, const gchar * callID ); + +/** + * Clean the history. Delete all calls + */ +void +calllist_clean_history(); + +/** + * Remove one specified call from the history list + * @param c The call to remove + */ +void +calllist_remove_from_history( call_t* c); + +#endif diff --git a/sflphone-gtk/src/calltab.c b/sflphone-gtk/src/contacts/calltab.c similarity index 73% rename from sflphone-gtk/src/calltab.c rename to sflphone-gtk/src/contacts/calltab.c index 8ed40db848251de1bc8b5fc8a4a9c94c07685649..2fa6c2eea8e831b22403fc49a0855964dafe8530 100644 --- a/sflphone-gtk/src/calltab.c +++ b/sflphone-gtk/src/contacts/calltab.c @@ -17,11 +17,11 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <calltab.h> #include <gtk/gtk.h> #include <stdlib.h> #include <calltree.h> -#include <calllist.h> -#include <calltab.h> +#include <contacts/searchbar.h> calltab_t* calltab_init(gchar* searchbar_type) @@ -33,14 +33,32 @@ calltab_init(gchar* searchbar_type) ret->store = NULL; ret->view = NULL; ret->tree = NULL; - ret->searchbar = NULL; + ret->searchbar = NULL; ret->callQueue = NULL; ret->selectedCall = NULL; - // ret->histfilter = NULL; - create_call_tree(ret, searchbar_type); - call_list_init(ret); + calltree_create(ret, searchbar_type); + calllist_init(ret); return ret; } + +void +calltab_select_call (calltab_t* tab, call_t * c ) +{ + tab->selectedCall = c; +} + + +call_t * +calltab_get_selected_call (calltab_t* tab) +{ + return tab->selectedCall; +} + +void +calltab_create_searchbar(calltab_t* tab, gchar* searchbar_type) +{ + tab->searchbar = searchbar_new(searchbar_type); +} diff --git a/sflphone-gtk/src/calltab.h b/sflphone-gtk/src/contacts/calltab.h similarity index 64% rename from sflphone-gtk/src/calltab.h rename to sflphone-gtk/src/contacts/calltab.h index 4438d3d8fcb2810be0948c3a4f0144f0698edc71..65320cc3bb7637cf205871d75e8b8596de71f35c 100644 --- a/sflphone-gtk/src/calltab.h +++ b/sflphone-gtk/src/contacts/calltab.h @@ -17,14 +17,31 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef __NOTEBOOK_H__ -#define __NOTEBOOK_H__ +#ifndef __CALLTAB_H__ +#define __CALLTAB_H__ #include <calllist.h> #include <gtk/gtk.h> -GtkTreeModel* histfilter; +calltab_t* active_calltree; +calltab_t* current_calls; +calltab_t* history; +calltab_t* contacts; calltab_t* calltab_init(gchar* searchbar_type); +/** Mark a call as selected. There can be only one selected call. This call + * is the currently highlighted one in the list. + * @param c The call */ +void +calltab_select_call (calltab_t*, call_t *); + +/** Return the selected call. + * @return The number of the caller */ +call_t * +calltab_get_selected_call (calltab_t*); + +void +calltab_create_searchbar(calltab_t *, gchar *); + #endif diff --git a/sflphone-gtk/src/contacts/calltree.c b/sflphone-gtk/src/contacts/calltree.c new file mode 100644 index 0000000000000000000000000000000000000000..0dd939b6e6ea9bd250b89852d56d397588a3e828 --- /dev/null +++ b/sflphone-gtk/src/contacts/calltree.c @@ -0,0 +1,549 @@ +/* + * Copyright (C) 2007 Savoir-Faire Linux inc. + * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <calltree.h> +#include <stdlib.h> +#include <glib/gprintf.h> +#include <calllist.h> +#include <toolbar.h> + +/** + * Show popup menu + */ + static gboolean +popup_menu (GtkWidget *widget, + gpointer user_data UNUSED) +{ + show_popup_menu(widget, NULL); + return TRUE; +} + +/* Call back when the user click on a call in the list */ + static void +selected(GtkTreeSelection *sel, void* data UNUSED ) +{ + GtkTreeIter iter; + GValue val; + GtkTreeModel *model = (GtkTreeModel*)active_calltree->store; + + if (! gtk_tree_selection_get_selected (sel, &model, &iter)) + return; + + val.g_type = 0; + gtk_tree_model_get_value (model, &iter, 2, &val); + + calltab_select_call(active_calltree, (call_t*) g_value_get_pointer(&val)); + g_value_unset(&val); + + toolbar_update_buttons(); +} + +/* A row is activated when it is double clicked */ +void row_activated(GtkTreeView *tree_view UNUSED, + GtkTreePath *path UNUSED, + GtkTreeViewColumn *column UNUSED, + void * data UNUSED) +{ + call_t* selectedCall; + call_t* new_call; + gchar *to, *from, *account_id; + + DEBUG("double click action"); + + selectedCall = calltab_get_selected_call( active_calltree ); + + if (selectedCall) + { + // Get the right event from the right calltree + if( active_calltree == current_calls ) + { + switch(selectedCall->state) + { + case CALL_STATE_INCOMING: + dbus_accept(selectedCall); + stop_notification(); + break; + case CALL_STATE_HOLD: + dbus_unhold(selectedCall); + break; + case CALL_STATE_RINGING: + case CALL_STATE_CURRENT: + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + break; + case CALL_STATE_DIALING: + sflphone_place_call (selectedCall); + break; + default: + WARN("Row activated - Should not happen!"); + break; + } + } + + // If history or contact: double click action places a new call + else + { + to = g_strdup(call_get_number(selectedCall)); + from = g_strconcat("\"", call_get_name (selectedCall), "\" <", call_get_number(selectedCall), ">",NULL); + account_id = g_strdup (selectedCall->accountID); + + // Create a new call + create_new_call (to, from, CALL_STATE_DIALING, account_id, &new_call); + + calllist_add(current_calls, new_call); + calltree_add_call(current_calls, new_call); + sflphone_place_call(new_call); + calltree_display(current_calls); + } + } +} + + static gboolean +on_key_released (GtkWidget *widget UNUSED, + GdkEventKey *event, + gpointer user_data UNUSED) +{ + // If a modifier key is pressed, it's a shortcut, pass along + if(event->state & GDK_CONTROL_MASK || + event->state & GDK_MOD1_MASK || + event->keyval == 60 || // < + event->keyval == 62 || // > + event->keyval == 34 || // " + event->keyval == 65361 || // left arrow + event->keyval == 65363 || // right arrow + event->keyval >= 65470 || // F-keys + event->keyval == 32 // space + ) + return FALSE; + else + sflphone_keypad(event->keyval, event->string); + return TRUE; +} + + static gboolean +button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data UNUSED) +{ + if (event->button == 3 && event->type == GDK_BUTTON_PRESS) + { + if( active_calltree == current_calls ) + { + show_popup_menu(widget, event); + return TRUE; + } + else if (active_calltree == history) + { + show_popup_menu_history (widget, event); + return TRUE; + } + else{ + show_popup_menu_contacts (widget, event); + return TRUE; + } + } + return FALSE; +} + +/** + * Reset call tree + */ + void +calltree_reset (calltab_t* tab) +{ + gtk_list_store_clear (tab->store); +} + + void +calltree_create (calltab_t* tab, gchar* searchbar_type) +{ + GtkWidget *sw; + GtkCellRenderer *rend; + GtkTreeViewColumn *col; + GtkTreeSelection *sel; + + tab->tree = gtk_vbox_new(FALSE, 10); + + // Fix bug #708 (resize) + gtk_widget_set_usize(tab->tree,100,80); + + gtk_container_set_border_width (GTK_CONTAINER (tab->tree), 0); + + sw = gtk_scrolled_window_new( NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); + g_signal_connect (G_OBJECT ( sw ), "key-release-event",G_CALLBACK (on_key_released), NULL); + + tab->store = gtk_list_store_new (3, + GDK_TYPE_PIXBUF,// Icon + G_TYPE_STRING, // Description + G_TYPE_POINTER // Pointer to the Object + ); + + tab->view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(tab->store)); + gtk_tree_view_set_enable_search( GTK_TREE_VIEW(tab->view), FALSE); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(tab->view), FALSE); + g_signal_connect (G_OBJECT (tab->view), "row-activated", + G_CALLBACK (row_activated), + NULL); + + // Connect the popup menu + g_signal_connect (G_OBJECT (tab->view), "popup-menu", + G_CALLBACK (popup_menu), + NULL); + g_signal_connect (G_OBJECT (tab->view), "button-press-event", + G_CALLBACK (button_pressed), + NULL); + + + rend = gtk_cell_renderer_pixbuf_new(); + col = gtk_tree_view_column_new_with_attributes ("Icon", + rend, + "pixbuf", 0, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(tab->view), col); + + rend = gtk_cell_renderer_text_new(); + col = gtk_tree_view_column_new_with_attributes ("Description", + rend, + "markup", 1, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(tab->view), col); + + g_object_unref(G_OBJECT(tab->store)); + gtk_container_add(GTK_CONTAINER(sw), tab->view); + + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tab->view)); + g_signal_connect (G_OBJECT (sel), "changed", + G_CALLBACK (selected), + NULL); + + gtk_box_pack_start(GTK_BOX(tab->tree), sw, TRUE, TRUE, 0); + + // no search bar if tab is either "history" or "addressbook" + if(searchbar_type){ + calltab_create_searchbar(tab,searchbar_type); + gtk_box_pack_start(GTK_BOX(tab->tree), tab->searchbar, FALSE, TRUE, 0); + } + + gtk_widget_show(tab->tree); + + + // gtk_widget_show(tab->searchbar); + + //toolbar_update_buttons(); + +} + + void +calltree_remove_call (calltab_t* tab, call_t * c) +{ + GtkTreeIter iter; + GValue val; + call_t * iterCall; + GtkListStore* store = tab->store; + + int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); + int i; + for( i = 0; i < nbChild; i++) + { + if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i)) + { + val.g_type = 0; + gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter, 2, &val); + + iterCall = (call_t*) g_value_get_pointer(&val); + g_value_unset(&val); + + if(iterCall == c) + { + gtk_list_store_remove(store, &iter); + } + } + } + call_t * selectedCall = calltab_get_selected_call(tab); + if(selectedCall == c) + calltab_select_call(tab, NULL); + toolbar_update_buttons(); +} + + void +calltree_update_call (calltab_t* tab, call_t * c) +{ + GdkPixbuf *pixbuf=NULL; + GtkTreeIter iter; + GValue val; + call_t * iterCall; + GtkListStore* store = tab->store; + + int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); + int i; + for( i = 0; i < nbChild; i++) + { + if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i)) + { + val.g_type = 0; + gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter, 2, &val); + + iterCall = (call_t*) g_value_get_pointer(&val); + g_value_unset(&val); + + if(iterCall == c) + { + // Existing call in the list + gchar * description; + gchar * date=""; + gchar * duration=""; + if(c->state == CALL_STATE_TRANSFERT) + { + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>Transfert to:</i> %s", + call_get_number(c), + call_get_name(c), + c->to); + } + else + { + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", + call_get_number(c), + call_get_name(c)); + } + + if( tab == current_calls ) + { + switch(c->state) + { + case CALL_STATE_HOLD: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/hold.svg", NULL); + break; + case CALL_STATE_RINGING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); + break; + case CALL_STATE_CURRENT: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL); + break; + case CALL_STATE_DIALING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); + break; + case CALL_STATE_FAILURE: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/fail.svg", NULL); + break; + case CALL_STATE_BUSY: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/busy.svg", NULL); + break; + case CALL_STATE_TRANSFERT: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/transfert.svg", NULL); + break; + case CALL_STATE_RECORD: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/rec_call.svg", NULL); + break; + default: + WARN("Update calltree - Should not happen!"); + } + } + else + { + switch(c->history_state) + { + case OUTGOING: + DEBUG("Outgoing state"); + pixbuf = gdk_pixbuf_new_from_file( ICONS_DIR "/outgoing.svg", NULL); + break; + case INCOMING: + DEBUG("Incoming state"); + pixbuf = gdk_pixbuf_new_from_file( ICONS_DIR "/incoming.svg", NULL); + break; + case MISSED: + DEBUG("Missed state"); + pixbuf = gdk_pixbuf_new_from_file( ICONS_DIR "/missed.svg", NULL); + break; + default: + DEBUG("No history state"); + break; + } + date = timestamp_get_call_date(); + duration = process_call_duration(c); + duration = g_strconcat( date , duration , NULL); + description = g_strconcat( description , duration, NULL); + } + //Resize it + if(pixbuf) + { + if(gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32) + { + pixbuf = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); + } + } + gtk_list_store_set(store, &iter, + 0, pixbuf, // Icon + 1, description, // Description + -1); + + if (pixbuf != NULL) + g_object_unref(G_OBJECT(pixbuf)); + + } + } + + } + toolbar_update_buttons(); +} + + void +calltree_add_call (calltab_t* tab, call_t * c) +{ + if( tab == history && ( calllist_get_size( tab ) > dbus_get_max_calls() ) ) + return; + + GdkPixbuf *pixbuf=NULL; + GtkTreeIter iter; + GtkTreeSelection* sel; + + // New call in the list + gchar * description; + gchar * date=""; + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", + call_get_number(c), + call_get_name(c)); + + gtk_list_store_prepend (tab->store, &iter); + + if( tab == current_calls ) + { + switch(c->state) + { + case CALL_STATE_INCOMING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); + break; + case CALL_STATE_DIALING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); + break; + case CALL_STATE_RINGING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); + break; + default: + WARN("Update calltree add - Should not happen!"); + } + } + + else if (tab == history) { + switch(c->history_state) + { + case INCOMING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/incoming.svg", NULL); + break; + case OUTGOING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/outgoing.svg", NULL); + break; + case MISSED: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/missed.svg", NULL); + break; + default: + WARN("History - Should not happen!"); + } + date = timestamp_get_call_date(); + description = g_strconcat( date , description , NULL); + } + + else if (tab == contacts) { + pixbuf = c->contact_thumbnail; + description = g_strconcat( description , NULL); + } + + else { + WARN ("This widget doesn't exist - This is a bug in the application."); + } + + + //Resize it + if(pixbuf) + { + if(gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32) + { + pixbuf = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); + } + } + gtk_list_store_set(tab->store, &iter, + 0, pixbuf, // Icon + 1, description, // Description + 2, c, // Pointer + -1); + + if (pixbuf != NULL) + g_object_unref(G_OBJECT(pixbuf)); + + sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tab->view)); + gtk_tree_selection_select_iter(GTK_TREE_SELECTION(sel), &iter); + toolbar_update_buttons(); +} + +void calltree_display (calltab_t *tab) { + + GtkTreeSelection *sel; + + /* If we already are displaying the specified calltree */ + if (active_calltree == tab) + return; + + /* case 1: we want to display the main calltree */ + if (tab==current_calls) { + + DEBUG ("display main tab"); + + if (active_calltree==contacts) { + gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, FALSE); + } else { + gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, FALSE); + } + + } + + /* case 2: we want to display the history */ + else if (tab==history) { + + DEBUG ("display history tab"); + + if (active_calltree==contacts) { + gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, FALSE); + } + + gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, TRUE); + } + + else if (tab==contacts) { + + DEBUG ("display contact tab"); + + if (active_calltree==history) { + gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, FALSE); + } + + gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, TRUE); + } + + else + ERROR ("calltree.c line 1050 . This is probably a bug in the application"); + + + gtk_widget_hide (active_calltree->tree); + active_calltree = tab; + gtk_widget_show (active_calltree->tree); + + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view)); + g_signal_emit_by_name(sel, "changed"); + toolbar_update_buttons(); +} diff --git a/sflphone-gtk/src/calltree.h b/sflphone-gtk/src/contacts/calltree.h similarity index 59% rename from sflphone-gtk/src/calltree.h rename to sflphone-gtk/src/contacts/calltree.h index dd1de4d91a467c2f919f84376b53586e1e6462d6..1dd57d2d282a4b5b48d0d7f6859ed55bf512cff4 100644 --- a/sflphone-gtk/src/calltree.h +++ b/sflphone-gtk/src/contacts/calltree.h @@ -21,8 +21,6 @@ #define __CALLTREE_H__ #include <gtk/gtk.h> - -#include <calllist.h> #include <calltab.h> #include <timestamp.h> @@ -31,57 +29,41 @@ * @brief The GtkTreeView that list calls in the main window. */ -GtkWidget * filter_entry_contact; -GtkWidget * filter_entry_history; - -calltab_t* active_calltree; - -void free_call_t (call_t *c); - /** * Create a new widget calltree * @return GtkWidget* A new widget */ -void create_call_tree(calltab_t* tab, gchar* searchbar_type); - -/** - * Update the toolbar's buttons state, according to the call state - */ -void toolbar_update_buttons(); +void +calltree_create(calltab_t* tab, gchar* searchbar_type); /** * Add a call in the calltree * @param c The call to add */ -void update_call_tree_add (calltab_t* ct, call_t * c); +void +calltree_add_call (calltab_t* ct, call_t * c); /* * Update the call tree if the call state changes * @param c The call to update */ -void update_call_tree (calltab_t* ct, call_t * c); +void +calltree_update_call (calltab_t* ct, call_t * c); + /** * Remove a call from the call tree * @param c The call to remove */ -void update_call_tree_remove (calltab_t* ct, call_t * c); - -void reset_call_tree (calltab_t* tab); - -/** - * Build the toolbar - * @return GtkWidget* The toolbar - */ -GtkWidget * create_toolbar(); - -GtkWidget * create_filter_entry(); - -GtkTreeModel * create_filter (GtkTreeModel* child); +void +calltree_remove_call (calltab_t* ct, call_t * c); -void display_calltree (calltab_t *tab); +void +calltree_reset (calltab_t* tab); -void create_searchbar(calltab_t* tab, gchar* searchbar_type); +void +calltree_display (calltab_t *tab); -void create_new_entry_in_contactlist (gchar *contact_name, gchar *contact_phone, contact_type_t type, GdkPixbuf *photo); +void +row_activated(GtkTreeView *, GtkTreePath *, GtkTreeViewColumn *, void *); #endif diff --git a/sflphone-gtk/src/contacts/history.c b/sflphone-gtk/src/contacts/history.c new file mode 100644 index 0000000000000000000000000000000000000000..c6fe172ef3f697c8bf3720c42894220db1af8549 --- /dev/null +++ b/sflphone-gtk/src/contacts/history.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <history.h> +#include <string.h> +#include <searchbar.h> +#include <calltab.h> + +GtkTreeModel* history_filter; +GtkWidget * history_searchbar_widget; + +static GtkTreeModel* history_create_filter (GtkTreeModel*); +static gboolean history_is_visible (GtkTreeModel*, GtkTreeIter*, gpointer); + + +void +history_search(GtkEntry* entry UNUSED){ + + gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(history_filter)); +} + +void +history_init(){ + + history_filter = history_create_filter(GTK_TREE_MODEL(history->store)); + gtk_tree_view_set_model(GTK_TREE_VIEW(history->view), GTK_TREE_MODEL(history_filter)); +} + +void history_set_searchbar_widget(GtkWidget *searchbar){ + + history_searchbar_widget = searchbar; +} + +static GtkTreeModel* +history_create_filter (GtkTreeModel* child) { + + GtkTreeModel* ret; + + ret = gtk_tree_model_filter_new(child, NULL); + gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(ret), history_is_visible, NULL, NULL); + return GTK_TREE_MODEL(ret); +} + +static gboolean +history_is_visible (GtkTreeModel* model, GtkTreeIter* iter, gpointer data UNUSED) { + + if( SHOW_SEARCHBAR ) + { + GValue val; + + gchar* text = NULL; + gchar* search = (gchar*)gtk_entry_get_text(GTK_ENTRY(history_searchbar_widget)); + memset (&val, 0, sizeof(val)); + gtk_tree_model_get_value(GTK_TREE_MODEL(model), iter, 1, &val); + if(G_VALUE_HOLDS_STRING(&val)){ + text = (gchar *)g_value_get_string(&val); + } + if(text != NULL && g_ascii_strncasecmp(search, _("Search"), 6) != 0){ + return g_regex_match_simple(search, text, G_REGEX_CASELESS, 0); + } + g_value_unset (&val); + return TRUE; + } + + return TRUE; +} diff --git a/sflphone-gtk/src/contacts/history.h b/sflphone-gtk/src/contacts/history.h new file mode 100644 index 0000000000000000000000000000000000000000..e4265a3690b7183a656ae16ac4fb8d58ca2837a9 --- /dev/null +++ b/sflphone-gtk/src/contacts/history.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/** + * This file contains functions specific for history. + */ + +#ifndef __HISTORY_H__ +#define __HISTORY_H__ + +#include <gtk/gtk.h> +#include <sflphone_const.h> + +/** + * Execute a search in history + */ +void +history_search(GtkEntry* entry UNUSED); + +/** + * Initialize history + */ +void +history_init(); + +/** + * Set history search bar widget (needed for is_visible) + */ +void +history_set_searchbar_widget(GtkWidget *); + +#endif diff --git a/sflphone-gtk/src/contacts/searchbar.c b/sflphone-gtk/src/contacts/searchbar.c new file mode 100644 index 0000000000000000000000000000000000000000..8230b5c03b5d250856523c1d611094607ddd67a5 --- /dev/null +++ b/sflphone-gtk/src/contacts/searchbar.c @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2008 2009 Savoir-Faire Linux inc. + * + * Author: Antoine Reversat <antoine.reversat@savoirfairelinux.com> + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <searchbar.h> +#include <calltree.h> + +void searchbar_entry_changed (GtkEntry* entry, gchar* arg1 UNUSED, gpointer data UNUSED) { + + if (active_calltree == contacts) { + addressbook_search(entry); + } + else if (active_calltree == history) { + history_search(entry); + } + +} + +void searchbar_clear_entry_if_default (GtkWidget* widget, gpointer user_data UNUSED) { + + if(g_ascii_strncasecmp(gtk_entry_get_text(GTK_ENTRY(widget)), _("Search"), 6) == 0) + gtk_entry_set_text(GTK_ENTRY(widget), ""); + +} + +void +searchbar_init(calltab_t *tab) +{ + if (tab == contacts) { + addressbook_init(); + } + else if (tab == history) { + history_init(); + } +} + +GtkWidget* searchbar_new(gchar* searchbar_type) { + + GtkWidget * searchbox; + GtkWidget* image; + GtkWidget* ret = gtk_hbox_new(FALSE, 0); + +#if GTK_CHECK_VERSION(2,16,0) + searchbox = gtk_entry_new(); + gtk_entry_set_icon_from_stock (GTK_ENTRY (searchbox), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_FIND); + gtk_entry_set_icon_from_stock (GTK_ENTRY (searchbox), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR); +#else + searchbox = sexy_icon_entry_new(); + image = gtk_image_new_from_stock( GTK_STOCK_FIND , GTK_ICON_SIZE_SMALL_TOOLBAR); + sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(searchbox), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); + sexy_icon_entry_add_clear_button( SEXY_ICON_ENTRY(searchbox) ); +#endif + gtk_entry_set_text(GTK_ENTRY(searchbox), _("Search")); + g_signal_connect(GTK_ENTRY(searchbox), "changed", G_CALLBACK(searchbar_entry_changed), NULL); + g_signal_connect(GTK_ENTRY(searchbox), "grab-focus", G_CALLBACK(searchbar_clear_entry_if_default), NULL); + + gtk_box_pack_start(GTK_BOX(ret), searchbox, TRUE, TRUE, 0); + + if(g_strcmp0(searchbar_type,"history") == 0) + history_set_searchbar_widget(searchbox); + + return ret; +} + +void activateWaitingLayer() { + gtk_widget_show(waitingLayer); +} + +void deactivateWaitingLayer() { + gtk_widget_hide(waitingLayer); +} diff --git a/sflphone-gtk/src/searchfilter.h b/sflphone-gtk/src/contacts/searchbar.h similarity index 65% rename from sflphone-gtk/src/searchfilter.h rename to sflphone-gtk/src/contacts/searchbar.h index 66aa0fd6d49972e2315bf6bf2c5c582f844c61ad..aabe3ea4113a06c6ba2ce156af4d09fe5b234fa1 100644 --- a/sflphone-gtk/src/searchfilter.h +++ b/sflphone-gtk/src/contacts/searchbar.h @@ -3,6 +3,7 @@ * * Author: Antoine Reversat <antoine.reversat@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 @@ -19,26 +20,48 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/** + * This file contains functions relative to search bar used with history and + * addressbook. + */ + #ifndef __SEARCH_FILTER_H__ #define __SEARCH_FILTER_H__ #include <calllist.h> #include <gtk/gtk.h> -#include <libsexy/sexy-icon-entry.h> +// From version 2.16, gtk provides the functionalities libsexy used to provide +#if GTK_CHECK_VERSION(2,16,0) +#else +#include <libsexy/sexy-icon-entry.h> +#endif -GdkPixbuf *waitingPixOff; +#include <addressbook.h> +#include <history.h> -GtkTreeModel* create_filter(GtkTreeModel* child); -gboolean is_visible(GtkTreeModel* model, GtkTreeIter* iter, gpointer data); +GdkPixbuf *waitingPixOff; -GtkWidget* create_filter_entry_contact(); +/** + * Create a new search bar with "type" passed in + * parameter + */ +GtkWidget* searchbar_new(gchar*); -GtkWidget* create_filter_entry_history(); +/** + * Initialize a specific search bar + */ +void searchbar_init(calltab_t *); +/** + * Activate a waiting layer during search + */ void activateWaitingLayer(); +/** + * Deactivate waiting layer + */ void deactivateWaitingLayer(); #endif diff --git a/sflphone-gtk/src/dbus/Makefile.am b/sflphone-gtk/src/dbus/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..202d5ef904daa7f498730ac8b90fb3a963171a97 --- /dev/null +++ b/sflphone-gtk/src/dbus/Makefile.am @@ -0,0 +1,9 @@ +include ../../globals.mak + +noinst_LTLIBRARIES = libdbus.la + +libdbus_la_SOURCES = dbus.c + +libdbus_la_LDFLAGS = @DEPS_LDFLAGS@ + +libdbus_la_CFLAGS = @DEPS_CFLAGS@ diff --git a/sflphone-gtk/src/dbus/README b/sflphone-gtk/src/dbus/README new file mode 100644 index 0000000000000000000000000000000000000000..aca6172e416662b6b20febbf2ab48180d8efca04 --- /dev/null +++ b/sflphone-gtk/src/dbus/README @@ -0,0 +1,8 @@ +CallManager, ConfigurationManager and ContactManager dbus APIs. + +These files are generated by dbus-binding-tool using the server's files named *-introspec.xml: + * dbus-binding-tool --mode=glib-client "../../../src/dbus/callmanager-introspec.xml" > callmanager-glue.h + * dbus-binding-tool --mode=glib-client "../../../src/dbus/configurationmanager-introspec.xml" > configurationmanager-glue.h + * dbus-binding-tool --mode=glib-client "../../../src/dbus/contactmanager-introspec.xml" > contactmanager-glue.h + +These files dbus call wrapper functions to simplify access to dbus API. \ No newline at end of file diff --git a/sflphone-gtk/src/callmanager-glue.h b/sflphone-gtk/src/dbus/callmanager-glue.h similarity index 100% rename from sflphone-gtk/src/callmanager-glue.h rename to sflphone-gtk/src/dbus/callmanager-glue.h diff --git a/sflphone-gtk/src/configurationmanager-glue.h b/sflphone-gtk/src/dbus/configurationmanager-glue.h similarity index 95% rename from sflphone-gtk/src/configurationmanager-glue.h rename to sflphone-gtk/src/dbus/configurationmanager-glue.h index 7d29e92172ab1c6cba9e07cec330c23b5d26254c..41addebde9c99e47aab2a5ca8777ecd2dfdff962 100644 --- a/sflphone-gtk/src/configurationmanager-glue.h +++ b/sflphone-gtk/src/dbus/configurationmanager-glue.h @@ -125,6 +125,43 @@ static inline #endif gboolean +org_sflphone_SFLphone_ConfigurationManager_set_accounts_order (DBusGProxy *proxy, const char * IN_order, GError **error) + +{ + return dbus_g_proxy_call (proxy, "setAccountsOrder", error, G_TYPE_STRING, IN_order, G_TYPE_INVALID, G_TYPE_INVALID); +} + +typedef void (*org_sflphone_SFLphone_ConfigurationManager_set_accounts_order_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); + +static void +org_sflphone_SFLphone_ConfigurationManager_set_accounts_order_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +{ + DBusGAsyncData *data = (DBusGAsyncData*) user_data; + GError *error = NULL; + dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); + (*(org_sflphone_SFLphone_ConfigurationManager_set_accounts_order_reply)data->cb) (proxy, error, data->userdata); + return; +} + +static +#ifdef G_HAVE_INLINE +inline +#endif +DBusGProxyCall* +org_sflphone_SFLphone_ConfigurationManager_set_accounts_order_async (DBusGProxy *proxy, const char * IN_order, org_sflphone_SFLphone_ConfigurationManager_set_accounts_order_reply callback, gpointer userdata) + +{ + DBusGAsyncData *stuff; + stuff = g_new (DBusGAsyncData, 1); + stuff->cb = G_CALLBACK (callback); + stuff->userdata = userdata; + return dbus_g_proxy_begin_call (proxy, "setAccountsOrder", org_sflphone_SFLphone_ConfigurationManager_set_accounts_order_async_callback, stuff, g_free, G_TYPE_STRING, IN_order, G_TYPE_INVALID); +} +static +#ifdef G_HAVE_INLINE +inline +#endif +gboolean org_sflphone_SFLphone_ConfigurationManager_remove_account (DBusGProxy *proxy, const char * IN_accoundID, GError **error) { @@ -2305,6 +2342,81 @@ static inline #endif gboolean +org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list (DBusGProxy *proxy, char *** OUT_settings, GError **error) + +{ + return dbus_g_proxy_call (proxy, "getAddressbookList", error, G_TYPE_INVALID, G_TYPE_STRV, OUT_settings, G_TYPE_INVALID); +} + +typedef void (*org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list_reply) (DBusGProxy *proxy, char * *OUT_settings, GError *error, gpointer userdata); + +static void +org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +{ + DBusGAsyncData *data = (DBusGAsyncData*) user_data; + GError *error = NULL; + char ** OUT_settings; + dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRV, &OUT_settings, G_TYPE_INVALID); + (*(org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list_reply)data->cb) (proxy, OUT_settings, error, data->userdata); + return; +} + +static +#ifdef G_HAVE_INLINE +inline +#endif +DBusGProxyCall* +org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list_async (DBusGProxy *proxy, org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list_reply callback, gpointer userdata) + +{ + DBusGAsyncData *stuff; + stuff = g_new (DBusGAsyncData, 1); + stuff->cb = G_CALLBACK (callback); + stuff->userdata = userdata; + return dbus_g_proxy_begin_call (proxy, "getAddressbookList", org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list_async_callback, stuff, g_free, G_TYPE_INVALID); +} +static +#ifdef G_HAVE_INLINE +inline +#endif +gboolean +org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list (DBusGProxy *proxy, const char ** IN_settings, GError **error) + +{ + return dbus_g_proxy_call (proxy, "setAddressbookList", error, G_TYPE_STRV, IN_settings, G_TYPE_INVALID, G_TYPE_INVALID); +} + +typedef void (*org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); + +static void +org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +{ + DBusGAsyncData *data = (DBusGAsyncData*) user_data; + GError *error = NULL; + dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); + (*(org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list_reply)data->cb) (proxy, error, data->userdata); + return; +} + +static +#ifdef G_HAVE_INLINE +inline +#endif +DBusGProxyCall* +org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list_async (DBusGProxy *proxy, const char ** IN_settings, org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list_reply callback, gpointer userdata) + +{ + DBusGAsyncData *stuff; + stuff = g_new (DBusGAsyncData, 1); + stuff->cb = G_CALLBACK (callback); + stuff->userdata = userdata; + return dbus_g_proxy_begin_call (proxy, "setAddressbookList", org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list_async_callback, stuff, g_free, G_TYPE_STRV, IN_settings, G_TYPE_INVALID); +} +static +#ifdef G_HAVE_INLINE +inline +#endif +gboolean org_sflphone_SFLphone_ConfigurationManager_get_hook_settings (DBusGProxy *proxy, GHashTable** OUT_settings, GError **error) { diff --git a/sflphone-gtk/src/dbus.c b/sflphone-gtk/src/dbus/dbus.c similarity index 74% rename from sflphone-gtk/src/dbus.c rename to sflphone-gtk/src/dbus/dbus.c index 580c50dc284d0cef71ad5358ea7549f5f61be4f7..787b2b6a40d52a91cb391dfdfadcdd3d5499aae4 100644 --- a/sflphone-gtk/src/dbus.c +++ b/sflphone-gtk/src/dbus/dbus.c @@ -3,22 +3,22 @@ * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + #include <calltab.h> #include <callmanager-glue.h> #include <configurationmanager-glue.h> @@ -40,20 +40,20 @@ DBusGProxy * callManagerProxy; DBusGProxy * configurationManagerProxy; DBusGProxy * instanceProxy; -static void +static void incoming_call_cb (DBusGProxy *proxy UNUSED, const gchar* accountID, const gchar* callID, const gchar* from, void * foo UNUSED ) { - g_print ("Incoming call! %s\n",callID); + DEBUG ("Incoming call! %s",callID); call_t * c = g_new0 (call_t, 1); c->accountID = g_strdup(accountID); c->callID = g_strdup(callID); c->from = g_strdup(from); c->state = CALL_STATE_INCOMING; - #if GTK_CHECK_VERSION(2,10,0) + #if GTK_CHECK_VERSION(2,10,0) status_tray_icon_blink( TRUE ); #endif notify_incoming_call( c ); @@ -66,48 +66,48 @@ curent_selected_codec (DBusGProxy *proxy UNUSED, const gchar* codecName, void * foo UNUSED ) { - g_print ("%s codec decided for call %s\n",codecName,callID); + DEBUG ("%s codec decided for call %s",codecName,callID); sflphone_display_selected_codec (codecName); } -static void +static void volume_changed_cb (DBusGProxy *proxy UNUSED, const gchar* device, const gdouble value, void * foo UNUSED ) { - g_print ("Volume of %s changed to %f. \n",device, value); + DEBUG ("Volume of %s changed to %f.",device, value); set_slider(device, value); } -static void +static void voice_mail_cb (DBusGProxy *proxy UNUSED, const gchar* accountID, const guint nb, void * foo UNUSED ) { - g_print ("%d Voice mail waiting! \n",nb); + DEBUG ("%d Voice mail waiting!",nb); sflphone_notify_voice_mail (accountID , nb); } -static void +static void incoming_message_cb (DBusGProxy *proxy UNUSED, const gchar* accountID UNUSED, const gchar* msg, void * foo UNUSED ) { - g_print ("Message %s! \n",msg); - + DEBUG ("Message %s!",msg); + } -static void +static void call_state_cb (DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* state, void * foo UNUSED ) { - g_print ("Call %s state %s\n",callID, state); - call_t * c = call_list_get(current_calls, callID); + DEBUG ("Call %s state %s",callID, state); + call_t * c = calllist_get(current_calls, callID); if(c) { if ( strcmp(state, "HUNGUP") == 0 ) @@ -115,13 +115,13 @@ call_state_cb (DBusGProxy *proxy UNUSED, if(c->state==CALL_STATE_CURRENT) { // peer hung up, the conversation was established, so _start has been initialized with the current time value - g_print("call state current\n"); + DEBUG("call state current"); (void) time(&c->_stop); - update_call_tree( history, c ); + calltree_update_call( history, c ); } stop_notification(); sflphone_hung_up (c); - update_call_tree( history, c ); + calltree_update_call( history, c ); } else if ( strcmp(state, "UNHOLD_CURRENT") == 0 ) { @@ -151,150 +151,159 @@ call_state_cb (DBusGProxy *proxy UNUSED, { sflphone_busy (c); } - } - else - { //The callID is unknow, threat it like a new call + } + else + { + // The callID is unknow, threat it like a new call + // If it were an incoming call, we won't be here + // It means that a new call has been initiated with an other client (cli for instance) if ( strcmp(state, "RINGING") == 0 ) { - g_print ("New ringing call! %s\n",callID); - call_t * c = g_new0 (call_t, 1); - c->accountID = g_strdup("1"); - c->callID = g_strdup(callID); - c->from = g_strdup("\"\" <>"); - c->state = CALL_STATE_RINGING; - sflphone_incoming_call (c); + call_t *new_call; + GHashTable *call_details; + + DEBUG ("New ringing call! accountID: %s", callID); + + // We fetch the details associated to the specified call + call_details = dbus_get_call_details (callID); + create_new_call_from_details (callID, call_details, &new_call); + + // Restore the callID to be synchronous with the daemon + new_call->callID = g_strdup(callID); + + sflphone_incoming_call (new_call); } } } -static void +static void accounts_changed_cb (DBusGProxy *proxy UNUSED, void * foo UNUSED ) { - g_print ("Accounts changed\n"); + DEBUG ("Accounts changed"); sflphone_fill_account_list(TRUE); config_window_fill_account_list(); } -static void +static void error_alert(DBusGProxy *proxy UNUSED, int errCode, void * foo UNUSED ) { - g_print ("Error notifying : (%i)\n" , errCode); + ERROR ("Error notifying : (%i)" , errCode); sflphone_throw_exception( errCode ); } -gboolean +gboolean dbus_connect () { GError *error = NULL; connection = NULL; instanceProxy = NULL; - + g_type_init (); connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - + if (error) { - g_printerr ("Failed to open connection to bus: %s\n", + ERROR ("Failed to open connection to bus: %s", error->message); g_error_free (error); return FALSE; } /* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */ - + instanceProxy = dbus_g_proxy_new_for_name (connection, "org.sflphone.SFLphone", "/org/sflphone/SFLphone/Instance", "org.sflphone.SFLphone.Instance"); - - if (instanceProxy==NULL) + + if (instanceProxy==NULL) { - g_printerr ("Failed to get proxy to Instance\n"); + ERROR ("Failed to get proxy to Instance"); return FALSE; } - - g_print ("DBus connected to Instance\n"); - - + + DEBUG ("DBus connected to Instance"); + + callManagerProxy = dbus_g_proxy_new_for_name (connection, "org.sflphone.SFLphone", "/org/sflphone/SFLphone/CallManager", "org.sflphone.SFLphone.CallManager"); - if (callManagerProxy==NULL) + if (callManagerProxy==NULL) { - g_printerr ("Failed to get proxy to CallManagers\n"); + ERROR ("Failed to get proxy to CallManagers"); return FALSE; } - - g_print ("DBus connected to CallManager\n"); + + DEBUG ("DBus connected to CallManager"); /* Incoming call */ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_STRING, + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, + dbus_g_proxy_add_signal (callManagerProxy, "incomingCall", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); dbus_g_proxy_connect_signal (callManagerProxy, "incomingCall", G_CALLBACK(incoming_call_cb), NULL, NULL); /* Current codec */ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_STRING, + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, + dbus_g_proxy_add_signal (callManagerProxy, "currentSelectedCodec", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); dbus_g_proxy_connect_signal (callManagerProxy, "currentSelectedCodec", G_CALLBACK(curent_selected_codec), NULL, NULL); /* Register a marshaller for STRING,STRING */ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING, + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, + dbus_g_proxy_add_signal (callManagerProxy, "callStateChanged", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); dbus_g_proxy_connect_signal (callManagerProxy, "callStateChanged", G_CALLBACK(call_state_cb), NULL, NULL); - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_INT, + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_INT, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, + dbus_g_proxy_add_signal (callManagerProxy, "voiceMailNotify", G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); dbus_g_proxy_connect_signal (callManagerProxy, "voiceMailNotify", G_CALLBACK(voice_mail_cb), NULL, NULL); - - dbus_g_proxy_add_signal (callManagerProxy, + + dbus_g_proxy_add_signal (callManagerProxy, "incomingMessage", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); dbus_g_proxy_connect_signal (callManagerProxy, "incomingMessage", G_CALLBACK(incoming_message_cb), NULL, NULL); - - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_DOUBLE, + + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_DOUBLE, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, + dbus_g_proxy_add_signal (callManagerProxy, "volumeChanged", G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_INVALID); dbus_g_proxy_connect_signal (callManagerProxy, "volumeChanged", G_CALLBACK(volume_changed_cb), NULL, NULL); - + configurationManagerProxy = dbus_g_proxy_new_for_name (connection, "org.sflphone.SFLphone", "/org/sflphone/SFLphone/ConfigurationManager", "org.sflphone.SFLphone.ConfigurationManager"); - if (!configurationManagerProxy) + if (!configurationManagerProxy) { - g_printerr ("Failed to get proxy to ConfigurationManager\n"); + ERROR ("Failed to get proxy to ConfigurationManager"); return FALSE; } - g_print ("DBus connected to ConfigurationManager\n"); - dbus_g_proxy_add_signal (configurationManagerProxy, + DEBUG ("DBus connected to ConfigurationManager"); + dbus_g_proxy_add_signal (configurationManagerProxy, "accountsChanged", G_TYPE_INVALID); dbus_g_proxy_connect_signal (configurationManagerProxy, "accountsChanged", G_CALLBACK(accounts_changed_cb), NULL, NULL); - + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__INT, G_TYPE_NONE, G_TYPE_INT , G_TYPE_INVALID); - dbus_g_proxy_add_signal (configurationManagerProxy, + dbus_g_proxy_add_signal (configurationManagerProxy, "errorAlert", G_TYPE_INT , G_TYPE_INVALID); dbus_g_proxy_connect_signal (configurationManagerProxy, "errorAlert", G_CALLBACK(error_alert), NULL, NULL); @@ -315,12 +324,12 @@ dbus_hold (const call_t * c) { GError *error = NULL; org_sflphone_SFLphone_CallManager_hold ( callManagerProxy, c->callID, &error); - if (error) + if (error) { - g_printerr ("Failed to call hold() on CallManager: %s\n", + ERROR ("Failed to call hold() on CallManager: %s", error->message); g_error_free (error); - } + } } void @@ -328,12 +337,12 @@ dbus_unhold (const call_t * c) { GError *error = NULL; org_sflphone_SFLphone_CallManager_unhold ( callManagerProxy, c->callID, &error); - if (error) + if (error) { - g_printerr ("Failed to call unhold() on CallManager: %s\n", + ERROR ("Failed to call unhold() on CallManager: %s", error->message); g_error_free (error); - } + } } void @@ -341,12 +350,12 @@ dbus_hang_up (const call_t * c) { GError *error = NULL; org_sflphone_SFLphone_CallManager_hang_up ( callManagerProxy, c->callID, &error); - if (error) + if (error) { - g_printerr ("Failed to call hang_up() on CallManager: %s\n", + ERROR ("Failed to call hang_up() on CallManager: %s", error->message); g_error_free (error); - } + } } void @@ -354,12 +363,12 @@ dbus_transfert (const call_t * c) { GError *error = NULL; org_sflphone_SFLphone_CallManager_transfert ( callManagerProxy, c->callID, c->to, &error); - if (error) + if (error) { - g_printerr ("Failed to call transfert() on CallManager: %s\n", + ERROR ("Failed to call transfert() on CallManager: %s", error->message); g_error_free (error); - } + } } void @@ -370,12 +379,12 @@ dbus_accept (const call_t * c) #endif GError *error = NULL; org_sflphone_SFLphone_CallManager_accept ( callManagerProxy, c->callID, &error); - if (error) + if (error) { - g_printerr ("Failed to call accept(%s) on CallManager: %s\n", c->callID, + ERROR ("Failed to call accept(%s) on CallManager: %s", c->callID, (error->message == NULL ? g_quark_to_string(error->domain): error->message)); g_error_free (error); - } + } } void @@ -386,12 +395,12 @@ dbus_refuse (const call_t * c) #endif GError *error = NULL; org_sflphone_SFLphone_CallManager_refuse ( callManagerProxy, c->callID, &error); - if (error) + if (error) { - g_printerr ("Failed to call refuse() on CallManager: %s\n", + ERROR ("Failed to call refuse() on CallManager: %s", error->message); g_error_free (error); - } + } } @@ -400,12 +409,12 @@ dbus_place_call (const call_t * c) { GError *error = NULL; org_sflphone_SFLphone_CallManager_place_call ( callManagerProxy, c->accountID, c->callID, c->to, &error); - if (error) + if (error) { - g_printerr ("Failed to call placeCall() on CallManager: %s\n", + ERROR ("Failed to call placeCall() on CallManager: %s", error->message); g_error_free (error); - } + } } gchar** dbus_account_list() @@ -416,14 +425,18 @@ gchar** dbus_account_list() if(!org_sflphone_SFLphone_ConfigurationManager_get_account_list ( configurationManagerProxy, &array, &error)) { if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) - g_printerr ("Caught remote method (get_account_list) exception %s: %s\n", dbus_g_error_get_name(error), error->message); + { + ERROR ("Caught remote method (get_account_list) exception %s: %s", dbus_g_error_get_name(error), error->message); + } else - g_printerr("Error while calling get_account_list: %s\n", error->message); + { + ERROR("Error while calling get_account_list: %s", error->message); + } g_error_free (error); return NULL; } else{ - g_print ("DBus called get_account_list() on ConfigurationManager\n"); + DEBUG ("DBus called get_account_list() on ConfigurationManager"); return array; } } @@ -433,13 +446,17 @@ GHashTable* dbus_account_details(gchar * accountID) { GError *error = NULL; GHashTable * details; - + if(!org_sflphone_SFLphone_ConfigurationManager_get_account_details( configurationManagerProxy, accountID, &details, &error)) { if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) - g_printerr ("Caught remote method (get_account_details) exception %s: %s\n", dbus_g_error_get_name(error), error->message); + { + ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name(error), error->message); + } else - g_printerr("Error while calling get_account_details: %s\n", error->message); + { + ERROR("Error while calling get_account_details: %s", error->message); + } g_error_free (error); return NULL; } @@ -453,12 +470,12 @@ dbus_send_register ( gchar* accountID , const guint expire) { GError *error = NULL; org_sflphone_SFLphone_ConfigurationManager_send_register ( configurationManagerProxy, accountID, expire ,&error); - if (error) + if (error) { - g_printerr ("Failed to call send_register() on ConfigurationManager: %s\n", + ERROR ("Failed to call send_register() on ConfigurationManager: %s", error->message); g_error_free (error); - } + } } void @@ -466,15 +483,15 @@ dbus_remove_account(gchar * accountID) { GError *error = NULL; org_sflphone_SFLphone_ConfigurationManager_remove_account ( - configurationManagerProxy, - accountID, + configurationManagerProxy, + accountID, &error); - if (error) + if (error) { - g_printerr ("Failed to call remove_account() on ConfigurationManager: %s\n", + ERROR ("Failed to call remove_account() on ConfigurationManager: %s", error->message); g_error_free (error); - } + } } void @@ -482,16 +499,16 @@ dbus_set_account_details(account_t *a) { GError *error = NULL; org_sflphone_SFLphone_ConfigurationManager_set_account_details ( - configurationManagerProxy, - a->accountID, - a->properties, + configurationManagerProxy, + a->accountID, + a->properties, &error); - if (error) + if (error) { - g_printerr ("Failed to call set_account_details() on ConfigurationManager: %s\n", + ERROR ("Failed to call set_account_details() on ConfigurationManager: %s", error->message); g_error_free (error); - } + } } void @@ -499,15 +516,15 @@ dbus_add_account(account_t *a) { GError *error = NULL; org_sflphone_SFLphone_ConfigurationManager_add_account ( - configurationManagerProxy, - a->properties, + configurationManagerProxy, + a->properties, &error); - if (error) + if (error) { - g_printerr ("Failed to call add_account() on ConfigurationManager: %s\n", + ERROR ("Failed to call add_account() on ConfigurationManager: %s", error->message); g_error_free (error); - } + } } void @@ -515,17 +532,17 @@ dbus_set_volume(const gchar * device, gdouble value) { GError *error = NULL; org_sflphone_SFLphone_CallManager_set_volume( - callManagerProxy, - device, - value, + callManagerProxy, + device, + value, &error); - if (error) + if (error) { - g_printerr ("Failed to call set_volume() on callManagerProxy: %s\n", + ERROR ("Failed to call set_volume() on callManagerProxy: %s", error->message); g_error_free (error); - } + } } @@ -534,19 +551,19 @@ dbus_get_volume(const gchar * device) { gdouble value; GError *error = NULL; - + org_sflphone_SFLphone_CallManager_get_volume( - callManagerProxy, - device, - &value, + callManagerProxy, + device, + &value, &error); - if (error) + if (error) { - g_printerr ("Failed to call get_volume() on callManagerProxy: %s\n", + ERROR ("Failed to call get_volume() on callManagerProxy: %s", error->message); g_error_free (error); - } + } return value; } @@ -555,74 +572,74 @@ void dbus_play_dtmf(const gchar * key) { GError *error = NULL; - + org_sflphone_SFLphone_CallManager_play_dt_mf( - callManagerProxy, - key, + callManagerProxy, + key, &error); - if (error) + if (error) { - g_printerr ("Failed to call playDTMF() on callManagerProxy: %s\n", + ERROR ("Failed to call playDTMF() on callManagerProxy: %s", error->message); g_error_free (error); - } + } } void dbus_start_tone(const int start , const guint type ) { GError *error = NULL; - + org_sflphone_SFLphone_CallManager_start_tone( - callManagerProxy, + callManagerProxy, start, - type, + type, &error); - if (error) + if (error) { - g_printerr ("Failed to call startTone() on callManagerProxy: %s\n", + ERROR ("Failed to call startTone() on callManagerProxy: %s", error->message); g_error_free (error); - } + } } void dbus_register(int pid, gchar * name) { GError *error = NULL; - + org_sflphone_SFLphone_Instance_register( - instanceProxy, - pid, - name, + instanceProxy, + pid, + name, &error); - if (error) + if (error) { - g_printerr ("Failed to call register() on instanceProxy: %s\n", + ERROR ("Failed to call register() on instanceProxy: %s", error->message); g_error_free (error); - } + } } -void +void dbus_unregister(int pid) { GError *error = NULL; - + org_sflphone_SFLphone_Instance_unregister( - instanceProxy, - pid, + instanceProxy, + pid, &error); - if (error) + if (error) { - g_printerr ("Failed to call unregister() on instanceProxy: %s\n", + ERROR ("Failed to call unregister() on instanceProxy: %s", error->message); g_error_free (error); - } + } } gchar** @@ -638,7 +655,7 @@ dbus_codec_list() if (error) { - g_printerr ("Failed to call get_codec_list() on ConfigurationManager: %s\n", + ERROR ("Failed to call get_codec_list() on ConfigurationManager: %s", error->message); g_error_free (error); } @@ -659,7 +676,7 @@ dbus_codec_details( int payload ) if (error) { - g_printerr ("Failed to call get_codec_details() on ConfigurationManager: %s\n", + ERROR ("Failed to call get_codec_details() on ConfigurationManager: %s", error->message); g_error_free (error); } @@ -669,12 +686,12 @@ dbus_codec_details( int payload ) gchar* dbus_get_current_codec_name(const call_t * c) { - - printf("dbus_get_current_codec_name : CallID : %s \n", c->callID); + + DEBUG("dbus_get_current_codec_name : CallID : %s", c->callID); gchar* codecName; GError* error = NULL; - + org_sflphone_SFLphone_CallManager_get_current_codec_name ( callManagerProxy, c->callID, @@ -684,10 +701,10 @@ dbus_get_current_codec_name(const call_t * c) { g_error_free(error); } - - printf("dbus_get_current_codec_name : codecName : %s \n", codecName); - return codecName; + DEBUG("dbus_get_current_codec_name : codecName : %s", codecName); + + return codecName; } @@ -705,7 +722,7 @@ dbus_get_active_codec_list() if (error) { - g_printerr ("Failed to call get_active_codec_list() on ConfigurationManager: %s\n", + ERROR ("Failed to call get_active_codec_list() on ConfigurationManager: %s", error->message); g_error_free (error); } @@ -724,7 +741,7 @@ dbus_set_active_codec_list(const gchar** list) if (error) { - g_printerr ("Failed to call set_active_codec_list() on ConfigurationManager: %s\n", + ERROR ("Failed to call set_active_codec_list() on ConfigurationManager: %s", error->message); g_error_free (error); } @@ -744,7 +761,7 @@ dbus_get_input_audio_plugin_list() &error); if(error) { - g_printerr("Failed to call get_input_audio_plugin_list() on ConfigurationManager: %s\n", error->message); + ERROR("Failed to call get_input_audio_plugin_list() on ConfigurationManager: %s", error->message); g_error_free(error); } return array; @@ -758,13 +775,17 @@ dbus_get_output_audio_plugin_list() { gchar** array; GError* error = NULL; - + if(!org_sflphone_SFLphone_ConfigurationManager_get_output_audio_plugin_list( configurationManagerProxy, &array, &error)) { if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) - g_printerr ("Caught remote method (get_output_audio_plugin_list) exception %s: %s\n", dbus_g_error_get_name(error), error->message); + { + ERROR ("Caught remote method (get_output_audio_plugin_list) exception %s: %s", dbus_g_error_get_name(error), error->message); + } else - g_printerr("Error while calling get_out_audio_plugin_list: %s\n", error->message); + { + ERROR("Error while calling get_out_audio_plugin_list: %s", error->message); + } g_error_free (error); return NULL; } @@ -783,7 +804,7 @@ dbus_set_input_audio_plugin(gchar* audioPlugin) &error); if(error) { - g_printerr("Failed to call set_input_audio_plugin() on ConfigurationManager: %s\n", error->message); + ERROR("Failed to call set_input_audio_plugin() on ConfigurationManager: %s", error->message); g_error_free(error); } } @@ -798,7 +819,7 @@ dbus_set_output_audio_plugin(gchar* audioPlugin) &error); if(error) { - g_printerr("Failed to call set_output_audio_plugin() on ConfigurationManager: %s\n", error->message); + ERROR("Failed to call set_output_audio_plugin() on ConfigurationManager: %s", error->message); g_error_free(error); } } @@ -816,7 +837,7 @@ gchar** dbus_get_audio_output_device_list() &error); if(error) { - g_printerr("Failed to call get_audio_output_device_list() on ConfigurationManager: %s\n", error->message); + ERROR("Failed to call get_audio_output_device_list() on ConfigurationManager: %s", error->message); g_error_free(error); } return array; @@ -835,7 +856,7 @@ dbus_set_audio_output_device(const int index) &error); if(error) { - g_printerr("Failed to call set_audio_output_device() on ConfigurationManager: %s\n", error->message); + ERROR("Failed to call set_audio_output_device() on ConfigurationManager: %s", error->message); g_error_free(error); } } @@ -854,7 +875,7 @@ dbus_get_audio_input_device_list() &error); if(error) { - g_printerr("Failed to call get_audio_input_device_list() on ConfigurationManager: %s\n", error->message); + ERROR("Failed to call get_audio_input_device_list() on ConfigurationManager: %s", error->message); g_error_free(error); } return array; @@ -873,7 +894,7 @@ dbus_set_audio_input_device(const int index) &error); if(error) { - g_printerr("Failed to call set_audio_input_device() on ConfigurationManager: %s\n", error->message); + ERROR("Failed to call set_audio_input_device() on ConfigurationManager: %s", error->message); g_error_free(error); } } @@ -892,7 +913,7 @@ dbus_get_current_audio_devices_index() &error); if(error) { - g_printerr("Failed to call get_current_audio_devices_index() on ConfigurationManager: %s\n", error->message); + ERROR("Failed to call get_current_audio_devices_index() on ConfigurationManager: %s", error->message); g_error_free(error); } return array; @@ -913,14 +934,14 @@ dbus_get_audio_device_index(const gchar *name) &error); if(error) { - g_printerr("Failed to call get_audio_device_index() on ConfigurationManager: %s\n", error->message); + ERROR("Failed to call get_audio_device_index() on ConfigurationManager: %s", error->message); g_error_free(error); } return index; } /** - * Get audio plugin + * Get audio plugin */ gchar* dbus_get_current_audio_output_plugin() @@ -933,7 +954,7 @@ dbus_get_current_audio_output_plugin() &error); if(error) { - g_printerr("Failed to call get_current_audio_output_plugin() on ConfigurationManager: %s\n", error->message); + ERROR("Failed to call get_current_audio_output_plugin() on ConfigurationManager: %s", error->message); g_error_free(error); } return plugin; @@ -1052,9 +1073,13 @@ dbus_get_searchbar() if(!org_sflphone_SFLphone_ConfigurationManager_get_searchbar( configurationManagerProxy, &state, &error)) { if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) - g_printerr ("Caught remote method (get_searchbar) exception %s: %s\n", dbus_g_error_get_name(error), error->message); + { + ERROR ("Caught remote method (get_searchbar) exception %s: %s", dbus_g_error_get_name(error), error->message); + } else - g_printerr("Error while calling get_searchbar: %s\n", error->message); + { + ERROR("Error while calling get_searchbar: %s", error->message); + } g_error_free (error); return -1; } @@ -1110,8 +1135,8 @@ dbus_set_volume_controls( ) void dbus_set_record(const call_t * c) { - g_print("calling dbus_set_record on CallManager\n"); - printf("CallID : %s \n", c->callID); + DEBUG("calling dbus_set_record on CallManager"); + DEBUG("CallID : %s", c->callID); GError* error = NULL; org_sflphone_SFLphone_CallManager_set_recording ( callManagerProxy, @@ -1123,22 +1148,22 @@ dbus_set_record(const call_t * c) } } -gboolean* +gboolean dbus_get_is_recording(const call_t * c) { - g_print("calling dbus_get_is_recording on CallManager\n"); + DEBUG("calling dbus_get_is_recording on CallManager"); GError* error = NULL; - gboolean* isRecording = NULL; + gboolean isRecording; org_sflphone_SFLphone_CallManager_get_is_recording ( - callManagerProxy, - c->callID, - &isRecording, + callManagerProxy, + c->callID, + &isRecording, &error); if(error) { g_error_free(error); } - //g_print("RECORDING: %i \n",isRecording); + //DEBUG("RECORDING: %i",isRecording); return isRecording; } @@ -1282,9 +1307,13 @@ dbus_get_notify( void ) if( !org_sflphone_SFLphone_ConfigurationManager_get_notify( configurationManagerProxy,&level, &error) ) { if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) - g_printerr ("Caught remote method (get_notify) exception %s: %s\n", dbus_g_error_get_name(error), error->message); + { + ERROR ("Caught remote method (get_notify) exception %s: %s", dbus_g_error_get_name(error), error->message); + } else - g_printerr("Error while calling get_notify: %s\n", error->message); + { + ERROR ("Error while calling get_notify: %s", error->message); + } g_error_free (error); return 0; } @@ -1318,10 +1347,10 @@ dbus_get_mail_notify( void ) &error); if(error) { - g_print("Error calling dbus_get_mail_notif_level\n"); + ERROR("Error calling dbus_get_mail_notif_level"); g_error_free(error); } - + return (guint)level; } @@ -1350,10 +1379,10 @@ dbus_get_audio_manager( void ) &error); if(error) { - g_print("Error calling dbus_get_audio_manager\n"); + ERROR("Error calling dbus_get_audio_manager"); g_error_free(error); } - + return api; } @@ -1457,7 +1486,7 @@ gint dbus_stun_is_enabled (void) void dbus_enable_stun (void) { - + GError* error = NULL; org_sflphone_SFLphone_ConfigurationManager_enable_stun( configurationManagerProxy, @@ -1473,14 +1502,14 @@ GHashTable* dbus_get_addressbook_settings (void) { GError *error = NULL; GHashTable *results = NULL; - //g_print ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings\n"); - + //DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); + org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings (configurationManagerProxy, &results, &error); if (error){ - g_print ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings\n"); + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); g_error_free (error); } - + return results; } @@ -1488,11 +1517,36 @@ void dbus_set_addressbook_settings (GHashTable * settings){ GError *error = NULL; - g_print ("Calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings\n"); - + DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings"); + org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings (configurationManagerProxy, settings, &error); if (error){ - g_print ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings\n"); + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings"); + g_error_free (error); + } +} + +gchar** dbus_get_addressbook_list (void) { + + GError *error = NULL; + gchar** array; + + org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list (configurationManagerProxy, &array, &error); + if (error){ + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list"); + g_error_free (error); + } + + return array; +} + +void dbus_set_addressbook_list (const gchar** list){ + + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list(configurationManagerProxy, list, &error); + if (error){ + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list"); g_error_free (error); } } @@ -1502,14 +1556,14 @@ GHashTable* dbus_get_hook_settings (void) { GError *error = NULL; GHashTable *results = NULL; - //g_print ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings\n"); - + //DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); + org_sflphone_SFLphone_ConfigurationManager_get_hook_settings (configurationManagerProxy, &results, &error); if (error){ - g_print ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_hook_settings\n"); + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_hook_settings"); g_error_free (error); } - + return results; } @@ -1519,9 +1573,33 @@ void dbus_set_hook_settings (GHashTable * settings){ org_sflphone_SFLphone_ConfigurationManager_set_hook_settings (configurationManagerProxy, settings, &error); if (error){ - g_print ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_hook_settings\n"); + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_hook_settings"); g_error_free (error); } } +GHashTable* dbus_get_call_details (const gchar *callID) +{ + GError *error = NULL; + GHashTable *details = NULL; + + org_sflphone_SFLphone_CallManager_get_call_details (callManagerProxy, callID, &details, &error); + if (error){ + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_call_details"); + g_error_free (error); + } + + return details; +} + +void dbus_set_accounts_order (const gchar* order) { + + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_accounts_order (configurationManagerProxy, order, &error); + if (error){ + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_accounts_order"); + g_error_free (error); + } +} diff --git a/sflphone-gtk/src/dbus.h b/sflphone-gtk/src/dbus/dbus.h similarity index 88% rename from sflphone-gtk/src/dbus.h rename to sflphone-gtk/src/dbus/dbus.h index 946c65486186c9103c73ed52e70c589223bb1814..6f64cfe30a1afa9cf1a1af72c27150f561dd16dd 100644 --- a/sflphone-gtk/src/dbus.h +++ b/sflphone-gtk/src/dbus/dbus.h @@ -3,17 +3,17 @@ * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -32,9 +32,9 @@ * @brief General DBus functions wrappers. */ -/** +/** * Try to connect to DBus services - * @return TRUE if connection succeeded, FALSE otherwise + * @return TRUE if connection succeeded, FALSE otherwise */ gboolean dbus_connect (); @@ -88,26 +88,26 @@ void dbus_place_call (const call_t * c); /** * ConfigurationManager - Get the list of the setup accounts - * @return gchar** The list of accounts + * @return gchar** The list of accounts */ gchar ** dbus_account_list(); /** * ConfigurationManager - Get the details of a specific account - * @param accountID The unique of the account + * @param accountID The unique of the account * @return GHashTable* The details of the account */ GHashTable * dbus_account_details(gchar * accountID); /** * ConfigurationManager - Set the details of a specific account - * @param a The account to update + * @param a The account to update */ void dbus_set_account_details(account_t *a); /** * ConfigurationManager - Send registration request - * @param accountID The account to register/unregister + * @param accountID The account to register/unregister * @param expire The flag for the type of registration * 0 for unregistration request * 1 for registration request @@ -116,18 +116,18 @@ void dbus_send_register( gchar* accountID , const guint expire ); /** * ConfigurationManager - Add an account to the list - * @param a The account to add + * @param a The account to add */ void dbus_add_account(account_t *a); /** * ConfigurationManager - Remove an account from the list - * @param accountID The account to remove + * @param accountID The account to remove */ void dbus_remove_account(gchar * accountID); /** - * ConfigurationManager - Set volume for speaker/mic + * ConfigurationManager - Set volume for speaker/mic * @param device The speaker or the mic * @param value The new value */ @@ -141,18 +141,18 @@ gdouble dbus_get_volume(const gchar * device); /** * ConfigurationManager - Play DTMF - * @param key The DTMF to send + * @param key The DTMF to send */ void dbus_play_dtmf(const gchar * key); /** - * ConfigurationManager - Get the codecs list - * @return gchar** The list of codecs + * ConfigurationManager - Get the codecs list + * @return gchar** The list of codecs */ gchar** dbus_codec_list(); /** - * ConfigurationManager - Get the codec details + * ConfigurationManager - Get the codec details * @param payload The payload of the codec * @return gchar** The codec details */ @@ -160,8 +160,8 @@ gchar** dbus_codec_details(int payload); /** * ConfigurationManager - Get the default codec list - * The default codec list are the codecs selected by the server if the user hasn't made any changes - * @return gchar** The default codec list + * The default codec list are the codecs selected by the server if the user hasn't made any changes + * @return gchar** The default codec list */ gchar** dbus_default_codec_list(); @@ -246,7 +246,7 @@ int dbus_get_audio_device_index(const gchar* name); /** * ConfigurationManager - Get the current output audio plugin - * @return gchar* The current plugin + * @return gchar* The current plugin * default * plughw * dmix @@ -262,31 +262,31 @@ int dbus_is_iax2_enabled( void ); /** * ConfigurationManager - Query the server about the ringtone option. - * If ringtone is enabled, ringtone on incoming call use custom choice. If not, only standart tone. + * If ringtone is enabled, ringtone on incoming call use custom choice. If not, only standart tone. * @return int 1 if enabled * 0 otherwise */ int dbus_is_ringtone_enabled( void ); /** - * ConfigurationManager - Set the ringtone option + * ConfigurationManager - Set the ringtone option * Inverse current value */ void dbus_ringtone_enabled( void ); /** - * ConfigurationManager - Set PA behaviour for the other sound streams + * ConfigurationManager - Set PA behaviour for the other sound streams * Inverse current value */ void dbus_set_pulse_app_volume_control( void ); /** - * ConfigurationManager - Get PA behaviour for the other sound streams + * ConfigurationManager - Get PA behaviour for the other sound streams */ int dbus_get_pulse_app_volume_control( void ); /** - * ConfigurationManager - Get the ringtone + * ConfigurationManager - Get the ringtone * @return gchar* The file name selected as a ringtone */ gchar* dbus_get_ringtone_choice( void ); @@ -303,7 +303,7 @@ void dbus_set_ringtone_choice( const gchar* tone ); void dbus_set_dialpad( ); /** - * ConfigurationManager - Tells if the user wants to display the dialpad or not + * ConfigurationManager - Tells if the user wants to display the dialpad or not * @return int 1 if dialpad has to be displayed * 0 otherwise */ @@ -315,7 +315,7 @@ int dbus_get_dialpad( void ); void dbus_set_searchbar( ); /** - * ConfigurationManager - Tells if the user wants to display the search bar or not + * ConfigurationManager - Tells if the user wants to display the search bar or not * @return int 1 if the search bar has to be displayed * 0 otherwise */ @@ -327,7 +327,7 @@ int dbus_get_searchbar( void ); void dbus_set_volume_controls( ); /** - * ConfigurationManager - Tells if the user wants to display the volume controls or not + * ConfigurationManager - Tells if the user wants to display the volume controls or not * @return int 1 if the controls have to be displayed * 0 otherwise */ @@ -340,13 +340,13 @@ int dbus_get_volume_controls( void ); void dbus_start_hidden( void ); /** - * ConfigurationManager - Gives the maximum number of calls the user wants to have in the history + * ConfigurationManager - Gives the maximum number of calls the user wants to have in the history * @return double The maximum number of calls */ guint dbus_get_max_calls( void ); /** - * ConfigurationManager - Gives the maximum number of calls the user wants to have in the history + * ConfigurationManager - Gives the maximum number of calls the user wants to have in the history */ void dbus_set_max_calls( const guint calls ); /** @@ -357,7 +357,7 @@ void dbus_set_max_calls( const guint calls ); int dbus_is_start_hidden( void ); /** - * ConfigurationManager - Configure the popup behaviour + * ConfigurationManager - Configure the popup behaviour * When SFLphone is in the system tray, you can configure when it popups * Never or only on incoming calls */ @@ -366,27 +366,27 @@ void dbus_switch_popup_mode( void ); /** * ConfigurationManager - Configure the popup behaviour * @return int 1 if it should popup on incoming calls - * 0 if it should never popups + * 0 if it should never popups */ int dbus_popup_mode( void ); /** * ConfigurationManager - Returns the selected audio manager * @return int 0 ALSA - * 1 PULSEAUDIO + * 1 PULSEAUDIO */ int dbus_get_audio_manager( void ); /** * ConfigurationManager - Set the audio manager * @param api 0 ALSA - * 1 PULSEAUDIO + * 1 PULSEAUDIO */ void dbus_set_audio_manager( int api ); /** * ConfigurationManager - Configure the notification level - * @return int 0 disable + * @return int 0 disable * 1 enable */ guint dbus_get_notify( void ); @@ -398,7 +398,7 @@ void dbus_set_notify( void ); /** * ConfigurationManager - Configure the mail notification level - * @return int 0 disable + * @return int 0 disable * 1 enable */ guint dbus_get_mail_notify( void ); @@ -409,15 +409,15 @@ guint dbus_get_mail_notify( void ); void dbus_set_mail_notify( void ); /** - * ConfigurationManager - Start a tone when a new call is open and no numbers have been dialed + * ConfigurationManager - Start a tone when a new call is open and no numbers have been dialed * @param start 1 to start * 0 to stop * @param type TONE_WITH_MESSAGE - * TONE_WITHOUT_MESSAGE + * TONE_WITHOUT_MESSAGE */ -void dbus_start_tone(const int start , const guint type); +void dbus_start_tone(const int start , const guint type); -/** +/** * Instance - Send registration request to dbus service. * Manage the instances of clients connected to the server * @param pid The pid of the processus client @@ -458,6 +458,10 @@ GHashTable* dbus_get_addressbook_settings (void); */ void dbus_set_addressbook_settings (GHashTable *); +gchar** dbus_get_addressbook_list (void); + +void dbus_set_addressbook_list (const gchar** list); + /** * Encapsulate all the url hook-related configuration * Get the configuration @@ -471,6 +475,10 @@ GHashTable* dbus_get_hook_settings (void); void dbus_set_hook_settings (GHashTable *); +gboolean dbus_get_is_recording(const call_t *); + +GHashTable* dbus_get_call_details (const gchar* callID); +void dbus_set_accounts_order (const gchar* order); #endif diff --git a/sflphone-gtk/src/instance-glue.h b/sflphone-gtk/src/dbus/instance-glue.h similarity index 100% rename from sflphone-gtk/src/instance-glue.h rename to sflphone-gtk/src/dbus/instance-glue.h diff --git a/sflphone-gtk/src/hooks-config.c b/sflphone-gtk/src/hooks-config.c deleted file mode 100644 index b4ede224d6e7542f9fbd087b60fb3e878608b7e9..0000000000000000000000000000000000000000 --- a/sflphone-gtk/src/hooks-config.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 2009 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "hooks-config.h" - -URLHook_Config *_urlhook_config; - -GtkWidget *field, *command; - -void hooks_load_parameters (URLHook_Config** settings){ - - GHashTable *_params = NULL; - URLHook_Config *_settings; - - // Allocate a struct - _settings = g_new0 (URLHook_Config, 1); - - // Fetch the settings from D-Bus - _params = (GHashTable*) dbus_get_hook_settings (); - - if (_params == NULL) { - _settings->sip_field = DEFAULT_SIP_URL_FIELD; - _settings->command = DEFAULT_URL_COMMAND; - _settings->sip_enabled = "0"; - } - else { - _settings->sip_field = (gchar*)(g_hash_table_lookup (_params, URLHOOK_SIP_FIELD)); - _settings->command = (gchar*)(g_hash_table_lookup (_params, URLHOOK_COMMAND)); - _settings->sip_enabled = (gchar*)(g_hash_table_lookup (_params, URLHOOK_SIP_ENABLED)); - } - - *settings = _settings; -} - - -void hooks_save_parameters (void){ - - GHashTable *params = NULL; - - params = g_hash_table_new (NULL, g_str_equal); - g_hash_table_replace (params, (gpointer)URLHOOK_SIP_FIELD, - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(field)))); - g_hash_table_replace (params, (gpointer)URLHOOK_COMMAND, - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(command)))); - g_hash_table_replace (params, (gpointer)URLHOOK_SIP_ENABLED, - (gpointer)g_strdup(_urlhook_config->sip_enabled)); - - dbus_set_hook_settings (params); - - // Decrement the reference count - g_hash_table_unref (params); - -} - -static void sip_enabled_cb (GtkWidget *widget) { - - guint check; - - check = (guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); - if (check) - _urlhook_config->sip_enabled="1"; - else - _urlhook_config->sip_enabled="0"; -} - -GtkWidget* create_hooks_settings (){ - - GtkWidget *ret, *url_frame, *table, *label; - - // Load the user value - hooks_load_parameters (&_urlhook_config); - - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - - url_frame = gtk_frame_new(_("URL argument")); - gtk_box_pack_start(GTK_BOX(ret), url_frame, FALSE, FALSE, 0); - gtk_widget_show (url_frame); - - table = gtk_table_new ( 5, 2, FALSE/* homogeneous */); - gtk_table_set_row_spacings( GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_widget_show(table); - gtk_container_add( GTK_CONTAINER (url_frame) , table ); - - field = gtk_check_button_new_with_mnemonic( _("_SIP protocol")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(field), (g_strcasecmp (_urlhook_config->sip_enabled, "1")==0)?TRUE:FALSE); - g_signal_connect (G_OBJECT(field) , "clicked" , G_CALLBACK (sip_enabled_cb), NULL); - gtk_table_attach ( GTK_TABLE( table ), field, 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - field = gtk_check_button_new_with_mnemonic( _("_IAX2 protocol")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(field), TRUE); - //g_signal_connect (G_OBJECT(field) , "clicked" , NULL, NULL); - gtk_table_attach ( GTK_TABLE( table ), field, 0, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive (GTK_WIDGET (field), FALSE); - - label = gtk_label_new_with_mnemonic (_("_SIP Header: ")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - field = gtk_entry_new (); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), field); - gtk_entry_set_text(GTK_ENTRY(field), _urlhook_config->sip_field); - gtk_table_attach ( GTK_TABLE( table ), field, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - label = gtk_label_new_with_mnemonic (_("_Command: ")); - gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - command = gtk_entry_new (); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), command); - gtk_entry_set_text(GTK_ENTRY(command), _urlhook_config->command); - gtk_table_attach ( GTK_TABLE( table ), command, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); - - gtk_widget_show_all(ret); - - return ret; -} diff --git a/sflphone-gtk/src/main.c b/sflphone-gtk/src/main.c index b3c92c07315d4765c13d28c82ffad85591efd6c2..8593ee5cd93b4ba211de6c05dd8fe505f715e04d 100644 --- a/sflphone-gtk/src/main.c +++ b/sflphone-gtk/src/main.c @@ -1,110 +1,157 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + #include <actions.h> #include <calllist.h> #include <config.h> -#include <dbus.h> +#include <dbus/dbus.h> #include <mainwindow.h> #include <statusicon.h> #include <gtk/gtk.h> #include <stdlib.h> +/** + * Stop logging engine + */ +static void +shutdown_logging() +{ + if (log4c_fini()) + { + ERROR("log4c_fini() failed"); + } +} + +/** + * Start loggin engine + */ +static void +startup_logging() +{ + log4c_init(); + if (log4c_load(DATA_DIR "/log4crc") == -1) + g_warning("Cannot load log4j configuration file : %s",DATA_DIR "/log4crc"); + + log4c_sfl_gtk_category = log4c_category_get("org.sflphone.gtk"); +} + int -main (int argc, char *argv[]) +main(int argc, char *argv[]) { - gtk_init (&argc, &argv); - + // Handle logging + int i; + + // Startup logging + startup_logging(); + + // Check arguments if debug mode is activated + for (i = 0; i < argc; i++) + if (g_strcmp0(argv[i], "--debug") == 0) + log4c_category_set_priority(log4c_sfl_gtk_category, LOG4C_PRIORITY_DEBUG); + + // Start GTK application + + gtk_init(&argc, &argv); + g_print("%s\n", PACKAGE_STRING); g_print("Copyright (c) 2005 2006 2007 2008 2009 Savoir-faire Linux Inc.\n"); - g_print("This is free software. You may redistribute copies of it under the terms of\n\ + g_print( + "This is free software. You may redistribute copies of it under the terms of\n\ the GNU General Public License Version 3 <http://www.gnu.org/licenses/gpl.html>.\n\ There is NO WARRANTY, to the extent permitted by law.\n\n"); - - srand ( time(NULL) ); - + + DEBUG("Logging Started"); + + srand(time(NULL)); + // Internationalization - bindtextdomain( "sflphone" , "/usr/share/locale" ); - textdomain( "sflphone" ); - - if(sflphone_init()) - { - #if GTK_CHECK_VERSION(2,10,0) - show_status_icon(); - #endif - create_main_window (); - - #if GTK_CHECK_VERSION(2,10,0) - if( dbus_is_start_hidden() ) + bindtextdomain("sflphone", "/usr/share/locale"); + textdomain("sflphone"); + + if (sflphone_init()) { - gtk_widget_hide(GTK_WIDGET( get_main_window() )); - set_minimized( TRUE ); +#if GTK_CHECK_VERSION(2,10,0) + show_status_icon(); +#endif + create_main_window(); + +#if GTK_CHECK_VERSION(2,10,0) + if (dbus_is_start_hidden()) + { + gtk_widget_hide(GTK_WIDGET( get_main_window() )); + set_minimized(TRUE); + } +#endif + + status_bar_display_account(); + + /* start the main loop */ + gtk_main(); } - #endif - /* start the main loop */ - gtk_main (); - } + // Cleanly stop logging + shutdown_logging(); + return 0; } -/** @mainpage SFLphone GTK+ Client Documentation - * SFLphone GTK+ Client was started as a debuging tool for the new dbus API but - * ended being a full featured client. - * @section intro_sec Architecture - * SFLphone respects the MVC principle. Since the internal workings and the UI - * are too different programs, dbus is used to exchange data between them. Dbus - * is thereby inforcing MVC by only allowing access to high level functions and data. - * - * Therefore, when a button is clicked, a direct dbus API call should happen - * (defined in dbus.h). The UI should only be updated when signals are received - * from dbus. The call back to those signals are defined in dbus.c, but they call - * functions in actions.h. This makes things cleaner as one signal could have many - * actions. - * - * Accounts are stored in form of a account_t in an account list with access functions - * defined in accountlist.h. - * - * Calls are stored in form of a call_t in a call list with access functions defined - * in calllist.h. - * - */ - -// This doc is for generated files that get overridden by tools. +/** @mainpage SFLphone GTK+ Client Documentation + * SFLphone GTK+ Client was started as a debuging tool for the new dbus API but + * ended being a full featured client. + * @section intro_sec Architecture + * SFLphone respects the MVC principle. Since the internal workings and the UI + * are too different programs, dbus is used to exchange data between them. Dbus + * is thereby inforcing MVC by only allowing access to high level functions and data. + * + * Therefore, when a button is clicked, a direct dbus API call should happen + * (defined in dbus.h). The UI should only be updated when signals are received + * from dbus. The call back to those signals are defined in dbus.c, but they call + * functions in actions.h. This makes things cleaner as one signal could have many + * actions. + * + * Accounts are stored in form of a account_t in an account list with access functions + * defined in accountlist.h. + * + * Calls are stored in form of a call_t in a call list with access functions defined + * in calllist.h. + * + */ + +// This doc is for generated files that get overridden by tools. /** @file marshaller.h - * @brief This file contains marshallers functions for dbus signals. - * This file is generated by glib-genmarshall. - * Every dbus signal has to have a marshaller. To generate a new marshaller function, - * add its signature to the marshaller.list. Then run : - * <pre>glib-genmarshal --body --g-fatal-warnings marshaller.list > marshaller.c - * glib-genmarshal --header --g-fatal-warnings marshaller.list > marshaller.h</pre> - * to get the generated marshallers. - * Just before connecting to the dbus signal, register the marshaller with: - * dbus_g_object_register_marshaller(). - */ - + * @brief This file contains marshallers functions for dbus signals. + * This file is generated by glib-genmarshall. + * Every dbus signal has to have a marshaller. To generate a new marshaller function, + * add its signature to the marshaller.list. Then run : + * <pre>glib-genmarshal --body --g-fatal-warnings marshaller.list > marshaller.c + * glib-genmarshal --header --g-fatal-warnings marshaller.list > marshaller.h</pre> + * to get the generated marshallers. + * Just before connecting to the dbus signal, register the marshaller with: + * dbus_g_object_register_marshaller(). + */ + /** @file callmanager-glue.h, configurationmanager-glue.h, contactmanager-glue.h - * @brief CallManager, ConfigurationManager and ContactManager dbus APIs. - * These files are generated by dbus-binding-tool using the server's files named *-introspec.xml: - * <pre>dbus-binding-tool --mode=glib-client "../../src/dbus/callmanager-introspec.xml" > callmanager-glue.h</pre> - * <pre>dbus-binding-tool --mode=glib-client "../../src/dbus/configurationmanager-introspec.xml" > configurationmanager-glue.h</pre> - * <pre>dbus-binding-tool --mode=glib-client "../../src/dbus/contactmanager-introspec.xml" > contactmanager-glue.h</pre> - * These files dbus call wrapper functions to simplify access to dbus API. - */ + * @brief CallManager, ConfigurationManager and ContactManager dbus APIs. + * These files are generated by dbus-binding-tool using the server's files named *-introspec.xml: + * <pre>dbus-binding-tool --mode=glib-client "../../src/dbus/callmanager-introspec.xml" > callmanager-glue.h</pre> + * <pre>dbus-binding-tool --mode=glib-client "../../src/dbus/configurationmanager-introspec.xml" > configurationmanager-glue.h</pre> + * <pre>dbus-binding-tool --mode=glib-client "../../src/dbus/contactmanager-introspec.xml" > contactmanager-glue.h</pre> + * These files dbus call wrapper functions to simplify access to dbus API. + */ diff --git a/sflphone-gtk/src/mainwindow.c b/sflphone-gtk/src/mainwindow.c index eb8efe6cadc0ea8cd829bef52b766dba6c728f7c..84001fbe322c507f2779b0d9e24d3c66eac405b8 100644 --- a/sflphone-gtk/src/mainwindow.c +++ b/sflphone-gtk/src/mainwindow.c @@ -18,6 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <toolbar.h> #include <config.h> #include <actions.h> #include <calltab.h> @@ -27,7 +28,7 @@ #include <mainwindow.h> #include <menus.h> #include <sliders.h> -#include <searchfilter.h> +#include <contacts/searchbar.h> #include <assistant.h> #include <gtk/gtk.h> @@ -59,7 +60,7 @@ on_delete (GtkWidget * widget UNUSED, gpointer data UNUSED) /** Ask the user if he wants to hangup current calls */ gboolean main_window_ask_quit(){ - guint count = call_list_get_size(current_calls); + guint count = calllist_get_size(current_calls); GtkWidget * dialog; gint response; gchar * question; @@ -104,7 +105,7 @@ create_main_window () window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (window), 0); gtk_window_set_title (GTK_WINDOW (window), PACKAGE); - gtk_window_set_default_size (GTK_WINDOW (window), 258, 320); + gtk_window_set_default_size (GTK_WINDOW (window), 300, 320); gtk_window_set_default_icon_from_file (ICONS_DIR "/sflphone.png", NULL); gtk_window_set_position( GTK_WINDOW( window ) , GTK_WIN_POS_MOUSE); @@ -141,13 +142,13 @@ create_main_window () gtk_box_pack_start (GTK_BOX (vbox), subvbox, FALSE /*expand*/, FALSE /*fill*/, 0 /*padding*/); - + // if( SHOW_SEARCHBAR ){ // filterEntry = create_filter_entry(); // gtk_box_pack_start (GTK_BOX (subvbox), filterEntry, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); // gtk_widget_show_all ( filterEntry ); // } - + if( SHOW_VOLUME ){ speaker_control = create_slider("speaker"); @@ -178,7 +179,9 @@ create_main_window () /* dont't show the contact list */ gtk_widget_hide(contacts->tree); - gtk_tree_view_set_model(GTK_TREE_VIEW(history->view), GTK_TREE_MODEL(histfilter)); + searchbar_init(history); + searchbar_init(contacts); + /* don't show waiting layer */ gtk_widget_hide(waitingLayer); @@ -283,7 +286,7 @@ main_window_volume_controls( gboolean *state ){ } void -main_window_searchbar( gboolean *state ){ +main_window_searchbar( gboolean *state UNUSED){ if( !SHOW_SEARCHBAR ) { // filterEntry = create_filter_entry(); diff --git a/sflphone-gtk/src/marshaller.c b/sflphone-gtk/src/marshaller.c index 9748d5175304ed42814a3a7d4356286017e481aa..d7f2cb2f7ad24a89d078248be93b1b47fa034ce2 100644 --- a/sflphone-gtk/src/marshaller.c +++ b/sflphone-gtk/src/marshaller.c @@ -1,5 +1,5 @@ -#include <glib-object.h> +#include <marshaller.h> #ifdef G_ENABLE_DEBUG @@ -50,10 +50,10 @@ /* VOID:STRING,STRING,STRING (marshaller.list:1) */ void g_cclosure_user_marshal_VOID__STRING_STRING_STRING (GClosure *closure, - GValue *return_value, + GValue *return_value UNUSED, guint n_param_values, const GValue *param_values, - gpointer invocation_hint, + gpointer invocation_hint UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_STRING_STRING) (gpointer data1, @@ -89,10 +89,10 @@ g_cclosure_user_marshal_VOID__STRING_STRING_STRING (GClosure *closure, /* VOID:STRING,STRING (marshaller.list:2) */ void g_cclosure_user_marshal_VOID__STRING_STRING (GClosure *closure, - GValue *return_value, + GValue *return_value UNUSED, guint n_param_values, const GValue *param_values, - gpointer invocation_hint, + gpointer invocation_hint UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_STRING) (gpointer data1, @@ -128,10 +128,10 @@ g_cclosure_user_marshal_VOID__STRING_STRING (GClosure *closure, /* VOID:STRING,INT (marshaller.list:4) */ void g_cclosure_user_marshal_VOID__STRING_INT (GClosure *closure, - GValue *return_value, + GValue *return_value UNUSED, guint n_param_values, const GValue *param_values, - gpointer invocation_hint, + gpointer invocation_hint UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_INT) (gpointer data1, @@ -165,10 +165,10 @@ g_cclosure_user_marshal_VOID__STRING_INT (GClosure *closure, /* VOID:STRING,DOUBLE (marshaller.list:5) */ void g_cclosure_user_marshal_VOID__STRING_DOUBLE (GClosure *closure, - GValue *return_value, + GValue *return_value UNUSED, guint n_param_values, const GValue *param_values, - gpointer invocation_hint, + gpointer invocation_hint UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_DOUBLE) (gpointer data1, diff --git a/sflphone-gtk/src/marshaller.h b/sflphone-gtk/src/marshaller.h index 0b9ee7339e95a6d5da00e76cb9d6a7704baae8dc..4d32b8b6d7bd95de6d3b2d58039e40ddcd46884c 100644 --- a/sflphone-gtk/src/marshaller.h +++ b/sflphone-gtk/src/marshaller.h @@ -2,7 +2,8 @@ #ifndef __g_cclosure_user_marshal_MARSHAL_H__ #define __g_cclosure_user_marshal_MARSHAL_H__ -#include <glib-object.h> +#include <glib-object.h> +#include <sflphone_const.h> G_BEGIN_DECLS diff --git a/sflphone-gtk/src/menus.c b/sflphone-gtk/src/menus.c index 31bcfe0be2873b83c91950e8bdacc69caae4e701..a8681ebebf584ada31392c2ffaf8d4aa7f636bcc 100644 --- a/sflphone-gtk/src/menus.c +++ b/sflphone-gtk/src/menus.c @@ -19,14 +19,10 @@ */ #include <menus.h> -#include <actions.h> -#include <calllist.h> -#include <calltree.h> #include <config.h> #include <configwindow.h> -#include <dbus.h> +#include <dbus/dbus.h> #include <mainwindow.h> -#include <calltab.h> #include <assistant.h> #include <gtk/gtk.h> #include <glib/gprintf.h> @@ -40,6 +36,9 @@ GtkWidget * copyMenu; GtkWidget * pasteMenu; GtkWidget * recordMenu; +GtkWidget * editable_num; +GtkDialog * edit_dialog; + guint holdConnId; //The hold_menu signal connection ID GtkWidget * dialpadMenu; @@ -59,7 +58,7 @@ void update_menus() gtk_widget_set_sensitive( GTK_WIDGET(recordMenu), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(copyMenu), FALSE); - call_t * selectedCall = call_get_selected(active_calltree); + call_t * selectedCall = calltab_get_selected_call(active_calltree); if (selectedCall) { gtk_widget_set_sensitive( GTK_WIDGET(copyMenu), TRUE); @@ -97,7 +96,7 @@ void update_menus() gtk_widget_set_sensitive( GTK_WIDGET(hangUpMenu), TRUE); break; default: - g_warning("Should not happen in update_menus()!"); + WARN("Should not happen in update_menus()!"); break; } } @@ -203,14 +202,15 @@ call_minimize ( void * foo UNUSED) switch_account( GtkWidget* item , gpointer data UNUSED) { account_t* acc = g_object_get_data( G_OBJECT(item) , "account" ); - g_print("%s\n" , acc->accountID); + DEBUG("%s" , acc->accountID); account_list_set_current_id( acc->accountID ); + status_bar_display_account (); } static void call_hold (void* foo UNUSED) { - call_t * selectedCall = call_get_selected(current_calls); + call_t * selectedCall = calltab_get_selected_call(current_calls); if(selectedCall) { @@ -256,10 +256,10 @@ call_wizard ( void * foo UNUSED) static void remove_from_history( void * foo UNUSED) { - call_t* c = call_get_selected( history ); + call_t* c = calltab_get_selected_call( history ); if(c){ - g_print("Remove the call from the history\n"); - call_list_remove_from_history( c ); + DEBUG("Remove the call from the history"); + calllist_remove_from_history( c ); } } @@ -269,7 +269,7 @@ call_back( void * foo UNUSED) call_t *selected_call, *new_call; gchar *to, *from; - selected_call = call_get_selected( active_calltree ); + selected_call = calltab_get_selected_call( active_calltree ); if( selected_call ) { @@ -278,10 +278,10 @@ call_back( void * foo UNUSED) create_new_call (to, from, CALL_STATE_DIALING, "", &new_call); - call_list_add(current_calls, new_call); - update_call_tree_add(current_calls, new_call); + calllist_add(current_calls, new_call); + calltree_add_call(current_calls, new_call); sflphone_place_call(new_call); - display_calltree (current_calls); + calltree_display (current_calls); } } @@ -408,7 +408,7 @@ edit_accounts ( void * foo UNUSED) edit_copy ( void * foo UNUSED) { GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); - call_t * selectedCall = call_get_selected(current_calls); + call_t * selectedCall = calltab_get_selected_call(current_calls); gchar * no = NULL; if(selectedCall) @@ -440,7 +440,7 @@ edit_copy ( void * foo UNUSED) edit_paste ( void * foo UNUSED) { GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); - call_t * selectedCall = call_get_selected(current_calls); + call_t * selectedCall = calltab_get_selected_call(current_calls); gchar * no = gtk_clipboard_wait_for_text (clip); if(no && selectedCall) @@ -454,14 +454,14 @@ edit_paste ( void * foo UNUSED) gchar * before = selectedCall->to; selectedCall->to = g_strconcat(selectedCall->to, no, NULL); g_free(before); - g_print("TO: %s\n", selectedCall->to); + DEBUG("TO: %s", selectedCall->to); if(selectedCall->state == CALL_STATE_DIALING) { g_free(selectedCall->from); selectedCall->from = g_strconcat("\"\" <", selectedCall->to, ">", NULL); } - update_call_tree(current_calls, selectedCall); + calltree_update_call(current_calls, selectedCall); } break; case CALL_STATE_RINGING: @@ -475,12 +475,12 @@ edit_paste ( void * foo UNUSED) gchar * before = selectedCall->to; selectedCall->to = g_strconcat(selectedCall->to, no, NULL); g_free(before); - g_print("TO: %s\n", selectedCall->to); + DEBUG("TO: %s", selectedCall->to); g_free(selectedCall->from); selectedCall->from = g_strconcat("\"\" <", selectedCall->to, ">", NULL); - update_call_tree(current_calls, selectedCall); + calltree_update_call(current_calls, selectedCall); } break; case CALL_STATE_CURRENT: @@ -490,7 +490,7 @@ edit_paste ( void * foo UNUSED) for(i = 0; i < strlen(no); i++) { gchar * oneNo = g_strndup(&no[i], 1); - g_print("<%s>\n", oneNo); + DEBUG("<%s>", oneNo); dbus_play_dtmf(oneNo); gchar * temp = g_strconcat(call_get_number(selectedCall), oneNo, NULL); @@ -498,7 +498,7 @@ edit_paste ( void * foo UNUSED) selectedCall->from = g_strconcat("\"",call_get_name(selectedCall) ,"\" <", temp, ">", NULL); g_free(before); g_free(temp); - update_call_tree(current_calls, selectedCall); + calltree_update_call(current_calls, selectedCall); } } @@ -513,11 +513,11 @@ edit_paste ( void * foo UNUSED) gchar * before = selectedCall->to; selectedCall->to = g_strconcat(selectedCall->to, no, NULL); g_free(before); - g_print("TO: %s\n", selectedCall->to); + DEBUG("TO: %s", selectedCall->to); g_free(selectedCall->from); selectedCall->from = g_strconcat("\"\" <", selectedCall->to, ">", NULL); - update_call_tree(current_calls,selectedCall); + calltree_update_call(current_calls,selectedCall); } } @@ -525,8 +525,8 @@ edit_paste ( void * foo UNUSED) static void clear_history (void) { - if( call_list_get_size( history ) != 0 ){ - call_list_clean_history(); + if( calllist_get_size( history ) != 0 ){ + calllist_clean_history(); } } @@ -622,6 +622,7 @@ view_volume_controls (GtkImageMenuItem *imagemenuitem UNUSED, dbus_set_volume_controls( state ); } +/* static void view_searchbar (GtkImageMenuItem *imagemenuitem UNUSED, void* foo UNUSED) @@ -630,7 +631,7 @@ view_searchbar (GtkImageMenuItem *imagemenuitem UNUSED, main_window_searchbar( &state ); dbus_set_searchbar( state ); } - +*/ GtkWidget * create_view_menu() { @@ -664,14 +665,15 @@ create_view_menu() NULL); gtk_widget_show (volumeMenu); - image = gtk_image_new_from_stock( GTK_STOCK_FIND , GTK_ICON_SIZE_MENU ); - searchbarMenu = gtk_image_menu_item_new_with_mnemonic (_("_Search contact")); + /*image = gtk_image_new_from_stock( GTK_STOCK_FIND , GTK_ICON_SIZE_MENU ); + searchbarMenu = gtk_image_menu_item_new_with_mnemonic (_("_Search bar")); gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM ( searchbarMenu ), image ); gtk_menu_shell_append (GTK_MENU_SHELL (menu), searchbarMenu); g_signal_connect(G_OBJECT (searchbarMenu), "activate", G_CALLBACK (view_searchbar), NULL); gtk_widget_show (searchbarMenu); + */ root_menu = gtk_menu_item_new_with_mnemonic (_("_View")); gtk_menu_item_set_submenu (GTK_MENU_ITEM (root_menu), menu); @@ -709,6 +711,12 @@ create_menus ( ) /* ----------------------------------------------------------------- */ +static void edit_number_cb (GtkWidget *widget UNUSED, gpointer user_data) { + + show_edit_number ((call_t*)user_data); +} + + void show_popup_menu (GtkWidget *my_widget, GdkEventButton *event) { @@ -717,7 +725,7 @@ show_popup_menu (GtkWidget *my_widget, GdkEventButton *event) gboolean pickup = FALSE, hangup = FALSE, hold = FALSE, copy = FALSE, record = FALSE; gboolean accounts = FALSE; - call_t * selectedCall = call_get_selected(current_calls); + call_t * selectedCall = calltab_get_selected_call(current_calls); if (selectedCall) { copy = TRUE; @@ -750,7 +758,7 @@ show_popup_menu (GtkWidget *my_widget, GdkEventButton *event) hangup = TRUE; break; default: - g_warning("Should not happen in show_popup_menu!"); + WARN("Should not happen in show_popup_menu!"); break; } } @@ -839,32 +847,7 @@ show_popup_menu (GtkWidget *my_widget, GdkEventButton *event) if(accounts) { - menu_items = gtk_separator_menu_item_new (); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - gtk_widget_show (menu_items); - - unsigned int i; - account_t* acc; - gchar* alias; - for( i = 0 ; i < account_list_get_size() ; i++ ){ - acc = account_list_get_nth(i); - // Display only the registered accounts - if( g_strcasecmp( account_state_name(acc -> state) , account_state_name(ACCOUNT_STATE_REGISTERED) ) == 0 ){ - alias = g_strconcat( g_hash_table_lookup(acc->properties , ACCOUNT_ALIAS) , " - ",g_hash_table_lookup(acc->properties , ACCOUNT_TYPE), NULL); - menu_items = gtk_check_menu_item_new_with_mnemonic(alias); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_object_set_data( G_OBJECT( menu_items ) , "account" , acc ); - g_free( alias ); - if( account_list_get_current() != NULL ){ - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_items), - (g_strcasecmp( acc->accountID , account_list_get_current()->accountID) == 0)? TRUE : FALSE); - } - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (switch_account), - NULL); - gtk_widget_show (menu_items); - } // fi - } + add_registered_accounts_to_menu (menu); } if (event) @@ -890,12 +873,14 @@ show_popup_menu_history(GtkWidget *my_widget, GdkEventButton *event) gboolean pickup = FALSE; gboolean remove = FALSE; + gboolean edit = FALSE; - call_t * selectedCall = call_get_selected( history ); + call_t * selectedCall = calltab_get_selected_call( history ); if (selectedCall) { remove = TRUE; pickup = TRUE; + edit = TRUE; } GtkWidget *menu; @@ -922,6 +907,15 @@ show_popup_menu_history(GtkWidget *my_widget, GdkEventButton *event) gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); gtk_widget_show (menu_items); + if (edit) + { + menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_EDIT, get_accel_group()); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (edit_number_cb), selectedCall); + gtk_widget_show (menu_items); + } + + if(remove) { menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_DELETE, get_accel_group()); @@ -945,3 +939,176 @@ show_popup_menu_history(GtkWidget *my_widget, GdkEventButton *event) gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time); } + void +show_popup_menu_contacts(GtkWidget *my_widget, GdkEventButton *event) +{ + + gboolean pickup = FALSE; + gboolean accounts = FALSE; + gboolean edit = FALSE; + + call_t * selectedCall = calltab_get_selected_call( contacts ); + if (selectedCall) + { + pickup = TRUE; + accounts = TRUE; + edit = TRUE; + } + + GtkWidget *menu; + GtkWidget *image; + int button, event_time; + GtkWidget * menu_items; + + menu = gtk_menu_new (); + //g_signal_connect (menu, "deactivate", + // G_CALLBACK (gtk_widget_destroy), NULL); + + if(pickup) + { + + menu_items = gtk_image_menu_item_new_with_mnemonic(_("_New call")); + image = gtk_image_new_from_file( ICONS_DIR "/icon_accept.svg"); + gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM ( menu_items ), image ); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (call_back), NULL); + gtk_widget_show (menu_items); + } + + if (edit) + { + menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_EDIT, get_accel_group()); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (edit_number_cb), selectedCall); + gtk_widget_show (menu_items); + } + + if(accounts) + { + add_registered_accounts_to_menu (menu); + } + + if (event) + { + button = event->button; + event_time = event->time; + } + else + { + button = 0; + event_time = gtk_get_current_event_time (); + } + + gtk_menu_attach_to_widget (GTK_MENU (menu), my_widget, NULL); + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, + button, event_time); +} + + +void add_registered_accounts_to_menu (GtkWidget *menu) { + + GtkWidget *menu_items; + unsigned int i; + account_t* acc; + gchar* alias; + + menu_items = gtk_separator_menu_item_new (); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + gtk_widget_show (menu_items); + + for( i = 0 ; i < account_list_get_size() ; i++ ){ + acc = account_list_get_nth(i); + // Display only the registered accounts + if( g_strcasecmp( account_state_name(acc -> state) , account_state_name(ACCOUNT_STATE_REGISTERED) ) == 0 ){ + alias = g_strconcat( g_hash_table_lookup(acc->properties , ACCOUNT_ALIAS) , " - ",g_hash_table_lookup(acc->properties , ACCOUNT_TYPE), NULL); + menu_items = gtk_check_menu_item_new_with_mnemonic(alias); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); + g_object_set_data( G_OBJECT( menu_items ) , "account" , acc ); + g_free( alias ); + if( account_list_get_current() != NULL ){ + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_items), + (g_strcasecmp( acc->accountID , account_list_get_current()->accountID) == 0)? TRUE : FALSE); + } + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (switch_account), + NULL); + gtk_widget_show (menu_items); + } // fi + } + +} + +static void ok_cb (GtkWidget *widget UNUSED, gpointer userdata) { + + gchar *new_number, *from; + call_t *modified_call, *original; + + // Change the number of the selected call before calling + new_number = (gchar*) gtk_entry_get_text (GTK_ENTRY (editable_num)); + original = (call_t*)userdata; + + // Edit the from field with the updated phone number value + from = g_strconcat("\"", call_get_name (original), "\" <", new_number, ">",NULL); + + // Create the new call + create_new_call (g_strdup (new_number), from, CALL_STATE_DIALING, g_strdup (original->accountID), &modified_call); + + // Update the internal data structure and the GUI + calllist_add(current_calls, modified_call); + calltree_add_call(current_calls, modified_call); + sflphone_place_call(modified_call); + calltree_display (current_calls); + + // Close the contextual menu + gtk_widget_destroy (GTK_WIDGET (edit_dialog)); +} + +static void on_delete (GtkWidget * widget) +{ + gtk_widget_destroy (widget); +} + +void show_edit_number (call_t *call) { + + GtkWidget *ok, *hbox, *image; + GdkPixbuf *pixbuf; + + edit_dialog = GTK_DIALOG (gtk_dialog_new()); + + // Set window properties + gtk_window_set_default_size(GTK_WINDOW(edit_dialog), 300, 20); + gtk_window_set_title(GTK_WINDOW(edit_dialog), _("Edit phone")); + gtk_window_set_resizable (GTK_WINDOW (edit_dialog), FALSE); + + g_signal_connect (G_OBJECT (edit_dialog), "delete-event", G_CALLBACK (on_delete), NULL); + + hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start(GTK_BOX (edit_dialog->vbox), hbox, TRUE, TRUE, 0); + + // Set the number to be edited + editable_num = gtk_entry_new (); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(GTK_WIDGET(editable_num), _("Edit the phone number before making a call")); +#endif + if (call) + gtk_entry_set_text(GTK_ENTRY(editable_num), g_strdup (call_get_number (call))); + else + ERROR ("This a bug, the call should be defined. menus.c line 1051"); + + gtk_box_pack_start(GTK_BOX (hbox), editable_num, TRUE, TRUE, 0); + + // Set a custom image for the button + pixbuf = gdk_pixbuf_new_from_file_at_scale (ICONS_DIR "/outgoing.svg", 32, 32, TRUE, NULL); + image = gtk_image_new_from_pixbuf (pixbuf); + ok = gtk_button_new (); + gtk_button_set_image (GTK_BUTTON (ok), image); + gtk_box_pack_start(GTK_BOX (hbox), ok, TRUE, TRUE, 0); + g_signal_connect(G_OBJECT (ok), "clicked", G_CALLBACK (ok_cb), call); + + gtk_widget_show_all (edit_dialog->vbox); + + gtk_dialog_run(edit_dialog); + +} + + diff --git a/sflphone-gtk/src/menus.h b/sflphone-gtk/src/menus.h index 1d1efe53147c705e3110a323ab0f3f42226a7dbf..125bd1a298c6270a43720706f058ba3b52eb37bd 100644 --- a/sflphone-gtk/src/menus.h +++ b/sflphone-gtk/src/menus.h @@ -21,6 +21,7 @@ #define __MENUS_H__ #include <gtk/gtk.h> +#include <call.h> /** @file menus.h * @brief The menus of the main window. */ @@ -49,4 +50,10 @@ void show_popup_menu (GtkWidget *my_widget, GdkEventButton *event); * @param event The mouse event */ void show_popup_menu_history (GtkWidget *my_widget, GdkEventButton *event); + +void show_popup_menu_contacts (GtkWidget *my_widget, GdkEventButton *event); + +void add_registered_accounts_to_menu (GtkWidget *menu); + +void show_edit_number (call_t *call); #endif diff --git a/sflphone-gtk/src/reqaccount.c b/sflphone-gtk/src/reqaccount.c index f9079b8cb2786488971bfd31c3870da774a1a66a..cfd55fefcc89313756b3dead8043d619d6327d1d 100644 --- a/sflphone-gtk/src/reqaccount.c +++ b/sflphone-gtk/src/reqaccount.c @@ -21,7 +21,7 @@ * To test: * * cc -o reqhttp reqhttp.c -DBUILD_EXAMPLE - * + * */ #include <stdio.h> @@ -35,6 +35,7 @@ #include <arpa/inet.h> #include <unistd.h> #include <stdlib.h> +#include <sflphone_const.h> #include "reqaccount.h" @@ -48,7 +49,7 @@ int req(char *host, int port, char *req, char *ret) { int i=0; FILE *f; char buf[1024]; - + bzero(&servSockAddr, sizeof(servSockAddr)); servHostEnt = gethostbyname(host); if (servHostEnt == NULL) { @@ -58,18 +59,18 @@ int req(char *host, int port, char *req, char *ret) { bcopy((char *)servHostEnt->h_addr, (char *)&servSockAddr.sin_addr, servHostEnt->h_length); servSockAddr.sin_port = htons(port); servSockAddr.sin_family = AF_INET; - + if ((s = socket(AF_INET,SOCK_STREAM,0)) < 0) { strcpy(ret, "socket"); return -1; } - + if(connect(s, (const struct sockaddr *) &servSockAddr, (socklen_t) sizeof(servSockAddr)) < 0 ) { perror("foo"); strcpy(ret, "connect"); return -1; } - + f = fdopen(s, "r+"); fprintf(f, "%s HTTP/1.1\r\n", req); @@ -103,7 +104,7 @@ rest_account get_rest_account(char *host,char *email) { char ret[4096]; rest_account ra; bzero(ret, sizeof(ret)); - printf("HOST: %s\n", host); + DEBUG("HOST: %s", host); strcpy(ret,"GET /rest/accountcreator?email="); strcat(ret, email); if (req(host, 80, ret, ret) != -1) { @@ -127,7 +128,7 @@ int main (void) { puts(acc.user); puts(acc.passwd); } else { - printf("FAILED: %s\n", acc.reason); + ERROR("FAILED: %s", acc.reason); } } #endif diff --git a/sflphone-gtk/src/searchfilter.c b/sflphone-gtk/src/searchfilter.c deleted file mode 100644 index 7603993a3de7b3d8063b1890b57d69b5ea68aaf4..0000000000000000000000000000000000000000 --- a/sflphone-gtk/src/searchfilter.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (C) 2008 2009 Savoir-Faire Linux inc. - * - * Author: Antoine Reversat <antoine.reversat@savoirfairelinux.com> - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <string.h> - -#include <searchfilter.h> -#include <calltree.h> -#include <contactlist/eds.h> -#include "addressbook-config.h" - -static void handler_async_search (GList *hits, gpointer user_data UNUSED); - -GtkTreeModel* create_filter (GtkTreeModel* child) { - - GtkTreeModel* ret; - - ret = gtk_tree_model_filter_new(child, NULL); - gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(ret), is_visible, NULL, NULL); - return GTK_TREE_MODEL(ret); - -} - -gboolean is_visible (GtkTreeModel* model, GtkTreeIter* iter, gpointer data UNUSED) { - - if( SHOW_SEARCHBAR ) - { - GValue val; - - gchar* text = NULL; - gchar* search = (gchar*)gtk_entry_get_text(GTK_ENTRY(filter_entry_history)); - memset (&val, 0, sizeof(val)); - gtk_tree_model_get_value(GTK_TREE_MODEL(model), iter, 1, &val); - if(G_VALUE_HOLDS_STRING(&val)){ - text = (gchar *)g_value_get_string(&val); - } - if(text != NULL && g_ascii_strncasecmp(search, _("Search"), 6) != 0){ - return g_regex_match_simple(search, text, G_REGEX_CASELESS, 0); - } - g_value_unset (&val); - return TRUE; - } - return TRUE; - -} - -static void handler_async_search (GList *hits, gpointer user_data) { - - GList *i; - GdkPixbuf *photo = NULL; - AddressBook_Config *addressbook_config; - call_t *j; - - // freeing calls - while((j = (call_t *)g_queue_pop_tail (contacts->callQueue)) != NULL) - { - free_call_t(j); - } - - // Retrieve the address book parameters - addressbook_config = (AddressBook_Config*) user_data; - - // reset previous results - reset_call_tree(contacts); - call_list_reset(contacts); - - for (i = hits; i != NULL; i = i->next) - { - Hit *entry; - entry = i->data; - if (entry) - { - /* Get the photo */ - if (addressbook_display (addressbook_config, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO)) - photo = entry->photo; - /* Create entry for business phone information */ - if (addressbook_display (addressbook_config, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS)) - create_new_entry_in_contactlist (entry->name, entry->phone_business, CONTACT_PHONE_BUSINESS, photo); - /* Create entry for home phone information */ - if (addressbook_display (addressbook_config, ADDRESSBOOK_DISPLAY_PHONE_HOME)) - create_new_entry_in_contactlist (entry->name, entry->phone_home, CONTACT_PHONE_HOME, photo); - /* Create entry for mobile phone information */ - if (addressbook_display (addressbook_config, ADDRESSBOOK_DISPLAY_PHONE_MOBILE)) - create_new_entry_in_contactlist (entry->name, entry->phone_mobile, CONTACT_PHONE_MOBILE, photo); - } - free_hit(entry); - } - g_list_free(hits); - - // Deactivate waiting image - deactivateWaitingLayer(); -} - -void filter_entry_changed (GtkEntry* entry, gchar* arg1 UNUSED, gpointer data UNUSED) { - - AddressBook_Config *addressbook_config; - - /* Switch to the address book when the focus is on the search bar */ - // if (active_calltree != contacts) - // display_calltree (contacts); - - - /* We want to search in the contact list */ - if (active_calltree == contacts) { - // Activate waiting layer - activateWaitingLayer(); - - // Load the address book parameters - addressbook_load_parameters (&addressbook_config); - - // Start the asynchronous search as soon as we have an entry */ - search_async (gtk_entry_get_text (GTK_ENTRY (entry)), addressbook_config->max_results, &handler_async_search, addressbook_config); - } - - else if (active_calltree == history) { - // Filter the displayed calls - - } - -} - -void -filter_entry_changed_history(GtkEntry* entry UNUSED, gchar* arg1 UNUSED, gpointer data UNUSED) -{ - g_print("--- filter_entry_changed_history --- \n"); - - if (active_calltree != history) - display_calltree (history); - - // gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(historyButton), TRUE); - gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(histfilter)); - // gtk_tree_view_set_model(GTK_TREE_VIEW(history->view), GTK_TREE_MODEL(histfilter)); -} - - -void clear_filter_entry_if_default (GtkWidget* widget, gpointer user_data UNUSED) { - - if(g_ascii_strncasecmp(gtk_entry_get_text(GTK_ENTRY(widget)), _("Search"), 6) == 0) - gtk_entry_set_text(GTK_ENTRY(widget), ""); - -} - -GtkWidget* create_filter_entry_contact() { - - GtkWidget* image; - GtkWidget* ret = gtk_hbox_new(FALSE, 0); - - filter_entry_contact = sexy_icon_entry_new(); - image = gtk_image_new_from_stock( GTK_STOCK_FIND , GTK_ICON_SIZE_SMALL_TOOLBAR); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(filter_entry_contact), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); - sexy_icon_entry_add_clear_button( SEXY_ICON_ENTRY(filter_entry_contact) ); - gtk_entry_set_text(GTK_ENTRY(filter_entry_contact), _("Search")); - g_signal_connect(GTK_ENTRY(filter_entry_contact), "changed", G_CALLBACK(filter_entry_changed), NULL); - g_signal_connect(GTK_ENTRY(filter_entry_contact), "grab-focus", G_CALLBACK(clear_filter_entry_if_default), NULL); - - gtk_box_pack_start(GTK_BOX(ret), filter_entry_contact, TRUE, TRUE, 0); - - return ret; -} - - -GtkWidget* create_filter_entry_history() { - - g_print("--- create_filter_entry_history --- \n"); - - GtkWidget* image; - GtkWidget* ret = gtk_hbox_new(FALSE, 0); - - filter_entry_history = sexy_icon_entry_new(); - image = gtk_image_new_from_stock( GTK_STOCK_FIND , GTK_ICON_SIZE_SMALL_TOOLBAR); - sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(filter_entry_history), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) ); - sexy_icon_entry_add_clear_button( SEXY_ICON_ENTRY(filter_entry_history) ); - gtk_entry_set_text(GTK_ENTRY(filter_entry_history), _("Search")); - g_signal_connect(GTK_ENTRY(filter_entry_history), "changed", G_CALLBACK(filter_entry_changed_history), NULL); - g_signal_connect(GTK_ENTRY(filter_entry_history), "grab-focus", G_CALLBACK(clear_filter_entry_if_default), NULL); - - gtk_box_pack_start(GTK_BOX(ret), filter_entry_history, TRUE, TRUE, 0); - - return ret; -} - -void activateWaitingLayer() { - gtk_widget_show(waitingLayer); -} - -void deactivateWaitingLayer() { - gtk_widget_hide(waitingLayer); -} diff --git a/sflphone-gtk/src/sflnotify.c b/sflphone-gtk/src/sflnotify.c index b00123dfda655cc4da441d78b46ce37bdb59695e..5fe6081b423b48cb25565a571ae09235dc11b683 100644 --- a/sflphone-gtk/src/sflnotify.c +++ b/sflphone-gtk/src/sflnotify.c @@ -1,17 +1,17 @@ /* * Copyright (C) 2008 Savoir-Faire Linux inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -24,21 +24,26 @@ static NotifyNotification *notification; void notify_incoming_call( call_t* c ) { - if( dbus_get_notify()){ + if( dbus_get_notify()){ GdkPixbuf *pixbuf; gchar* callerid; gchar* title; notify_init("sflphone"); - title = g_markup_printf_escaped(_("%s account: %s") , - (gchar*)g_hash_table_lookup(account_list_get_by_id(c->accountID)->properties , ACCOUNT_TYPE) , - (gchar*)g_hash_table_lookup(account_list_get_by_id(c->accountID)->properties , ACCOUNT_ALIAS) ) ; + if (g_strcasecmp (c->accountID,"") == 0) { + title = g_markup_printf_escaped ("IP-to-IP call"); + } + else { + title = g_markup_printf_escaped(_("%s account: %s") , + (gchar*)g_hash_table_lookup(account_list_get_by_id(c->accountID)->properties , ACCOUNT_TYPE) , + (gchar*)g_hash_table_lookup(account_list_get_by_id(c->accountID)->properties , ACCOUNT_ALIAS) ) ; + } callerid = g_markup_printf_escaped(_("<i>From:</i> %s") , c->from); pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); - notification = notify_notification_new( title, + notification = notify_notification_new( title, callerid, NULL, NULL); @@ -54,7 +59,7 @@ notify_incoming_call( call_t* c ) notify_notification_add_action( notification , "ignore" , _("Ignore") , (NotifyActionCallback) ignore_call_cb , NULL , NULL ); if (!notify_notification_show (notification, NULL)) { - g_print("notify(), failed to send notification\n"); + ERROR("notify(), failed to send notification"); } } } @@ -63,7 +68,7 @@ answer_call_cb( NotifyNotification *notification, gpointer data UNUSED ) { call_t* c = (call_t*)g_object_get_data( G_OBJECT( notification ) , "call" ); c->history_state = INCOMING; - update_call_tree( history , c ); + calltree_update_call( history , c ); dbus_accept(c); #if GTK_CHECK_VERSION(2,10,0) if( __POPUP_WINDOW ) @@ -90,7 +95,7 @@ ignore_call_cb( NotifyNotification *notification, gpointer data UNUSED) notify_voice_mails( guint count , account_t* acc ) { - if( dbus_get_mail_notify()) { + if( dbus_get_mail_notify()) { // the account is different from NULL GdkPixbuf *pixbuf; gchar* title; @@ -117,7 +122,7 @@ notify_voice_mails( guint count , account_t* acc ) notify_notification_add_action( notification , "ignore" , _("Ignore") , (NotifyActionCallback) ignore_call_cb , NULL , NULL ); if (!notify_notification_show (notification, NULL)) { - g_print("notify(), failed to send notification\n"); + ERROR("notify(), failed to send notification"); } } } @@ -154,7 +159,7 @@ notify_current_account( account_t* acc ) notify_notification_add_action( notification , "ignore" , _("Ignore") , (NotifyActionCallback) ignore_call_cb , NULL , NULL ); if (!notify_notification_show (notification, NULL)) { - g_print("notify(), failed to send notification\n"); + ERROR("notify(), failed to send notification"); } } } @@ -166,7 +171,7 @@ notify_no_accounts( ) gchar* body=""; notify_init("sflphone"); - body = g_markup_printf_escaped(_("You haven't setup any accounts")); + body = g_markup_printf_escaped(_("You haven't setup any accounts")); title = g_markup_printf_escaped(_("Error")); @@ -182,10 +187,10 @@ notify_no_accounts( ) notify_notification_attach_to_status_icon( notification , get_status_icon() ); #endif notify_notification_set_timeout( notification , NOTIFY_EXPIRES_DEFAULT ); - notify_notification_add_action( notification , "setup" , _("Setup Accounts") , (NotifyActionCallback) setup_accounts_cb , NULL , NULL ); + //notify_notification_add_action( notification , "setup" , _("Setup Accounts") , (NotifyActionCallback) setup_accounts_cb , NULL , NULL ); if (!notify_notification_show (notification, NULL)) { - g_print("notify(), failed to send notification\n"); + ERROR("notify(), failed to send notification"); } } @@ -206,7 +211,7 @@ notify_no_registered_accounts( ) notify_init("sflphone"); - body = g_markup_printf_escaped(_("You have no registered accounts")); + body = g_markup_printf_escaped(_("You have no registered accounts")); title = g_markup_printf_escaped(_("Error")); @@ -223,20 +228,20 @@ notify_no_registered_accounts( ) notify_notification_attach_to_status_icon( notification , get_status_icon() ); #endif notify_notification_set_timeout( notification , NOTIFY_EXPIRES_DEFAULT ); - notify_notification_add_action( notification , "setup" , _("Setup Accounts") , (NotifyActionCallback) setup_accounts_cb , NULL , NULL ); + //notify_notification_add_action( notification , "setup" , _("Setup Accounts") , (NotifyActionCallback) setup_accounts_cb , NULL , NULL ); if (!notify_notification_show (notification, NULL)) { - g_print("notify(), failed to send notification\n"); + ERROR("notify(), failed to send notification"); } } - void + void stop_notification( void ) { if( notification != NULL ) { - if(notify_notification_show( notification , NULL)) + if(notify_notification_show( notification , NULL)) { notify_notification_close( notification , NULL); g_object_unref( notification ); diff --git a/sflphone-gtk/src/sflnotify.h b/sflphone-gtk/src/sflnotify.h index af383396f68ff3b7c910ed2dd6e6bbc1739562a6..6131322b445326a68b60114d1c849d5a020ad208 100644 --- a/sflphone-gtk/src/sflnotify.h +++ b/sflphone-gtk/src/sflnotify.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2008 Savoir-Faire Linux inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -28,21 +28,21 @@ #include <libnotify/notify.h> #include <accountlist.h> #include <calllist.h> -#include <dbus.h> +#include <dbus/dbus.h> #include <actions.h> #include <statusicon.h> #include <configwindow.h> #include <sflphone_const.h> /** - * Notify an incoming call + * Notify an incoming call * A dialog box is attached to the status icon * @param c The incoming call */ void notify_incoming_call( call_t* c); /** - * Notify voice mails count + * Notify voice mails count * An info box is attached to the status icon * @param count The number of voice mails * @param acc The account that received the notification @@ -66,8 +66,8 @@ void notify_no_accounts( ); void notify_no_registered_accounts( ); /** - * Callback when answer button is pressed. - * Action associated: Pick up the incoming call + * Callback when answer button is pressed. + * Action associated: Pick up the incoming call * @param notification The pointer on the notification structure * @param data The data associated. Here: call_t* */ @@ -75,7 +75,7 @@ void answer_call_cb( NotifyNotification *notification, gpointer data ); /** * Callback when refuse button is pressed - * Action associated: Hang up the incoming call + * Action associated: Hang up the incoming call * @param notification The pointer on the notification structure * @param data The data associated. Here: call_t* */ @@ -83,14 +83,14 @@ void refuse_call_cb( NotifyNotification *notification, gpointer data ); /** * Callback when ignore button is pressed - * Action associated: Nothing - The call continues ringing + * Action associated: Nothing - The call continues ringing * @param notification The pointer on the notification structure * @param data The data associated. Here: call_t* */ void ignore_call_cb( NotifyNotification *notification, gpointer data ); /** - * Callback when you try to make a call without accounts setup and 'setup account' button is clicked. + * Callback when you try to make a call without accounts setup and 'setup account' button is clicked. * Action associated: Open the account window * @param notification The pointer on the notification structure * @param data The data associated. Here: account_t* diff --git a/sflphone-gtk/src/sflphone_const.h b/sflphone-gtk/src/sflphone_const.h index 71f67fa2ec94795951c9e4d04d5eaa3fdedfac1f..49a5f3a315faf8e25ed8f1b086834ed0339cf75f 100644 --- a/sflphone-gtk/src/sflphone_const.h +++ b/sflphone-gtk/src/sflphone_const.h @@ -1,17 +1,17 @@ /* * Copyright (C) 2008 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -22,13 +22,14 @@ #include <libintl.h> #include "dbus.h" +#include "log4c.h" /* @file sflphone_const.h * @brief Contains the global variables for the client code */ /** Locale */ -#define _(STRING) gettext( STRING ) +#define _(STRING) gettext( STRING ) /** Warnings unused variables **/ #define UNUSED_VAR(var) (void*)var @@ -45,6 +46,11 @@ #define ACCOUNT_SIP_STUN_SERVER "STUN.server" #define ACCOUNT_SIP_STUN_ENABLED "STUN.enable" +/** + * Global logger + */ +log4c_category_t* log4c_sfl_gtk_category; + /** Error while opening capture device */ #define ALSA_CAPTURE_DEVICE 0x0001 /** Error while opening playback device */ @@ -52,10 +58,8 @@ /** Error pulseaudio */ #define PULSEAUDIO_NOT_RUNNING 0x0100 - - /** Tone to play when no voice mails */ -#define TONE_WITHOUT_MESSAGE 0 +#define TONE_WITHOUT_MESSAGE 0 /** Tone to play when voice mails */ #define TONE_WITH_MESSAGE 1 /** Tells if the main window is reduced to the system tray or not */ @@ -63,11 +67,11 @@ /** Behaviour of the main window on incoming calls */ #define __POPUP_WINDOW ( dbus_popup_mode() ) /** Show/Hide the dialpad */ -#define SHOW_DIALPAD ( dbus_get_dialpad() ) +#define SHOW_DIALPAD ( dbus_get_dialpad() ) /** Show/Hide the volume controls */ -#define SHOW_VOLUME ( dbus_get_volume_controls() ) +#define SHOW_VOLUME ( dbus_get_volume_controls() ) /** Show/Hide the dialpad */ -#define SHOW_SEARCHBAR ( dbus_get_searchbar() ) +#define SHOW_SEARCHBAR ( dbus_get_searchbar() ) /** Show/Hide the alsa configuration panel */ #define SHOW_ALSA_CONF ( dbus_get_audio_manager() == ALSA ) @@ -81,7 +85,7 @@ #define __NOTIF_LEVEL_HIGH 2 /** Messages ID for the status bar - Incoming calls */ -#define __MSG_INCOMING_CALL 0 +#define __MSG_INCOMING_CALL 0 /** Messages ID for the status bar - Calling */ #define __MSG_CALLING 1 /** Messages ID for the status bar - Voice mails notification */ @@ -94,5 +98,12 @@ /** Desktop notifications - Time before to close the notification*/ #define __TIMEOUT_TIME 18000 // 30 secondes +/** + * Macros for logging + */ +#define DEBUG(...) log4c_category_log(log4c_sfl_gtk_category, LOG4C_PRIORITY_DEBUG, __VA_ARGS__); +#define WARN(...) log4c_category_log(log4c_sfl_gtk_category, LOG4C_PRIORITY_WARN, __VA_ARGS__); +#define ERROR(...) log4c_category_log(log4c_sfl_gtk_category, LOG4C_PRIORITY_ERROR, __VA_ARGS__); +#define FATAL(...) log4c_category_log(log4c_sfl_gtk_category, LOG4C_PRIORITY_FATAL, __VA_ARGS__); #endif diff --git a/sflphone-gtk/src/sliders.c b/sflphone-gtk/src/sliders.c index c6b0cd4ffc8ac1c29eec90dbe045559ee7e80c99..7be47f2f44b76b82e1edb48a1cc426a3e9e33661 100644 --- a/sflphone-gtk/src/sliders.c +++ b/sflphone-gtk/src/sliders.c @@ -1,24 +1,24 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + #include <sliders.h> -#include <dbus.h> +#include <dbus/dbus.h> #include <actions.h> #include <string.h> @@ -44,7 +44,7 @@ enum volume_t { guint toggledConnId[2]; // The button toggled signal connection ID guint movedConnId[2]; // The slider_moved signal connection ID -void +void update_icons (int dev) { float val = gtk_range_get_value(GTK_RANGE(slider[dev])); @@ -63,11 +63,11 @@ update_icons (int dev) } } -void +void slider_moved(GtkRange* range, gchar* device) { gdouble value = gtk_range_get_value(range); - g_print("Volume changed for %s: %f\n ", device, value); + DEBUG("Volume changed for %s: %f ", device, value); dbus_set_volume(device, value); if(strcmp(device, "speaker") == 0) update_icons(SPEAKER); @@ -75,7 +75,7 @@ slider_moved(GtkRange* range, gchar* device) update_icons(MIKE); } -static void +static void mute_cb( GtkWidget *widget, gchar* device ) { int dev; @@ -83,22 +83,22 @@ mute_cb( GtkWidget *widget, gchar* device ) dev = SPEAKER; else dev = MIKE; - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) + + if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { // Save value - g_print("Save"); + DEBUG("Save"); value[dev] = gtk_range_get_value(GTK_RANGE(slider[dev])); dbus_set_volume(device, 0); } - else + else { //Restore value - g_print("Restore"); + DEBUG("Restore"); dbus_set_volume(device, value[dev]); } update_icons (dev); } -void +void set_slider(const gchar * device, gdouble newval) { int dev; @@ -106,29 +106,29 @@ set_slider(const gchar * device, gdouble newval) dev = SPEAKER; else dev = MIKE; - + gtk_signal_handler_block(GTK_OBJECT(slider[dev]), movedConnId[dev]); gtk_range_set_value(GTK_RANGE(slider[dev]), newval); gtk_signal_handler_unblock(slider[dev], movedConnId[dev]); - + gtk_signal_handler_block(GTK_OBJECT(button[dev]),toggledConnId[dev]); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button[dev]), (newval == 0 ? TRUE: FALSE)); gtk_signal_handler_unblock(button[dev], toggledConnId[dev]); - + update_icons (dev); } /** Generates the speaker slider and mute button */ -GtkWidget * +GtkWidget * create_slider(const gchar * device) -{ +{ // Increment the references count for the images // When the image is removed from a button, if the ref count = 0, then it is destroyed // which we don't want ;) - + GtkWidget * ret; int dev=0; - + if(strcmp(device, "speaker") == 0) { dev = SPEAKER; @@ -153,30 +153,30 @@ create_slider(const gchar * device) g_object_ref(images[MIKE][VOL50]); g_object_ref(images[MIKE][VOL75]); } - + ret = gtk_hbox_new ( FALSE /*homogeneous*/, 5 /*spacing*/); - + #if GTK_CHECK_VERSION(2,12,0) - if( strcmp( device , "speaker") == 0 ) + if( strcmp( device , "speaker") == 0 ) gtk_widget_set_tooltip_text( GTK_WIDGET( ret ), _("Speakers volume")); else gtk_widget_set_tooltip_text( GTK_WIDGET( ret ), _("Mic volume")); -#endif +#endif button[dev] = gtk_toggle_button_new(); gtk_box_pack_start (GTK_BOX (ret), button[dev], FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); toggledConnId[dev] = g_signal_connect (G_OBJECT (button[dev]), "toggled", G_CALLBACK (mute_cb), (gpointer)device); - + slider[dev] = gtk_hscale_new_with_range(0, 1, 0.05); gtk_scale_set_draw_value(GTK_SCALE(slider[dev]), FALSE); //gtk_range_set_update_policy(GTK_RANGE(slider), GTK_UPDATE_DELAYED); movedConnId[dev] = g_signal_connect (G_OBJECT (slider[dev]), "value_changed", G_CALLBACK (slider_moved), (gpointer)device); gtk_box_pack_start (GTK_BOX (ret), slider[dev], TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - + set_slider(device, dbus_get_volume(device)); - + return ret; } diff --git a/sflphone-gtk/src/timestamp.c b/sflphone-gtk/src/timestamp.c index ed8510b7d6035050f1de65642049828fb9f4494f..ba364ee5dffcec60d7e9b1e28889db483d0c2976 100644 --- a/sflphone-gtk/src/timestamp.c +++ b/sflphone-gtk/src/timestamp.c @@ -1,17 +1,17 @@ /* * Copyright (C) 2008 Savoir-Faire Linux inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -20,7 +20,7 @@ #include <timestamp.h> - gchar* + gchar* timestamp_get_call_date( void ) { struct tm* ptr; @@ -40,7 +40,7 @@ timestamp_get_call_date( void ) process_call_duration( call_t* c ) { gchar * res; - g_print("Start = %i - Stop = %i - Call duration = %i\n", (int)c->_start , (int)c->_stop , (int)(c->_stop - c->_start)); + DEBUG("Start = %i - Stop = %i - Call duration = %i", (int)c->_start , (int)c->_stop , (int)(c->_stop - c->_start)); if( c->history_state == MISSED && c->_stop == 0 ) return g_markup_printf_escaped(_("<small>Missed call</small>")); diff --git a/sflphone-gtk/src/toolbar.c b/sflphone-gtk/src/toolbar.c new file mode 100644 index 0000000000000000000000000000000000000000..f6a59c73425ce9917b0536c6861f702ddbefa286 --- /dev/null +++ b/sflphone-gtk/src/toolbar.c @@ -0,0 +1,395 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <toolbar.h> +#include <contacts/addressbook.h> + +static gboolean +is_inserted( GtkWidget* button ) +{ + return ( GTK_WIDGET(button)->parent == GTK_WIDGET( toolbar ) ); +} + +/** + * Static rec_button + */ +static void +rec_button( GtkWidget *widget UNUSED, gpointer data UNUSED) +{ + sflphone_rec_call(); +} + +static void +call_mailbox( GtkWidget* widget UNUSED, gpointer data UNUSED) +{ + account_t* current; + call_t *mailbox_call; + gchar *to, *from, *account_id; + + current = account_list_get_current (); + if( current == NULL ) // Should not happens + return; + + to = g_strdup(g_hash_table_lookup(current->properties, ACCOUNT_MAILBOX)); + from = g_markup_printf_escaped(_("\"Voicemail\" <%s>"), to); + account_id = g_strdup (current->accountID); + + create_new_call (to, from, CALL_STATE_DIALING, account_id, &mailbox_call); + DEBUG("TO : %s" , mailbox_call->to); + calllist_add( current_calls , mailbox_call ); + calltree_add_call( current_calls , mailbox_call ); + update_menus(); + sflphone_place_call( mailbox_call ); + calltree_display(current_calls); +} + + /** + * Make a call + */ + static void +call_button( GtkWidget *widget UNUSED, gpointer data UNUSED) +{ + DEBUG("------ call_button -----"); + call_t * selectedCall; + call_t* new_call; + gchar *to, *from; + + selectedCall = calltab_get_selected_call(active_calltree); + + if(calllist_get_size(current_calls)>0) + sflphone_pick_up(); + + else if(calllist_get_size(active_calltree) > 0){ + if( selectedCall) + { + DEBUG("Calling a called num"); + + to = g_strdup(call_get_number(selectedCall)); + from = g_strconcat("\"\" <", call_get_number(selectedCall), ">",NULL); + + create_new_call (to, from, CALL_STATE_DIALING, "", &new_call); + + DEBUG("call : from : %s to %s", new_call->from, new_call->to); + + calllist_add(current_calls, new_call); + calltree_add_call(current_calls, new_call); + sflphone_place_call(new_call); + calltree_display (current_calls); + } + else + { + sflphone_new_call(); + calltree_display(current_calls); + } + } + else + { + sflphone_new_call(); + calltree_display(current_calls); + } +} + +/** + * Hang up the line + */ + static void +hang_up( GtkWidget *widget UNUSED, gpointer data UNUSED) +{ + sflphone_hang_up(); +} + +/** + * Hold the line + */ + static void +hold( GtkWidget *widget UNUSED, gpointer data UNUSED) +{ + sflphone_on_hold(); +} + +/** + * Transfert the line + */ + static void +transfert (GtkToggleToolButton *toggle_tool_button, + gpointer user_data UNUSED ) +{ + gboolean up = gtk_toggle_tool_button_get_active(toggle_tool_button); + if(up) + { + sflphone_set_transfert(); + } + else + { + sflphone_unset_transfert(); + } +} + +/** + * Unhold call + */ + static void +unhold( GtkWidget *widget UNUSED, gpointer data UNUSED) +{ + sflphone_off_hold(); +} + +static void toggle_button_cb (GtkToggleToolButton *widget, gpointer user_data) +{ + calltab_t * to_switch; + gboolean toggle; + + to_switch = (calltab_t*) user_data; + toggle = gtk_toggle_tool_button_get_active (widget); + + (toggle)? calltree_display (to_switch) : calltree_display (current_calls); +} + +GtkWidget *create_toolbar () +{ + GtkWidget *ret; + GtkWidget *image; + + ret = gtk_toolbar_new(); + toolbar = ret; + + gtk_toolbar_set_orientation(GTK_TOOLBAR(ret), GTK_ORIENTATION_HORIZONTAL); + gtk_toolbar_set_style(GTK_TOOLBAR(ret), GTK_TOOLBAR_ICONS); + + image = gtk_image_new_from_file( ICONS_DIR "/call.svg"); + callButton = gtk_tool_button_new (image, _("Place a call")); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(GTK_WIDGET(callButton), _("Place a call")); +#endif + g_signal_connect (G_OBJECT (callButton), "clicked", + G_CALLBACK (call_button), NULL); + gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(callButton), -1); + + image = gtk_image_new_from_file( ICONS_DIR "/accept.svg"); + pickupButton = gtk_tool_button_new(image, _("Pick up")); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(GTK_WIDGET(pickupButton), _("Pick up")); +#endif + gtk_widget_set_state( GTK_WIDGET(pickupButton), GTK_STATE_INSENSITIVE); + g_signal_connect(G_OBJECT (pickupButton), "clicked", + G_CALLBACK (call_button), NULL); + gtk_widget_show_all(GTK_WIDGET(pickupButton)); + + image = gtk_image_new_from_file( ICONS_DIR "/hang_up.svg"); + hangupButton = gtk_tool_button_new (image, _("Hang up")); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(GTK_WIDGET(hangupButton), _("Hang up")); +#endif + gtk_widget_set_state( GTK_WIDGET(hangupButton), GTK_STATE_INSENSITIVE); + g_signal_connect (G_OBJECT (hangupButton), "clicked", + G_CALLBACK (hang_up), NULL); + gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(hangupButton), -1); + + image = gtk_image_new_from_file( ICONS_DIR "/unhold.svg"); + unholdButton = gtk_tool_button_new (image, _("Off Hold")); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(GTK_WIDGET(unholdButton), _("Off Hold")); +#endif + gtk_widget_set_state( GTK_WIDGET(unholdButton), GTK_STATE_INSENSITIVE); + g_signal_connect (G_OBJECT (unholdButton), "clicked", + G_CALLBACK (unhold), NULL); + //gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(unholdButton), -1); + gtk_widget_show_all(GTK_WIDGET(unholdButton)); + + image = gtk_image_new_from_file( ICONS_DIR "/hold.svg"); + holdButton = gtk_tool_button_new (image, _("On Hold")); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(GTK_WIDGET(holdButton), _("On Hold")); +#endif + gtk_widget_set_state( GTK_WIDGET(holdButton), GTK_STATE_INSENSITIVE); + g_signal_connect (G_OBJECT (holdButton), "clicked", + G_CALLBACK (hold), NULL); + gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(holdButton), -1); + + image = gtk_image_new_from_file( ICONS_DIR "/transfert.svg"); + transfertButton = gtk_toggle_tool_button_new (); + gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(transfertButton), image); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(GTK_WIDGET(transfertButton), _("Transfer")); +#endif + gtk_tool_button_set_label(GTK_TOOL_BUTTON(transfertButton), _("Transfer")); + gtk_widget_set_state( GTK_WIDGET(transfertButton), GTK_STATE_INSENSITIVE); + transfertButtonConnId = g_signal_connect (G_OBJECT (transfertButton), "toggled", + G_CALLBACK (transfert), NULL); + gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(transfertButton), -1); + + image = gtk_image_new_from_file( ICONS_DIR "/history2.svg"); + historyButton = gtk_toggle_tool_button_new(); + gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (historyButton), image); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(GTK_WIDGET(historyButton), _("History")); +#endif + gtk_tool_button_set_label (GTK_TOOL_BUTTON (historyButton), _("History")); + g_signal_connect (G_OBJECT (historyButton), "toggled", G_CALLBACK (toggle_button_cb), history); + gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(historyButton), -1); + active_calltree = current_calls; + + image = gtk_image_new_from_file( ICONS_DIR "/addressbook.svg"); + contactButton = gtk_toggle_tool_button_new(); + gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (contactButton), image); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(GTK_WIDGET(contactButton), _("Address book")); +#endif + gtk_tool_button_set_label (GTK_TOOL_BUTTON (contactButton), _("Address book")); + gtk_widget_set_state( GTK_WIDGET(contactButton), GTK_STATE_INSENSITIVE); + g_signal_connect (G_OBJECT (contactButton), "toggled", G_CALLBACK (toggle_button_cb), contacts); + gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(contactButton), -1); + + image = gtk_image_new_from_file( ICONS_DIR "/mailbox.svg"); + mailboxButton = gtk_tool_button_new( image , _("Voicemail")); + gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(mailboxButton), image); + if( account_list_get_size() ==0 ) gtk_widget_set_state( GTK_WIDGET(mailboxButton), GTK_STATE_INSENSITIVE ); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(GTK_WIDGET(mailboxButton), _("Voicemail")); +#endif + g_signal_connect (G_OBJECT (mailboxButton), "clicked", + G_CALLBACK (call_mailbox), NULL); + gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(mailboxButton), -1); + + recButton = gtk_tool_button_new_from_stock (GTK_STOCK_MEDIA_RECORD); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(GTK_WIDGET(recButton), _("Record a call")); +#endif + gtk_widget_set_state( GTK_WIDGET(recButton), GTK_STATE_INSENSITIVE); + g_signal_connect (G_OBJECT (recButton), "clicked", + G_CALLBACK (rec_button), NULL); + gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(recButton), -1); + + + return ret; +} + + void +toolbar_update_buttons () +{ + gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), FALSE); + gtk_widget_set_sensitive( GTK_WIDGET(holdButton), FALSE); + gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), FALSE); + gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton) , FALSE); + gtk_widget_set_sensitive( GTK_WIDGET(unholdButton), FALSE); + gtk_widget_set_sensitive( GTK_WIDGET(recButton), FALSE); + g_object_ref(holdButton); + g_object_ref(unholdButton); + if( is_inserted( GTK_WIDGET(holdButton) ) ) gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(holdButton)); + if( is_inserted( GTK_WIDGET(unholdButton) ) ) gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(unholdButton)); + gtk_toolbar_insert(GTK_TOOLBAR(toolbar), holdButton, 3); + g_object_ref(callButton); + g_object_ref(pickupButton); + if( is_inserted( GTK_WIDGET(callButton) ) ) gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); + if( is_inserted( GTK_WIDGET(pickupButton) ) ) gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(pickupButton)); + gtk_toolbar_insert(GTK_TOOLBAR(toolbar), callButton, 0); + //gtk_toolbar_insert(GTK_TOOLBAR(toolbar), recButton, 0); + + + gtk_signal_handler_block(GTK_OBJECT(transfertButton),transfertButtonConnId); + gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transfertButton), FALSE); + gtk_signal_handler_unblock(transfertButton, transfertButtonConnId); + + call_t * selectedCall = calltab_get_selected_call(active_calltree); + if (selectedCall) + { + switch(selectedCall->state) + { + case CALL_STATE_INCOMING: + gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + g_object_ref(callButton); + gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); + gtk_toolbar_insert(GTK_TOOLBAR(toolbar), pickupButton, 0); + break; + case CALL_STATE_HOLD: + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(unholdButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); + g_object_ref(holdButton); + gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(holdButton)); + gtk_toolbar_insert(GTK_TOOLBAR(toolbar), unholdButton, 3); + break; + case CALL_STATE_RINGING: + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); + break; + case CALL_STATE_DIALING: + if( active_calltree == current_calls ) gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE); + g_object_ref(callButton); + gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); + gtk_toolbar_insert(GTK_TOOLBAR(toolbar), pickupButton, 0); + break; + case CALL_STATE_CURRENT: + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(holdButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(recButton), TRUE); + break; + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + break; + case CALL_STATE_TRANSFERT: + gtk_signal_handler_block(GTK_OBJECT(transfertButton),transfertButtonConnId); + gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transfertButton), TRUE); + gtk_signal_handler_unblock(transfertButton, transfertButtonConnId); + gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(holdButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), TRUE); + break; + case CALL_STATE_RECORD: + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(holdButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(recButton), TRUE); + break; + default: + // Fix bug #1145 + // Actually it could happen when sflphone_fill_account_list() + // call this function and no "call" is selected + // WARN("Toolbar update - Should not happen!"); + break; + } + } + else + { + if( account_list_get_size() > 0 ) + { + gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE ); + gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton), TRUE ); + } + else + { + gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); + } + } + + // Activate addressbook button if needed + // TODO : should be moved in a better place + if(addressbook_is_ready()) + gtk_widget_set_sensitive( GTK_WIDGET(contactButton), TRUE); + else + gtk_widget_set_sensitive( GTK_WIDGET(contactButton), FALSE); +} diff --git a/sflphone-gtk/src/toolbar.h b/sflphone-gtk/src/toolbar.h new file mode 100644 index 0000000000000000000000000000000000000000..bddeb2cb7dee1a0b44ed6b3d0c1c08f7f875203d --- /dev/null +++ b/sflphone-gtk/src/toolbar.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __TOOLBAR_H__ +#define __TOOLBAR_H__ + +#include <call.h> +#include <gtk/gtk.h> +#include <menus.h> +#include <sflphone_const.h> + +GtkWidget * toolbar; +GtkToolItem * pickupButton; +GtkToolItem * callButton; +GtkToolItem * hangupButton; +GtkToolItem * holdButton; +GtkToolItem * transfertButton; +GtkToolItem * unholdButton; +GtkToolItem * mailboxButton; +GtkToolItem * recButton; +GtkToolItem * historyButton; +GtkToolItem * contactButton; +guint transfertButtonConnId; //The button toggled signal connection ID + +/** + * Build the toolbar + * @return GtkWidget* The toolbar + */ +GtkWidget * +create_toolbar(); + +GtkWidget * +create_filter_entry(); + +/** + * Update the toolbar's buttons state, according to the call state + */ +void +toolbar_update_buttons(); + +#endif diff --git a/sflphone-gtk/stamp-h1 b/sflphone-gtk/stamp-h1 deleted file mode 100644 index 4547fe1b5efa99ebbf20e1fa55fdbd528abd3a97..0000000000000000000000000000000000000000 --- a/sflphone-gtk/stamp-h1 +++ /dev/null @@ -1 +0,0 @@ -timestamp for config.h diff --git a/sflphone-gtk/tests/Makefile.am b/sflphone-gtk/tests/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..ce42663bf6971f595866d77434733149554e1ae8 --- /dev/null +++ b/sflphone-gtk/tests/Makefile.am @@ -0,0 +1,51 @@ +include ../globals.mak + +TESTS = check_global check_contacts check_config check_dbus +check_PROGRAMS = check_global check_contacts check_config check_dbus + +SFLPHONE_LIBS = $(top_builddir)/src/contacts/libcontacts.la \ + $(top_builddir)/src/dbus/libdbus.la \ + $(top_builddir)/src/config/libconfig.la + +SFLPHONE_OBJ = $(top_builddir)/src/accountlist.o \ + $(top_builddir)/src/actions.o \ + $(top_builddir)/src/assistant.o \ + $(top_builddir)/src/call.o \ + $(top_builddir)/src/codeclist.o \ + $(top_builddir)/src/dialpad.o \ + $(top_builddir)/src/errors.o \ + $(top_builddir)/src/mainwindow.o \ + $(top_builddir)/src/marshaller.o \ + $(top_builddir)/src/menus.o \ + $(top_builddir)/src/reqaccount.o \ + $(top_builddir)/src/sflnotify.o \ + $(top_builddir)/src/sliders.o \ + $(top_builddir)/src/statusicon.o \ + $(top_builddir)/src/timestamp.o \ + $(top_builddir)/src/toolbar.o + +########################################################### + +check_global_SOURCES = check_global.c +check_global_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@ +check_global_LDADD = @CHECK_LIBS@ + +########################################################### + +check_contacts_SOURCES = check_contacts.c +check_contacts_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@ +check_contacts_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ @DEPS_LIBS@ @LIBSEXY_LIBS@ -llog4c + +########################################################### + +check_config_SOURCES = check_config.c +check_config_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@ +check_config_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ @DEPS_LIBS@ @LIBSEXY_LIBS@ -llog4c + +########################################################### + +check_dbus_SOURCES = check_dbus.c +check_dbus_CFLAGS = @CHECK_CFLAGS@ @DEPS_CFLAGS@ +check_dbus_LDADD = $(SFLPHONE_LIBS) $(SFLPHONE_OBJ) @CHECK_LIBS@ @DEPS_LIBS@ @LIBSEXY_LIBS@ -llog4c + +########################################################### diff --git a/sflphone-gtk/tests/check_config.c b/sflphone-gtk/tests/check_config.c new file mode 100644 index 0000000000000000000000000000000000000000..ae41e1a280ff24bb365fe43a93e064c85b609049 --- /dev/null +++ b/sflphone-gtk/tests/check_config.c @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <check.h> +#include <stdlib.h> + +Suite * +config_suite (void) +{ + Suite *s = suite_create ("Config"); + + return s; +} + +int +main (void) +{ + int number_failed; + Suite *s = config_suite (); + SRunner *sr = srunner_create (s); + srunner_run_all (sr, CK_NORMAL); + number_failed = srunner_ntests_failed (sr); + srunner_free (sr); + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/sflphone-gtk/tests/check_contacts.c b/sflphone-gtk/tests/check_contacts.c new file mode 100644 index 0000000000000000000000000000000000000000..bca0d15777c380652cb30d08000f184b9eb98e29 --- /dev/null +++ b/sflphone-gtk/tests/check_contacts.c @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <check.h> +#include <stdlib.h> +#include "../src/contacts/addressbook/eds.h" +#include "../src/contacts/addressbook.h" + + +void plop() +{ + printf("plop\n"); +} + + +START_TEST (test_eds) +{ + fail_unless (5 == 2,"Error"); +} +END_TEST + +Suite * +contacts_suite (void) +{ + Suite *s = suite_create ("Contacts"); + + TCase *tc_cases = tcase_create ("EDS"); + tcase_add_test (tc_cases, test_eds); + suite_add_tcase (s, tc_cases); + + return s; +} + +int +main (void) +{ + int number_failed; + Suite *s = contacts_suite (); + SRunner *sr = srunner_create (s); + srunner_run_all (sr, CK_NORMAL); + number_failed = srunner_ntests_failed (sr); + srunner_free (sr); + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/src/audio/samplecache.cpp b/sflphone-gtk/tests/check_dbus.c similarity index 59% rename from src/audio/samplecache.cpp rename to sflphone-gtk/tests/check_dbus.c index 7f73642506ed1b71e3b12187847d4e8910b62f9b..67423ee2c29df51bd14749d950450f1b9f02c19f 100644 --- a/src/audio/samplecache.cpp +++ b/sflphone-gtk/tests/check_dbus.c @@ -1,6 +1,6 @@ /* - * Copyright (C) 2008 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 @@ -17,22 +17,25 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <samplecache.h> +#include <check.h> +#include <stdlib.h> -SampleCache::SampleCache( pa_stream* s ):_stream(s) +Suite * +dbus_suite (void) { - //_stream = s ; -} + Suite *s = suite_create ("DBus"); -SampleCache::~SampleCache() -{ - //delete _pulse; + return s; } -bool -SampleCache::uploadSample( SFLDataFormat* buffer UNUSED, size_t size UNUSED ) +int +main (void) { - //pa_stream_write( pulse->caching , buffer , size , pa_xfree, 0 , PA_SEEK_RELATIVE); - //pa_stream_finish_upload( pulse->caching ); - return true; -} + int number_failed; + Suite *s = dbus_suite (); + SRunner *sr = srunner_create (s); + srunner_run_all (sr, CK_NORMAL); + number_failed = srunner_ntests_failed (sr); + srunner_free (sr); + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/sflphone-gtk/tests/check_global.c b/sflphone-gtk/tests/check_global.c new file mode 100644 index 0000000000000000000000000000000000000000..5d64a94e93e5eab9104786d1a2d5bbc6064e63bf --- /dev/null +++ b/sflphone-gtk/tests/check_global.c @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <check.h> +#include <stdlib.h> + +Suite * +global_suite (void) +{ + Suite *s = suite_create ("Global"); + + return s; +} + +int +main (void) +{ + int number_failed; + Suite *s = global_suite (); + SRunner *sr = srunner_create (s); + srunner_run_all (sr, CK_NORMAL); + number_failed = srunner_ntests_failed (sr); + srunner_free (sr); + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/src/Makefile.am b/src/Makefile.am index 9269904f4f05c823b2dd8991663bd5c1ccc43c88..9921e767fe6d5b606eace1d3c5a455001af0c8fa 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,12 +25,13 @@ sflphoned_SOURCES = \ eventthread.cpp \ sipaccount.cpp \ accountcreator.cpp \ - sipvoiplink.cpp \ + sipvoiplink.cpp \ call.cpp \ account.cpp \ sipcall.cpp \ sdp.cpp \ sdpmedia.cpp \ + numbercleaner.cpp \ $(IAXSOURCES) @@ -44,9 +45,7 @@ sflphoned_LDADD = \ ./libsflphone.la \ @CCGNU2_LIBS@ \ @CCEXT2_LIBS@ \ - $(IAX_LIBS) \ $(PJSIP_LIBS) \ - @DBUSCPP_LIBS@ \ @CCRTP_LIBS@ \ @ALSA_LIBS@ \ @PULSEAUDIO_LIBS@ \ @@ -73,17 +72,18 @@ noinst_HEADERS = \ call.h \ sipcall.h \ sdp.h \ - sdpmedia.h + sdpmedia.h \ + numbercleaner.h libsflphone_la_LIBADD = \ $(src)/libs/stund/libstun.la \ $(src)/libs/utilspp/libutilspp.la \ + $(src)/libs/iax2/libiax2.la \ ./audio/libaudio.la \ ./dbus/libdbus.la \ ./config/libconfig.la \ ./plug-in/libplugin.la \ ./plug-in/audiorecorder/libaudiorecorder.la \ - ./hooks/libhooks.la \ - $(IAX_LIBS) + ./hooks/libhooks.la libsflphone_la_SOURCES = diff --git a/src/audio/Makefile.am b/src/audio/Makefile.am index 73659fe66c2bec7b756b3db7049ca65d14f8ef4c..79067631540473b029b45392bb0398950640dcef 100644 --- a/src/audio/Makefile.am +++ b/src/audio/Makefile.am @@ -2,17 +2,6 @@ include $(top_srcdir)/globals.mak noinst_LTLIBRARIES = libaudio.la -if BUILD_SPEEX -SPEEX_FLAG = -DBUILD_SPEEX -else -SPEEX_FLAG = -endif - -if BUILD_GSM -GSM_FLAG = -DBUILD_GSM -else -GSM_FLAG = -endif if BUILD_ILBC ILBC_FLAG = -DBUILD_ILBC @@ -36,7 +25,6 @@ libaudio_la_SOURCES = \ dtmfgenerator.cpp \ tonegenerator.cpp \ codecDescriptor.cpp \ - samplecache.cpp \ audioloop.cpp \ ringbuffer.cpp \ $(SPEEX_SOURCES_CPP) @@ -55,7 +43,6 @@ noinst_HEADERS = \ audiodevice.h \ dtmfgenerator.h \ tonegenerator.h \ - samplecache.h \ codecDescriptor.h \ dtmf.h \ tone.h diff --git a/src/audio/codecDescriptor.cpp b/src/audio/codecDescriptor.cpp index d45d2edc1b06e3857b43cda974ffd140851a917f..1b927cfa1648644e0cf3a584b855979dac222658 100644 --- a/src/audio/codecDescriptor.cpp +++ b/src/audio/codecDescriptor.cpp @@ -277,14 +277,14 @@ CodecDescriptor::seemsValid( std::string lib) return false; -#ifdef HAVE_SPEEX +#ifdef HAVE_SPEEX_CODEC // Nothing special #else if( lib.substr(begin.length() , lib.length() - begin.length() - end.length()) == SPEEX_STRING_DESCRIPTION) return false; #endif -#ifdef HAVE_GSM +#ifdef HAVE_GSM_CODEC // Nothing special #else if( lib.substr(begin.length() , lib.length() - begin.length() - end.length()) == GSM_STRING_DESCRIPTION ) diff --git a/src/audio/codecs/Makefile.am b/src/audio/codecs/Makefile.am index 8c7d4803848e93c0e4f47ee9f40ebfbe4d0dafc5..abdc514293ec94c13c0a5fd93c4eb44583963916 100644 --- a/src/audio/codecs/Makefile.am +++ b/src/audio/codecs/Makefile.am @@ -10,11 +10,11 @@ INSTALL_GSM_RULE = install-libcodec_gsm_so endif if ENABLE_SPEEXDSP -SPEEXDSP= -DHAVE_SPEEXDSP_LIB +SPEEXDSP=-DHAVE_SPEEXDSP_LIB endif if BUILD_SPEEX -SPEEX_LIB = libcodec_speex.so +SPEEX_LIB=libcodec_speex.so libcodec_speex_so_SOURCES = speexcodec.cpp libcodec_speex_so_CFLAGS = -fPIC -g -Wall libcodec_speex_so_CXXFLAGS = -fPIC -g -Wall $(SPEEXDSP) diff --git a/src/audio/pulselayer.cpp b/src/audio/pulselayer.cpp index 6367de5248cf0a467ab168ff206fcacb55442e60..02c107ea976fd5ac17cc30a6363637a894be5ebb 100644 --- a/src/audio/pulselayer.cpp +++ b/src/audio/pulselayer.cpp @@ -222,8 +222,8 @@ void PulseLayer::startStream (void) PulseLayer::stopStream (void) { _debug("PulseLayer::Stop stream\n"); - pa_stream_flush( playback->pulseStream(), NULL, NULL ); - pa_stream_flush( record->pulseStream(), NULL, NULL ); + //pa_stream_flush( playback->pulseStream(), NULL, NULL ); + //pa_stream_flush( record->pulseStream(), NULL, NULL ); flushMic(); diff --git a/src/dbus/Makefile.am b/src/dbus/Makefile.am index 7e97ffc2dcd3771ed31fc020c23e1eb76b3bad0c..0f3a42103870100568840d9e426c0d7c7b7c503d 100644 --- a/src/dbus/Makefile.am +++ b/src/dbus/Makefile.am @@ -12,7 +12,7 @@ libdbus_la_SOURCES = \ libdbus_la_CXXFLAGS = -DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" -libdbus_la_LIBADD = +libdbus_la_LIBADD = $(top_srcdir)/libs/dbus-c++/src/libdbus-c++-1.la noinst_HEADERS = \ callmanager-glue.h \ diff --git a/src/dbus/callmanager.cpp b/src/dbus/callmanager.cpp index 9830253434321f52eddf4fcc3bf584e2ba68cdac..e013410ad59c63693896cd68bb70a40c7fed976c 100644 --- a/src/dbus/callmanager.cpp +++ b/src/dbus/callmanager.cpp @@ -140,11 +140,10 @@ CallManager::getCurrentCodecName(const std::string& callID) std::map< std::string, std::string > -CallManager::getCallDetails( const std::string& callID UNUSED ) +CallManager::getCallDetails( const std::string& callID ) { _debug("CallManager::getCallDetails received\n"); - std::map<std::string, std::string> a; - return a; + return Manager::instance().getCallDetails (callID); } std::string diff --git a/src/dbus/configurationmanager-glue.h b/src/dbus/configurationmanager-glue.h index f70bd67e29d9b41ab2ccdb990632d8f2b2db8277..cca98917e044f6bbf52d71dc507f2f5d6d412d21 100644 --- a/src/dbus/configurationmanager-glue.h +++ b/src/dbus/configurationmanager-glue.h @@ -23,6 +23,7 @@ public: register_method(ConfigurationManager_adaptor, getAccountDetails, _getAccountDetails_stub); register_method(ConfigurationManager_adaptor, setAccountDetails, _setAccountDetails_stub); register_method(ConfigurationManager_adaptor, addAccount, _addAccount_stub); + register_method(ConfigurationManager_adaptor, setAccountsOrder, _setAccountsOrder_stub); register_method(ConfigurationManager_adaptor, removeAccount, _removeAccount_stub); register_method(ConfigurationManager_adaptor, getAccountList, _getAccountList_stub); register_method(ConfigurationManager_adaptor, sendRegister, _sendRegister_stub); @@ -79,6 +80,8 @@ public: register_method(ConfigurationManager_adaptor, isStunEnabled, _isStunEnabled_stub); register_method(ConfigurationManager_adaptor, getAddressbookSettings, _getAddressbookSettings_stub); register_method(ConfigurationManager_adaptor, setAddressbookSettings, _setAddressbookSettings_stub); + register_method(ConfigurationManager_adaptor, getAddressbookList, _getAddressbookList_stub); + register_method(ConfigurationManager_adaptor, setAddressbookList, _setAddressbookList_stub); register_method(ConfigurationManager_adaptor, getHookSettings, _getHookSettings_stub); register_method(ConfigurationManager_adaptor, setHookSettings, _setHookSettings_stub); } @@ -103,6 +106,11 @@ public: { "createdAccountId", "s", false }, { 0, 0, 0 } }; + static ::DBus::IntrospectedArgument setAccountsOrder_args[] = + { + { "order", "s", true }, + { 0, 0, 0 } + }; static ::DBus::IntrospectedArgument removeAccount_args[] = { { "accoundID", "s", true }, @@ -376,6 +384,16 @@ public: { "settings", "a{si}", true }, { 0, 0, 0 } }; + static ::DBus::IntrospectedArgument getAddressbookList_args[] = + { + { "settings", "as", false }, + { 0, 0, 0 } + }; + static ::DBus::IntrospectedArgument setAddressbookList_args[] = + { + { "settings", "as", true }, + { 0, 0, 0 } + }; static ::DBus::IntrospectedArgument getHookSettings_args[] = { { "settings", "a{ss}", false }, @@ -405,6 +423,7 @@ public: { "getAccountDetails", getAccountDetails_args }, { "setAccountDetails", setAccountDetails_args }, { "addAccount", addAccount_args }, + { "setAccountsOrder", setAccountsOrder_args }, { "removeAccount", removeAccount_args }, { "getAccountList", getAccountList_args }, { "sendRegister", sendRegister_args }, @@ -461,6 +480,8 @@ public: { "isStunEnabled", isStunEnabled_args }, { "getAddressbookSettings", getAddressbookSettings_args }, { "setAddressbookSettings", setAddressbookSettings_args }, + { "getAddressbookList", getAddressbookList_args }, + { "setAddressbookList", setAddressbookList_args }, { "getHookSettings", getHookSettings_args }, { "setHookSettings", setHookSettings_args }, { 0, 0 } @@ -499,7 +520,8 @@ public: */ virtual std::map< std::string, std::string > getAccountDetails(const std::string& accountID) = 0; virtual void setAccountDetails(const std::string& accountID, const std::map< std::string, std::string >& details) = 0; - virtual std::string addAccount(const std::map< std::string, std::string >& details) = 0; + virtual void addAccount(const std::map< std::string, std::string >& details) = 0; + virtual void setAccountsOrder(const std::string& order) = 0; virtual void removeAccount(const std::string& accoundID) = 0; virtual std::vector< std::string > getAccountList() = 0; virtual void sendRegister(const std::string& accountID, const int32_t& expire) = 0; @@ -556,6 +578,8 @@ public: virtual int32_t isStunEnabled() = 0; virtual std::map< std::string, int32_t > getAddressbookSettings() = 0; virtual void setAddressbookSettings(const std::map< std::string, int32_t >& settings) = 0; + virtual std::vector< std::string > getAddressbookList() = 0; + virtual void setAddressbookList(const std::vector< std::string >& settings) = 0; virtual std::map< std::string, std::string > getHookSettings() = 0; virtual void setHookSettings(const std::map< std::string, std::string >& settings) = 0; @@ -619,6 +643,15 @@ private: wi << argout1; return reply; } + ::DBus::Message _setAccountsOrder_stub(const ::DBus::CallMessage &call) + { + ::DBus::MessageIter ri = call.reader(); + + std::string argin1; ri >> argin1; + setAccountsOrder(argin1); + ::DBus::ReturnMessage reply(call); + return reply; + } ::DBus::Message _removeAccount_stub(const ::DBus::CallMessage &call) { ::DBus::MessageIter ri = call.reader(); @@ -1149,6 +1182,25 @@ private: ::DBus::ReturnMessage reply(call); return reply; } + ::DBus::Message _getAddressbookList_stub(const ::DBus::CallMessage &call) + { + ::DBus::MessageIter ri = call.reader(); + + std::vector< std::string > argout1 = getAddressbookList(); + ::DBus::ReturnMessage reply(call); + ::DBus::MessageIter wi = reply.writer(); + wi << argout1; + return reply; + } + ::DBus::Message _setAddressbookList_stub(const ::DBus::CallMessage &call) + { + ::DBus::MessageIter ri = call.reader(); + + std::vector< std::string > argin1; ri >> argin1; + setAddressbookList(argin1); + ::DBus::ReturnMessage reply(call); + return reply; + } ::DBus::Message _getHookSettings_stub(const ::DBus::CallMessage &call) { ::DBus::MessageIter ri = call.reader(); diff --git a/src/dbus/configurationmanager-introspec.xml b/src/dbus/configurationmanager-introspec.xml index b133c5e9779d040096effd1f9c071982fff0e435..8e9c4583d77243a7bad6d294eb59edd47ba540c3 100644 --- a/src/dbus/configurationmanager-introspec.xml +++ b/src/dbus/configurationmanager-introspec.xml @@ -21,6 +21,10 @@ <arg type="s" name="createdAccountId" direction="out"/> </method> + <method name="setAccountsOrder"> + <arg type="s" name="order" direction="in"/> + </method> + <method name="removeAccount"> <arg type="s" name="accoundID" direction="in"/> </method> @@ -266,6 +270,15 @@ <arg type="a{si}" name="settings" direction="in"/> </method> + <!-- Addressbook list --> + <method name="getAddressbookList"> + <arg type="as" name="settings" direction="out"/> + </method> + + <method name="setAddressbookList"> + <arg type="as" name="settings" direction="in"/> + </method> + <!-- Hook configuration --> <method name="getHookSettings"> <arg type="a{ss}" name="settings" direction="out"/> diff --git a/src/dbus/configurationmanager.cpp b/src/dbus/configurationmanager.cpp index 7375de66783575dbb6d7e901fc3b8a2072635053..09be9dc26c1fcb5a9beb0d49fe32247478a98a97 100644 --- a/src/dbus/configurationmanager.cpp +++ b/src/dbus/configurationmanager.cpp @@ -3,17 +3,17 @@ * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -33,27 +33,27 @@ const char* ConfigurationManager::SERVER_PATH = "/org/sflphone/SFLphone/Configur { } - std::map< std::string, std::string > + std::map< std::string, std::string > ConfigurationManager::getAccountDetails( const std::string& accountID ) { return Manager::instance().getAccountDetails(accountID); } - void -ConfigurationManager::setAccountDetails( const std::string& accountID, + void +ConfigurationManager::setAccountDetails( const std::string& accountID, const std::map< std::string, std::string >& details ) { _debug("ConfigurationManager::setAccountDetails received\n"); Manager::instance().setAccountDetails(accountID, details); } - void + void ConfigurationManager::sendRegister( const std::string& accountID, const int32_t& expire ) { Manager::instance().sendRegister(accountID, expire); } - std::string + void ConfigurationManager::addAccount( const std::map< std::string, std::string >& details ) { _debug("ConfigurationManager::addAccount received\n"); @@ -61,14 +61,14 @@ ConfigurationManager::addAccount( const std::map< std::string, std::string >& de } - void + void ConfigurationManager::removeAccount( const std::string& accoundID ) { _debug("ConfigurationManager::removeAccount received\n"); return Manager::instance().removeAccount(accoundID); } -std::vector< std::string > +std::vector< std::string > ConfigurationManager::getAccountList( ) { _debug("ConfigurationManager::getAccountList received\n"); @@ -76,7 +76,7 @@ ConfigurationManager::getAccountList( ) } -std::vector< std::string > +std::vector< std::string > ConfigurationManager::getToneLocaleList( ) { std::vector< std::string > ret; @@ -86,7 +86,7 @@ ConfigurationManager::getToneLocaleList( ) - std::string + std::string ConfigurationManager::getVersion( ) { std::string ret(""); @@ -96,7 +96,7 @@ ConfigurationManager::getVersion( ) } - std::vector< std::string > + std::vector< std::string > ConfigurationManager::getRingtoneList( ) { std::vector< std::string > ret; @@ -106,28 +106,26 @@ ConfigurationManager::getRingtoneList( ) - std::vector< std::string > + std::vector< std::string > ConfigurationManager::getCodecList( ) { - _debug("ConfigurationManager::getCodecList received\n"); return Manager::instance().getCodecList(); } - std::vector< std::string > + std::vector< std::string > ConfigurationManager::getCodecDetails( const int32_t& payload ) { - _debug("ConfigurationManager::getCodecList received\n"); return Manager::instance().getCodecDetails( payload ); } - std::vector< std::string > + std::vector< std::string > ConfigurationManager::getActiveCodecList( ) { _debug("ConfigurationManager::getActiveCodecList received\n"); return Manager::instance().getActiveCodecList(); } -void +void ConfigurationManager::setActiveCodecList( const std::vector< std::string >& list ) { _debug("ConfigurationManager::setActiveCodecList received\n"); @@ -200,7 +198,7 @@ ConfigurationManager::getAudioDeviceIndex(const std::string& name) return Manager::instance().getAudioDeviceIndex(name); } -std::string +std::string ConfigurationManager::getCurrentAudioOutputPlugin( void ) { _debug("ConfigurationManager::getCurrentAudioOutputPlugin received\n"); @@ -208,7 +206,7 @@ ConfigurationManager::getCurrentAudioOutputPlugin( void ) } - std::vector< std::string > + std::vector< std::string > ConfigurationManager::getPlaybackDeviceList( ) { std::vector< std::string > ret; @@ -216,7 +214,7 @@ ConfigurationManager::getPlaybackDeviceList( ) return ret; } - std::vector< std::string > + std::vector< std::string > ConfigurationManager::getRecordDeviceList( ) { std::vector< std::string > ret; @@ -228,31 +226,31 @@ ConfigurationManager::getRecordDeviceList( ) int32_t ConfigurationManager::isIax2Enabled( void ) { - return Manager::instance().isIax2Enabled( ); + return Manager::instance().isIax2Enabled( ); } void ConfigurationManager::ringtoneEnabled( void ) { - Manager::instance().ringtoneEnabled( ); + Manager::instance().ringtoneEnabled( ); } int32_t ConfigurationManager::isRingtoneEnabled( void ) { - return Manager::instance().isRingtoneEnabled( ); + return Manager::instance().isRingtoneEnabled( ); } std::string ConfigurationManager::getRingtoneChoice( void ) { - return Manager::instance().getRingtoneChoice( ); + return Manager::instance().getRingtoneChoice( ); } void ConfigurationManager::setRingtoneChoice( const std::string& tone ) { - Manager::instance().setRingtoneChoice( tone ); + Manager::instance().setRingtoneChoice( tone ); } std::string @@ -270,136 +268,136 @@ ConfigurationManager::setRecordPath( const std::string& recPath) int32_t ConfigurationManager::getDialpad( void ) { - return Manager::instance().getDialpad( ); + return Manager::instance().getDialpad( ); } void ConfigurationManager::setDialpad( void ) { - Manager::instance().setDialpad( ); + Manager::instance().setDialpad( ); } int32_t ConfigurationManager::getSearchbar( void ) { - return Manager::instance().getSearchbar( ); + return Manager::instance().getSearchbar( ); } void ConfigurationManager::setSearchbar( void ) { - Manager::instance().setSearchbar( ); + Manager::instance().setSearchbar( ); } int32_t ConfigurationManager::getVolumeControls( void ) { - return Manager::instance().getVolumeControls( ); + return Manager::instance().getVolumeControls( ); } void ConfigurationManager::setVolumeControls( void ) { - Manager::instance().setVolumeControls( ); + Manager::instance().setVolumeControls( ); } int32_t ConfigurationManager::getMaxCalls( void ) { - return Manager::instance().getMaxCalls( ); + return Manager::instance().getMaxCalls( ); } void ConfigurationManager::setMaxCalls( const int32_t& calls ) { - Manager::instance().setMaxCalls( calls ); + Manager::instance().setMaxCalls( calls ); } void ConfigurationManager::startHidden( void ) { - Manager::instance().startHidden( ); + Manager::instance().startHidden( ); } int32_t ConfigurationManager::isStartHidden( void ) { - return Manager::instance().isStartHidden( ); + return Manager::instance().isStartHidden( ); } void ConfigurationManager::switchPopupMode( void ) { - Manager::instance().switchPopupMode( ); + Manager::instance().switchPopupMode( ); } int32_t ConfigurationManager::popupMode( void ) { - return Manager::instance().popupMode( ); + return Manager::instance().popupMode( ); } void ConfigurationManager::setNotify( void ) { _debug("Manager received setNotify\n"); - Manager::instance().setNotify( ); + Manager::instance().setNotify( ); } int32_t ConfigurationManager::getNotify( void ) { _debug("Manager received getNotify\n"); - return Manager::instance().getNotify( ); + return Manager::instance().getNotify( ); } void ConfigurationManager::setAudioManager( const int32_t& api ) { _debug("Manager received setAudioManager\n"); - Manager::instance().setAudioManager( api ); + Manager::instance().setAudioManager( api ); } int32_t ConfigurationManager::getAudioManager( void ) { _debug("Manager received getAudioManager\n"); - return Manager::instance().getAudioManager( ); + return Manager::instance().getAudioManager( ); } void ConfigurationManager::setMailNotify( void ) { _debug("Manager received setMailNotify\n"); - Manager::instance().setMailNotify( ); + Manager::instance().setMailNotify( ); } int32_t ConfigurationManager::getMailNotify( void ) { _debug("Manager received getMailNotify\n"); - return Manager::instance().getMailNotify( ); + return Manager::instance().getMailNotify( ); } -int32_t +int32_t ConfigurationManager::getPulseAppVolumeControl( void ) { return Manager::instance().getPulseAppVolumeControl(); } - -void + +void ConfigurationManager::setPulseAppVolumeControl( void ) { Manager::instance().setPulseAppVolumeControl(); } -int32_t +int32_t ConfigurationManager::getSipPort( void ) { return Manager::instance().getSipPort(); } - -void + +void ConfigurationManager::setSipPort( const int32_t& portNum ) { _debug("Manager received setSipPort: %d\n", portNum); @@ -410,7 +408,7 @@ std::string ConfigurationManager::getStunServer( void ) { return Manager::instance().getStunServer(); } - + void ConfigurationManager::setStunServer( const std::string& server ) { Manager::instance().setStunServer( server ); @@ -434,6 +432,15 @@ void ConfigurationManager::setAddressbookSettings (const std::map<std::string, i Manager::instance().setAddressbookSettings (settings); } +std::vector< std::string > ConfigurationManager::getAddressbookList ( void ) { + return Manager::instance().getAddressbookList(); +} + +void ConfigurationManager::setAddressbookList( const std::vector< std::string >& list ) { + _debug("Manager received setAddressbookList") ; + Manager::instance().setAddressbookList(list); +} + std::map<std::string,std::string> ConfigurationManager::getHookSettings (void) { return Manager::instance().getHookSettings (); } @@ -441,3 +448,8 @@ std::map<std::string,std::string> ConfigurationManager::getHookSettings (void) { void ConfigurationManager::setHookSettings (const std::map<std::string, std::string>& settings) { Manager::instance().setHookSettings (settings); } + +void ConfigurationManager::setAccountsOrder (const std::string& order) { + Manager::instance().setAccountsOrder (order); +} + diff --git a/src/dbus/configurationmanager.h b/src/dbus/configurationmanager.h index f595d7e254db9811dfb433a37ac97dfbff5376bd..70364ca917439a58d1b8a26e18bc5f29a9fc25ef 100644 --- a/src/dbus/configurationmanager.h +++ b/src/dbus/configurationmanager.h @@ -4,29 +4,29 @@ * Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.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 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + #ifndef CONFIGURATIONMANAGER_H #define CONFIGURATIONMANAGER_H #include "configurationmanager-glue.h" #include <dbus-c++/dbus.h> - + class ConfigurationManager : public org::sflphone::SFLphone::ConfigurationManager_adaptor, public DBus::IntrospectableAdaptor, @@ -45,12 +45,12 @@ public: void removeAccount( const std::string& accoundID ); std::vector< std::string > getAccountList( ); void sendRegister( const std::string& accoundID , const int32_t& expire ); - + std::vector< std::string > getCodecList( ); std::vector< std::string > getCodecDetails( const int32_t& payload ); std::vector< std::string > getActiveCodecList( ); void setActiveCodecList( const std::vector< std::string >& list ); - + std::vector< std::string > getInputAudioPluginList(); std::vector< std::string > getOutputAudioPluginList(); void setInputAudioPlugin(const std::string& audioPlugin); @@ -63,14 +63,14 @@ public: int32_t getAudioDeviceIndex(const std::string& name); std::string getCurrentAudioOutputPlugin( void ); - + std::vector< std::string > getToneLocaleList( ); std::vector< std::string > getPlaybackDeviceList( ); std::vector< std::string > getRecordDeviceList( ); std::string getVersion( ); std::vector< std::string > getRingtoneList( ); int32_t getAudioManager( void ); - void setAudioManager( const int32_t& api ); + void setAudioManager( const int32_t& api ); int32_t isIax2Enabled( void ); int32_t isRingtoneEnabled( void ); @@ -106,6 +106,10 @@ public: std::map<std::string, int32_t> getAddressbookSettings (void); void setAddressbookSettings (const std::map<std::string, int32_t>& settings); + std::vector< std::string > getAddressbookList ( void ); + void setAddressbookList( const std::vector< std::string >& list ); + + void setAccountsOrder (const std::string& order); std::map<std::string, std::string> getHookSettings (void); void setHookSettings (const std::map<std::string, std::string>& settings); diff --git a/src/global.h b/src/global.h index 406e2b855b572e5ff5633a39054c115214f73855..56b5e2f43cff576e5462b945327b54339d2822b1 100644 --- a/src/global.h +++ b/src/global.h @@ -32,7 +32,7 @@ #include <map> #include <vector> -#define SFLPHONED_VERSION "0.9.4" /** Version number */ +#define SFLPHONED_VERSION "0.9.5~beta" /** Version number */ #define HOMEDIR (getenv ("HOME")) /** Home directory */ diff --git a/src/hooks/urlhook.cpp b/src/hooks/urlhook.cpp index 3a5e63b3190cf39601f58e1296608f6139c976d2..5ea82be051405b307673a57be22641962c2ed8c9 100644 --- a/src/hooks/urlhook.cpp +++ b/src/hooks/urlhook.cpp @@ -24,7 +24,7 @@ UrlHook::UrlHook () { } UrlHook::~UrlHook () { } -void UrlHook::addAction (std::string field_value, std::string command){ +int UrlHook::addAction (std::string field_value, std::string command){ std::string command_bg; @@ -32,6 +32,9 @@ void UrlHook::addAction (std::string field_value, std::string command){ command_bg = command + " " + field_value + "&" ; /* Execute a system call */ RUN_COMMAND (command_bg.c_str()); + + return 0; + } diff --git a/src/hooks/urlhook.h b/src/hooks/urlhook.h index 77a2d020362b75743cbe96fefa87d69cabd26457..9b3dffb64edce5f3e1642d6bb8c67506439cf8a2 100644 --- a/src/hooks/urlhook.h +++ b/src/hooks/urlhook.h @@ -38,7 +38,7 @@ class UrlHook { */ ~UrlHook (); - void addAction (std::string, std::string); + int addAction (std::string, std::string); private: }; diff --git a/src/iaxcall.h b/src/iaxcall.h index 0a728248c9c114aad21aaaf6306eb080a8a05875..f07c1e0616f82c62a7edf71ed5a7ef46a898bf63 100644 --- a/src/iaxcall.h +++ b/src/iaxcall.h @@ -23,8 +23,8 @@ #include "call.h" #include "audio/codecDescriptor.h" -#include <iax2/iax-client.h> -#include <iax2/frame.h> +#include <iax-client.h> +#include <frame.h> /** * @file: iaxcall.h diff --git a/src/iaxvoiplink.cpp b/src/iaxvoiplink.cpp index af965c32a460679ae66af53c6e763fbe12b494f3..e15f22f50fb472fb49748505ef4921258d41db2e 100644 --- a/src/iaxvoiplink.cpp +++ b/src/iaxvoiplink.cpp @@ -63,6 +63,8 @@ spkrDataConverted = new SFLDataFormat[nbSamplesMax]; spkrDataDecoded = new SFLDataFormat[nbSamplesMax]; + + urlhook = new UrlHook (); } @@ -246,12 +248,13 @@ IAXVoIPLink::sendAudioFromMic(void) int maxBytesToGet, availBytesFromMic, bytesAvail, compSize; AudioCodec *ac; + IAXCall *currentCall; // We have to update the audio layer type in case we switched // TODO Find out a better way to do it updateAudiolayer(); - IAXCall* currentCall = getIAXCall(Manager::instance().getCurrentCallId()); + currentCall = getIAXCall(Manager::instance().getCurrentCallId()); if (!currentCall) { // Let's mind our own business. @@ -317,7 +320,7 @@ IAXVoIPLink::sendAudioFromMic(void) // Send it out! _mutexIAX.enterMutex(); // Make sure the session and the call still exists. - if (currentCall->getSession()) { + if (currentCall->getSession() && micDataEncoded != NULL) { if (iax_send_voice(currentCall->getSession(), currentCall->getFormat(), micDataEncoded, compSize, nbSample_) == -1) { _debug("IAX: Error sending voice data.\n"); } @@ -763,11 +766,14 @@ IAXVoIPLink::iaxHandleCallEvent(iax_event* event, IAXCall* call) break; case IAX_EVENT_URL: + if (Manager::instance().getConfigString (HOOKS, URLHOOK_IAX2_ENABLED) == "1") { + if (strcmp((char*)event->data, "") != 0) { + _debug ("> IAX_EVENT_URL received: %s\n", event->data); + urlhook->addAction ((char*)event->data, Manager::instance().getConfigString (HOOKS, URLHOOK_COMMAND)); + } + } break; - // case IAX_EVENT_CNG: ?? - // break; - case IAX_EVENT_TIMEOUT: break; @@ -1017,3 +1023,4 @@ void IAXVoIPLink::updateAudiolayer( void ) audiolayer = Manager::instance().getAudioDriver(); _mutexIAX.leaveMutex(); } + diff --git a/src/iaxvoiplink.h b/src/iaxvoiplink.h index 2cd4d16357dab62162080f9d7003bd8a759aac6c..38aecaed9f0a9204b17477052cc2437d8209d4fa 100644 --- a/src/iaxvoiplink.h +++ b/src/iaxvoiplink.h @@ -22,11 +22,12 @@ #define IAXVOIPLINK_H #include "voiplink.h" -#include <iax2/iax-client.h> +#include <iax-client.h> #include "global.h" #include "audio/codecDescriptor.h" #include "samplerateconverter.h" +#include "hooks/urlhook.h" class EventThread; class IAXCall; @@ -306,6 +307,9 @@ class IAXVoIPLink : public VoIPLink /** number of sample before conversion (recording) */ int nbSampleForRec_; + + /* URL hook */ + UrlHook *urlhook; }; #endif diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 433390668619f8f9ba8c895f4633d9eaf29d06ae..e6c6c0d6a6d3e4337160a499ce5ab25cae2c1706 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -26,7 +26,7 @@ #include <cstdlib> #include <iostream> #include <fstream> -#include <sstream> +#include <sstream> #include <sys/types.h> // mkdir(2) #include <sys/stat.h> // mkdir(2) @@ -53,7 +53,7 @@ #define fill_config_int(name, value) \ (_config.addConfigTreeItem(section, Conf::ConfigTreeItem(std::string(name), std::string(value), type_int))) -ManagerImpl::ManagerImpl (void) +ManagerImpl::ManagerImpl (void) : _hasTriedToRegister(false) , _config() , _currentCallId2() @@ -82,11 +82,14 @@ ManagerImpl::ManagerImpl (void) , _callAccountMapMutex() , _callConfigMap() , _accountMap() + , _cleaner (NULL) { - + // initialize random generator for call id srand (time(NULL)); + _cleaner = new NumberCleaner (); + #ifdef TEST testAccountMap(); loadAccountMap(); @@ -99,18 +102,19 @@ ManagerImpl::ManagerImpl (void) } // never call if we use only the singleton... -ManagerImpl::~ManagerImpl (void) +ManagerImpl::~ManagerImpl (void) { // terminate(); + delete _cleaner; _cleaner=0; _debug("%s stop correctly.\n", PROGNAME); } - void -ManagerImpl::init() + void +ManagerImpl::init() { // Load accounts, init map loadAccountMap(); - + initVolume(); if (_exist == 0) { @@ -124,7 +128,7 @@ ManagerImpl::init() initAudioCodec(); AudioLayer *audiolayer = getAudioDriver(); - + if (audiolayer != 0) { unsigned int sampleRate = audiolayer->getSampleRate(); @@ -146,7 +150,7 @@ void ManagerImpl::terminate() saveConfig(); unloadAccountMap(); - + _debug("Unload DTMF Key \n"); delete _dtmfKey; @@ -158,7 +162,7 @@ void ManagerImpl::terminate() _debug("Unload Audio Codecs \n"); _codecDescriptorMap.deleteHandlePointer(); - + } bool @@ -175,7 +179,7 @@ ManagerImpl::hasCurrentCall() { return false; } -const CallID& +const CallID& ManagerImpl::getCurrentCallId() { return _currentCallId2; } @@ -190,28 +194,31 @@ ManagerImpl::switchCall(const CallID& id ) { /////////////////////////////////////////////////////////////////////////////// // Management of events' IP-phone user /////////////////////////////////////////////////////////////////////////////// -/* Main Thread */ +/* Main Thread */ bool ManagerImpl::outgoingCall(const std::string& accountid, const CallID& id, const std::string& to) { - std::string pattern; + std::string pattern, to_cleaned; Call::CallConfiguration callConfig; SIPVoIPLink *siplink; - + _debug("ManagerImpl::outgoingCall() method \n"); - // stopTone(false); - // playTone(); + if (getConfigString (HOOKS, PHONE_NUMBER_HOOK_ENABLED) == "1") + _cleaner->set_phone_number_prefix (getConfigString (HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX )); + else + _cleaner->set_phone_number_prefix (""); + to_cleaned = _cleaner->clean (to); /* Check what kind of call we are dealing with */ - check_call_configuration (id, to, &callConfig); - + check_call_configuration (id, to_cleaned, &callConfig); + if (callConfig == Call::IPtoIP) { _debug ("Start IP to IP call\n"); /* We need to retrieve the sip voiplink instance */ - siplink = SIPVoIPLink::instance(""); - if (siplink->new_ip_to_ip_call (id, to)) { + siplink = SIPVoIPLink::instance(""); + if (siplink->new_ip_to_ip_call (id, to_cleaned)) { switchCall (id); return true; } @@ -219,26 +226,26 @@ ManagerImpl::outgoingCall(const std::string& accountid, const CallID& id, const callFailure (id); } return false; - } + } if (!accountExists(accountid)) { _debug("! Manager Error: Outgoing Call: account doesn't exist\n"); return false; } - + if (getAccountFromCall(id) != AccountNULL) { _debug("! Manager Error: Outgoing Call: call id already exists\n"); return false; } - + if (hasCurrentCall()) { _debug("* Manager Info: there is currently a call, try to hold it\n"); onHoldCall(getCurrentCallId()); } - + _debug("- Manager Action: Adding Outgoing Call %s on account %s\n", id.data(), accountid.data()); associateCallToAccount( id, accountid ); - if ( getAccountLink(accountid)->newOutgoingCall(id, to) ) { + if ( getAccountLink(accountid)->newOutgoingCall(id, to_cleaned) ) { switchCall(id); return true; } else { @@ -263,21 +270,20 @@ ManagerImpl::answerCall(const CallID& id) if (currentcall->getState() == 1) isActive = true; - // stopTone(false); + // stopTone(false); _debug("Try to answer call: %s\n", id.data()); AccountID accountid = getAccountFromCall( id ); if (accountid == AccountNULL) { _debug("Answering Call: Call doesn't exists\n"); - return false; + //return false; } - + // if (id != getCurrentCallId()) { - if (isActive) { + if (isActive) { _debug("* Manager Info: there is currently a call, try to hold it\n"); onHoldCall(getCurrentCallId()); } - if (!getAccountLink(accountid)->answer(id)) { // error when receiving... @@ -289,7 +295,7 @@ ManagerImpl::answerCall(const CallID& id) if (_dbus) _dbus->getCallManager()->callStateChanged(id, "CURRENT"); removeWaitingCall(id); switchCall(id); - + // std::string codecName = getCurrentCodecName(id); // _debug("ManagerImpl::hangupCall(): broadcast codec name %s \n",codecName.c_str()); // if (_dbus) _dbus->getCallManager()->currentSelectedCodec(id,codecName.c_str()); @@ -310,14 +316,14 @@ ManagerImpl::hangupCall(const CallID& id) /* Broadcast a signal over DBus */ if (_dbus) _dbus->getCallManager()->callStateChanged(id, "HUNGUP"); - + /* Direct IP to IP call */ if (getConfigFromCall (id) == Call::IPtoIP) { - returnValue = SIPVoIPLink::instance (AccountNULL)->hangup (id); + returnValue = SIPVoIPLink::instance (AccountNULL)->hangup (id); } /* Classic call, attached to an account */ - else { + else { accountid = getAccountFromCall( id ); if (accountid == AccountNULL) { _debug("! Manager Hangup Call: Call doesn't exists\n"); @@ -333,7 +339,7 @@ ManagerImpl::hangupCall(const CallID& id) pulselayer = dynamic_cast<PulseLayer *> (getAudioDriver()); if(pulselayer) pulselayer->restorePulseAppsVolume(); } - + return returnValue; } @@ -348,11 +354,11 @@ ManagerImpl::cancelCall (const CallID& id) /* Direct IP to IP call */ if (getConfigFromCall (id) == Call::IPtoIP) { - returnValue = SIPVoIPLink::instance (AccountNULL)->cancel (id); + returnValue = SIPVoIPLink::instance (AccountNULL)->cancel (id); } /* Classic call, attached to an account */ - else { + else { accountid = getAccountFromCall( id ); if (accountid == AccountNULL) { _debug("! Manager Cancel Call: Call doesn't exists\n"); @@ -361,7 +367,7 @@ ManagerImpl::cancelCall (const CallID& id) returnValue = getAccountLink(accountid)->cancel(id); removeCallAccount(id); } - + // it could be a waiting call? removeWaitingCall(id); switchCall(""); @@ -383,11 +389,11 @@ ManagerImpl::onHoldCall(const CallID& id) /* Direct IP to IP call */ if (getConfigFromCall (id) == Call::IPtoIP) { - returnValue = SIPVoIPLink::instance (AccountNULL)-> onhold (id); + returnValue = SIPVoIPLink::instance (AccountNULL)-> onhold (id); } /* Classic call, attached to an account */ - else { + else { accountid = getAccountFromCall( id ); if (accountid == AccountNULL) { _debug("Manager On Hold Call: Account ID %s or callid %s doesn't exists\n", accountid.c_str(), id.c_str()); @@ -398,7 +404,7 @@ ManagerImpl::onHoldCall(const CallID& id) removeWaitingCall(id); switchCall(""); - + if (_dbus) _dbus->getCallManager()->callStateChanged(call_id, "HOLD"); return returnValue; @@ -408,7 +414,7 @@ ManagerImpl::onHoldCall(const CallID& id) bool ManagerImpl::offHoldCall(const CallID& id) { - + AccountID accountid; bool returnValue, rec; std::string codecName; @@ -418,8 +424,8 @@ ManagerImpl::offHoldCall(const CallID& id) call_id = id; //Place current call on hold if it isn't - if (hasCurrentCall()) - { + if (hasCurrentCall()) + { _debug ("Put the current call (ID=%s) on hold\n", getCurrentCallId().c_str()); onHoldCall(getCurrentCallId()); } @@ -427,11 +433,11 @@ ManagerImpl::offHoldCall(const CallID& id) /* Direct IP to IP call */ if (getConfigFromCall (id) == Call::IPtoIP) { rec = SIPVoIPLink::instance (AccountNULL)-> isRecording (id); - returnValue = SIPVoIPLink::instance (AccountNULL)-> offhold (id); + returnValue = SIPVoIPLink::instance (AccountNULL)-> offhold (id); } /* Classic call, attached to an account */ - else { + else { accountid = getAccountFromCall( id ); if (accountid == AccountNULL) { _debug("Manager OffHold Call: Call doesn't exists\n"); @@ -442,17 +448,15 @@ ManagerImpl::offHoldCall(const CallID& id) returnValue = getAccountLink(accountid)->offhold(id); } - if (_dbus){ - - //_dbus->getCallManager()->callStateChanged(id, "CURRENT"); + if (_dbus){ if (rec) _dbus->getCallManager()->callStateChanged(call_id, "UNHOLD_RECORD"); - else + else _dbus->getCallManager()->callStateChanged(call_id, "UNHOLD_CURRENT"); } - + switchCall(id); codecName = getCurrentCodecName(id); @@ -468,16 +472,16 @@ ManagerImpl::transferCall(const CallID& id, const std::string& to) { AccountID accountid; bool returnValue; - + stopTone(true); - + /* Direct IP to IP call */ if (getConfigFromCall (id) == Call::IPtoIP) { - returnValue = SIPVoIPLink::instance (AccountNULL)-> transfer (id, to); + returnValue = SIPVoIPLink::instance (AccountNULL)-> transfer (id, to); } /* Classic call, attached to an account */ - else { + else { accountid = getAccountFromCall( id ); if (accountid == AccountNULL) { _debug("! Manager Transfer Call: Call doesn't exists\n"); @@ -486,10 +490,10 @@ ManagerImpl::transferCall(const CallID& id, const std::string& to) returnValue = getAccountLink(accountid)->transfer(id, to); removeCallAccount(id); } - + removeWaitingCall(id); switchCall(""); - + if (_dbus) _dbus->getCallManager()->callStateChanged(id, "HUNGUP"); return returnValue; } @@ -500,16 +504,16 @@ ManagerImpl::refuseCall (const CallID& id) { AccountID accountid; bool returnValue; - + stopTone(true); /* Direct IP to IP call */ if (getConfigFromCall (id) == Call::IPtoIP) { - returnValue = SIPVoIPLink::instance (AccountNULL)-> refuse (id); + returnValue = SIPVoIPLink::instance (AccountNULL)-> refuse (id); } /* Classic call, attached to an account */ - else { + else { accountid = getAccountFromCall( id ); if (accountid == AccountNULL) { _debug("! Manager OffHold Call: Call doesn't exists\n"); @@ -517,8 +521,8 @@ ManagerImpl::refuseCall (const CallID& id) } returnValue = getAccountLink(accountid)->refuse(id); removeCallAccount(id); - } - + } + // if the call was outgoing or established, we didn't refuse it // so the method did nothing if (returnValue) { @@ -542,10 +546,10 @@ ManagerImpl::saveConfig (void) } //THREAD=Main - int -ManagerImpl::initRegisterAccounts() + int +ManagerImpl::initRegisterAccounts() { - int status; + int status; bool flag = true; AccountMap::iterator iter; @@ -570,13 +574,13 @@ ManagerImpl::initRegisterAccounts() // calls the client notification here in case of errors at startup... if( _audiodriver -> getErrorMessage() != -1 ) notifyErrClient( _audiodriver -> getErrorMessage() ); - + ASSERT( flag, true ); return SUCCESS; } //THREAD=Main - bool + bool ManagerImpl::sendDtmf(const CallID& id, char code) { AccountID accountid = getAccountFromCall( id ); @@ -612,11 +616,11 @@ ManagerImpl::playDtmf(char code, bool isTalking) bool ret = false; AudioLayer *audiolayer; SFLDataFormat *buf; - + stopTone(false); - + hasToPlayTone = getConfigInt(SIGNALISATION, PLAY_DTMF); - if (!hasToPlayTone) + if (!hasToPlayTone) return false; // length in milliseconds @@ -634,7 +638,7 @@ ManagerImpl::playDtmf(char code, bool isTalking) return false; // number of data sampling in one pulselen depends on samplerate - // size (n sampling) = time_ms * sampling/s + // size (n sampling) = time_ms * sampling/s // --------------------- // ms/s size = (int)(pulselen * ((float)audiolayer->getSampleRate()/1000)); @@ -648,7 +652,7 @@ ManagerImpl::playDtmf(char code, bool isTalking) // copy the sound if ( _dtmfKey->generateDTMF(buf, size) ) { - // Put buffer to urgentRingBuffer + // Put buffer to urgentRingBuffer // put the size in bytes... // so size * 1 channel (mono) * sizeof (bytes for the data) audiolayer->startStream(); @@ -659,11 +663,11 @@ ManagerImpl::playDtmf(char code, bool isTalking) // TODO Cache the DTMF delete[] buf; buf = 0; - + return ret; } -// Multi-thread +// Multi-thread bool ManagerImpl::incomingCallWaiting() { return (_nbIncomingWaitingCall > 0) ? true : false; @@ -695,30 +699,33 @@ ManagerImpl::isWaitingCall(const CallID& id) { } /////////////////////////////////////////////////////////////////////////////// -// Management of event peer IP-phone +// Management of event peer IP-phone //////////////////////////////////////////////////////////////////////////////// -// SipEvent Thread -bool -ManagerImpl::incomingCall(Call* call, const AccountID& accountId) +// SipEvent Thread +bool +ManagerImpl::incomingCall(Call* call, const AccountID& accountId) { PulseLayer *pulselayer; std::string from, number; stopTone(true); - _debug("Incoming call %s\n", call->getCallId().data()); + _debug("Incoming call %s for account %s\n", call->getCallId().data(), accountId.c_str()); associateCallToAccount(call->getCallId(), accountId); + if (accountId==AccountNULL) + associateConfigToCall (call->getCallId(), Call::IPtoIP); + _debug("ManagerImpl::incomingCall :: hasCurrentCall() %i \n",hasCurrentCall()); if ( !hasCurrentCall() ) { call->setConnectionState(Call::Ringing); ringtone(); switchCall(call->getCallId()); - + } - /* + /* else { addWaitingCall(call->getCallId()); } @@ -747,18 +754,18 @@ ManagerImpl::incomingCall(Call* call, const AccountID& accountId) ++iter; } */ - + /* Broadcast a signal over DBus */ if (_dbus) _dbus->getCallManager()->incomingCall(accountId, call->getCallId(), from); //if (_dbus) _dbus->getCallManager()->callStateChanged(call->getCallId(), "INCOMING"); - + // Reduce volume of the other pulseaudio-connected audio applications if( _audiodriver->getLayerType() == PULSEAUDIO && getConfigInt( PREFERENCES , CONFIG_PA_VOLUME_CTRL ) ) { pulselayer = dynamic_cast<PulseLayer *> (getAudioDriver()); if(pulselayer) pulselayer->reducePulseAppsVolume(); } - + return true; } @@ -777,9 +784,9 @@ ManagerImpl::peerAnsweredCall(const CallID& id) if (isCurrentCall(id)) { stopTone(false); } - + if (_dbus) _dbus->getCallManager()->callStateChanged(id, "CURRENT"); - + std::string codecName = getCurrentCodecName(id); // _debug("ManagerImpl::hangupCall(): broadcast codec name %s \n",codecName.c_str()); if (_dbus) _dbus->getCallManager()->currentSelectedCodec(id,codecName.c_str()); @@ -808,10 +815,10 @@ ManagerImpl::peerHungupCall(const CallID& id) _debug("peerHungupCall: Call doesn't exists\n"); return; } - + /* Broadcast a signal over DBus */ if (_dbus) _dbus->getCallManager()->callStateChanged(id, "HUNGUP"); - + if (isCurrentCall(id)) { stopTone(true); switchCall(""); @@ -821,7 +828,7 @@ ManagerImpl::peerHungupCall(const CallID& id) removeWaitingCall(id); removeCallAccount(id); - + if( _audiodriver->getLayerType() == PULSEAUDIO && getConfigInt( PREFERENCES , CONFIG_PA_VOLUME_CTRL ) ) { pulselayer = dynamic_cast<PulseLayer *> (getAudioDriver()); if(pulselayer) pulselayer->restorePulseAppsVolume(); @@ -844,7 +851,7 @@ ManagerImpl::callBusy(const CallID& id) { //THREAD=VoIP void -ManagerImpl::callFailure(const CallID& id) +ManagerImpl::callFailure(const CallID& id) { if (_dbus) _dbus->getCallManager()->callStateChanged(id, "FAILURE"); _debug("CALL ID = %s\n" , id.c_str()); @@ -868,14 +875,12 @@ void ManagerImpl::connectionStatusNotification( ) { if (_dbus) _dbus->getConfigurationManager()->accountsChanged(); - else - _debug("Error: DBus connection not found\n"); } /** * Multi Thread */ -bool ManagerImpl::playATone(Tone::TONEID toneId) +bool ManagerImpl::playATone(Tone::TONEID toneId) { int hasToPlayTone; AudioLoop *audioloop; @@ -883,11 +888,11 @@ bool ManagerImpl::playATone(Tone::TONEID toneId) unsigned int nbSamples; hasToPlayTone = getConfigInt(SIGNALISATION, PLAY_TONES); - if (!hasToPlayTone) + if (!hasToPlayTone) return false; - + audiolayer = getAudioDriver(); - + if (_telephoneTone != 0) { _toneMutex.enterMutex(); _telephoneTone->setCurrentTone(toneId); @@ -896,10 +901,10 @@ bool ManagerImpl::playATone(Tone::TONEID toneId) audioloop = getTelephoneTone(); nbSamples = audioloop->getSize(); SFLDataFormat buf[nbSamples]; - - if ( audiolayer ){ + + if ( audiolayer ){ audiolayer->putUrgent( buf, nbSamples ); - } else + } else return false; } return true; @@ -914,7 +919,7 @@ void ManagerImpl::stopTone (bool stopAudio=true) AudioLayer *audiolayer; hasToPlayTone = getConfigInt(SIGNALISATION, PLAY_TONES); - if (!hasToPlayTone) + if (!hasToPlayTone) return; if (stopAudio) { @@ -974,7 +979,7 @@ ManagerImpl::ringback () { * Multi Thread */ void -ManagerImpl::ringtone() +ManagerImpl::ringtone() { std::string ringchoice; AudioLayer *audiolayer; @@ -988,12 +993,12 @@ ManagerImpl::ringtone() { //TODO Comment this because it makes the daemon crashes since the main thread //synchronizes the ringtone thread. - + ringchoice = getConfigString(AUDIO, RING_CHOICE); //if there is no / inside the path if ( ringchoice.find(DIR_SEPARATOR_CH) == std::string::npos ) { // check inside global share directory - ringchoice = std::string(PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + DIR_SEPARATOR_STR + ringchoice; + ringchoice = std::string(PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + DIR_SEPARATOR_STR + ringchoice; } audiolayer = getAudioDriver(); @@ -1005,18 +1010,18 @@ ManagerImpl::ringtone() samplerate = audiolayer->getSampleRate(); codecForTone = _codecDescriptorMap.getFirstCodecAvailable(); - _toneMutex.enterMutex(); + _toneMutex.enterMutex(); loadFile = _audiofile.loadFile(ringchoice, codecForTone , samplerate); - _toneMutex.leaveMutex(); + _toneMutex.leaveMutex(); if (loadFile) { - - _toneMutex.enterMutex(); + + _toneMutex.enterMutex(); _audiofile.start(); - _toneMutex.leaveMutex(); + _toneMutex.leaveMutex(); if(CHECK_INTERFACE( layer, ALSA )){ //ringback(); - + } else{ audiolayer->startStream(); @@ -1024,7 +1029,7 @@ ManagerImpl::ringtone() } else { ringback(); } - + } else { @@ -1055,7 +1060,7 @@ ManagerImpl::getTelephoneFile() } } -void ManagerImpl::notificationIncomingCall(void) +void ManagerImpl::notificationIncomingCall(void) { AudioLayer *audiolayer; std::ostringstream frequency; @@ -1078,7 +1083,7 @@ void ManagerImpl::notificationIncomingCall(void) * Multi Thread */ bool -ManagerImpl::getStunInfo (StunAddress4& stunSvrAddr, int port) +ManagerImpl::getStunInfo (StunAddress4& stunSvrAddr, int port) { StunAddress4 mappedAddr; struct in_addr in; @@ -1153,7 +1158,7 @@ ManagerImpl::createSettingsPath (void) { * Initialization: Main Thread */ void -ManagerImpl::initConfigFile ( bool load_user_value ) +ManagerImpl::initConfigFile ( bool load_user_value ) { std::string mes = gettext("Init config file\n"); _debug("%s",mes.c_str()); @@ -1179,7 +1184,7 @@ ManagerImpl::initConfigFile ( bool load_user_value ) fill_config_int(ALSA_CARD_ID_OUT, ALSA_DFT_CARD); fill_config_int(ALSA_SAMPLE_RATE, DFT_SAMPLE_RATE); fill_config_int(ALSA_FRAME_SIZE, DFT_FRAME_SIZE); - fill_config_str(ALSA_PLUGIN, PCM_DEFAULT); + fill_config_str(ALSA_PLUGIN, PCM_DEFAULT); fill_config_str(RING_CHOICE, DFT_RINGTONE); fill_config_int(VOLUME_SPKR, DFT_VOL_SPKR_STR); fill_config_int(VOLUME_MICRO, DFT_VOL_MICRO_STR); @@ -1201,6 +1206,7 @@ ManagerImpl::initConfigFile ( bool load_user_value ) fill_config_int(CONFIG_AUDIO , DFT_AUDIO_MANAGER); fill_config_int(CONFIG_PA_VOLUME_CTRL , YES_STR); fill_config_int(CONFIG_SIP_PORT, DFT_SIP_PORT); + fill_config_str(CONFIG_ACCOUNTS_ORDER, ""); section = ADDRESSBOOK; fill_config_int (ADDRESSBOOK_MAX_RESULTS, "25"); @@ -1213,6 +1219,9 @@ ManagerImpl::initConfigFile ( bool load_user_value ) fill_config_str (URLHOOK_SIP_FIELD, HOOK_DEFAULT_SIP_FIELD); fill_config_str (URLHOOK_COMMAND, HOOK_DEFAULT_URL_COMMAND); fill_config_str (URLHOOK_SIP_ENABLED, NO_STR); + fill_config_str (URLHOOK_IAX2_ENABLED, NO_STR); + fill_config_str (PHONE_NUMBER_HOOK_ENABLED, NO_STR); + fill_config_str (PHONE_NUMBER_HOOK_ADD_PREFIX, ""); // Loads config from ~/.sflphone/sflphonedrc or so.. if (createSettingsPath() == 1 && load_user_value) { @@ -1237,38 +1246,45 @@ ManagerImpl::initAudioCodec (void) } // else retrieve the one set in the user config file else{ - std::vector<std::string> active_list = retrieveActiveCodecs(); + std::vector<std::string> active_list = retrieveActiveCodecs(); setActiveCodecList(active_list); } } -std::vector<std::string> + + void +ManagerImpl::setActiveCodecList(const std::vector< std::string >& list) +{ + _debug("Set active codecs list\n"); + _codecDescriptorMap.saveActiveCodecs(list); + // setConfig + std::string s = serialize(list); + printf("%s\n", s.c_str()); + setConfig("Audio", "ActiveCodecs", s); +} + + std::vector<std::string> ManagerImpl::retrieveActiveCodecs() { - std::vector<std::string> order; - std::string temp; std::string s = getConfigString(AUDIO, "ActiveCodecs"); + return unserialize(s); +} + + std::vector<std::string> +ManagerImpl::unserialize(std::string s) { + + std::vector<std::string> list; + std::string temp; while (s.find("/", 0) != std::string::npos) { size_t pos = s.find("/", 0); temp = s.substr(0, pos); s.erase(0, pos + 1); - order.push_back(temp); + list.push_back(temp); } - return order; -} - - void -ManagerImpl::setActiveCodecList(const std::vector< std::string >& list) -{ - _debug("Set active codecs list\n"); - _codecDescriptorMap.saveActiveCodecs(list); - // setConfig - std::string s = serialize(list); - printf("%s\n", s.c_str()); - setConfig("Audio", "ActiveCodecs", s); + return list; } std::string @@ -1314,7 +1330,7 @@ ManagerImpl::getCodecList( void ) //CodecMap codecs = _codecDescriptorMap.getCodecMap(); CodecsMap codecs = _codecDescriptorMap.getCodecsMap(); CodecOrder order = _codecDescriptorMap.getActiveCodecs(); - CodecsMap::iterator iter = codecs.begin(); + CodecsMap::iterator iter = codecs.begin(); while(iter!=codecs.end()) { @@ -1338,7 +1354,7 @@ ManagerImpl::getCodecDetails( const int32_t& payload ) v.push_back(_codecDescriptorMap.getCodecName((AudioCodecType)payload)); ss << _codecDescriptorMap.getSampleRate((AudioCodecType)payload); - v.push_back((ss.str()).data()); + v.push_back((ss.str()).data()); ss.str(""); ss << _codecDescriptorMap.getBitRate((AudioCodecType)payload); v.push_back((ss.str()).data()); @@ -1458,17 +1474,17 @@ ManagerImpl::setAudioOutputDevice(const int index) AlsaLayer *alsalayer; std::string alsaplugin; _debug("Set audio output device: %i\n", index); - + _audiodriver -> setErrorMessage( -1 ); - + alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver ()); alsaplugin = alsalayer->getAudioPlugin (); _audiodriver->openDevice(_audiodriver->getIndexIn(), index, _audiodriver->getSampleRate(), _audiodriver->getFrameSize(), SFL_PCM_PLAYBACK, alsaplugin ); - + if( _audiodriver -> getErrorMessage() != -1) notifyErrClient( _audiodriver -> getErrorMessage() ); - + // set config setConfig( AUDIO , ALSA_CARD_ID_OUT , index ); } @@ -1494,19 +1510,19 @@ ManagerImpl::setAudioInputDevice(const int index) { AlsaLayer *alsalayer; std::string alsaplugin; - + _debug("Set audio input device %i\n", index); - + _audiodriver -> setErrorMessage( -1 ); - + alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver ()); alsaplugin = alsalayer->getAudioPlugin (); - + _audiodriver->openDevice(index, _audiodriver->getIndexOut(), _audiodriver->getSampleRate(), _audiodriver->getFrameSize(), SFL_PCM_CAPTURE, alsaplugin ); if( _audiodriver -> getErrorMessage() != -1) notifyErrClient( _audiodriver -> getErrorMessage() ); - + // set config setConfig( AUDIO , ALSA_CARD_ID_IN , index ); } @@ -1527,7 +1543,7 @@ ManagerImpl::getCurrentAudioDevicesIndex() return v; } - int + int ManagerImpl::isIax2Enabled( void ) { //return ( IAX2_ENABLED ) ? true : false; @@ -1559,13 +1575,13 @@ ManagerImpl::getRingtoneChoice( void ) if( tone_name.find( DIR_SEPARATOR_CH ) == std::string::npos ) { // check in ringtone directory ($(PREFIX)/share/sflphone/ringtones) - tone_path = std::string(PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + DIR_SEPARATOR_STR + tone_name ; + tone_path = std::string(PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + DIR_SEPARATOR_STR + tone_name ; } else { // the absolute has been saved; do nothing tone_path = tone_name ; - } + } _debug("%s\n", tone_path.c_str()); return tone_path; } @@ -1573,8 +1589,8 @@ ManagerImpl::getRingtoneChoice( void ) void ManagerImpl::setRingtoneChoice( const std::string& tone ) { - // we save the absolute path - setConfig( AUDIO , RING_CHOICE , tone ); + // we save the absolute path + setConfig( AUDIO , RING_CHOICE , tone ); } std::string @@ -1583,7 +1599,7 @@ ManagerImpl::getRecordPath( void ) return getConfigString( AUDIO, RECORD_PATH ); } -void +void ManagerImpl::setRecordPath( const std::string& recPath) { setConfig( AUDIO, RECORD_PATH, recPath.substr(7)); @@ -1622,7 +1638,7 @@ void ManagerImpl::enableStun (void) ( getConfigInt( SIGNALISATION , STUN_ENABLE ) == STUN_ENABLED )? setConfig(SIGNALISATION , STUN_ENABLE , NO_STR ) : setConfig( SIGNALISATION , STUN_ENABLE , YES_STR ); /* Restart PJSIP */ - this->restartPJSIP (); + this->restartPJSIP (); } @@ -1656,19 +1672,19 @@ ManagerImpl::isRecording(const CallID& id) return getAccountLink(accountid)->isRecording(id); } -void +void ManagerImpl::startHidden( void ) { ( getConfigInt( PREFERENCES , CONFIG_START ) == START_HIDDEN)? setConfig(PREFERENCES , CONFIG_START , NO_STR ) : setConfig( PREFERENCES , CONFIG_START , YES_STR ); } -int +int ManagerImpl::isStartHidden( void ) { return getConfigInt( PREFERENCES , CONFIG_START ); } -void +void ManagerImpl::switchPopupMode( void ) { ( getConfigInt( PREFERENCES , CONFIG_POPUP ) == WINDOW_POPUP)? setConfig(PREFERENCES , CONFIG_POPUP , NO_STR ) : setConfig( PREFERENCES , CONFIG_POPUP , YES_STR ); @@ -1699,7 +1715,7 @@ ManagerImpl::setSearchbar( void ) ( getConfigInt( PREFERENCES , CONFIG_SEARCHBAR ) == 1)? setConfig(PREFERENCES , CONFIG_SEARCHBAR , NO_STR ) : setConfig( PREFERENCES , CONFIG_SEARCHBAR , YES_STR ); } -int +int ManagerImpl::popupMode( void ) { return getConfigInt( PREFERENCES , CONFIG_POPUP ); @@ -1714,7 +1730,7 @@ ManagerImpl::getNotify( void ) void ManagerImpl::setNotify( void ) { - ( getConfigInt( PREFERENCES , CONFIG_NOTIFY ) == NOTIFY_ALL )? setConfig( PREFERENCES , CONFIG_NOTIFY , NO_STR ) : setConfig( PREFERENCES , CONFIG_NOTIFY , YES_STR ); + ( getConfigInt( PREFERENCES , CONFIG_NOTIFY ) == NOTIFY_ALL )? setConfig( PREFERENCES , CONFIG_NOTIFY , NO_STR ) : setConfig( PREFERENCES , CONFIG_NOTIFY , YES_STR ); } int32_t @@ -1772,7 +1788,7 @@ void ManagerImpl::setAudioManager( const int32_t& api ) notifyErrClient(PULSEAUDIO_NOT_RUNNING); } } - + if(manager == api) { // it means that we can change the audio manager @@ -1798,14 +1814,14 @@ ManagerImpl::getRegistrationExpireValue( void) void ManagerImpl::setMailNotify( void ) { - ( getConfigInt( PREFERENCES , CONFIG_MAIL_NOTIFY ) == NOTIFY_ALL )? setConfig( PREFERENCES , CONFIG_MAIL_NOTIFY , NO_STR ) : setConfig( PREFERENCES , CONFIG_MAIL_NOTIFY , YES_STR ); + ( getConfigInt( PREFERENCES , CONFIG_MAIL_NOTIFY ) == NOTIFY_ALL )? setConfig( PREFERENCES , CONFIG_MAIL_NOTIFY , NO_STR ) : setConfig( PREFERENCES , CONFIG_MAIL_NOTIFY , YES_STR ); } void ManagerImpl::notifyErrClient( const int32_t& errCode ) { if( _dbus ){ - _debug("NOTIFY ERR NUMBER %i\n" , errCode); + _debug("NOTIFY ERR NUMBER %i\n" , errCode); _dbus -> getConfigurationManager() -> errorAlert( errCode ); } } @@ -1816,18 +1832,18 @@ ManagerImpl::getAudioDeviceIndex(const std::string name) AlsaLayer *alsalayer; _debug("Get audio device index\n"); - + alsalayer = dynamic_cast<AlsaLayer *> (getAudioDriver()); if(alsalayer) return alsalayer -> soundCardGetIndex( name ); } - std::string + std::string ManagerImpl::getCurrentAudioOutputPlugin( void ) { AlsaLayer *alsalayer; - + _debug("Get alsa plugin\n"); - + alsalayer = dynamic_cast<AlsaLayer *> (getAudioDriver()); if(alsalayer) return alsalayer -> getAudioPlugin (); } @@ -1845,14 +1861,14 @@ int ManagerImpl::app_is_running( std::string process ) * Initialization: Main Thread */ void -ManagerImpl::initAudioDriver(void) +ManagerImpl::initAudioDriver(void) { - + int error; - + _debugInit("AudioLayer Creation"); - if( getConfigInt( PREFERENCES , CONFIG_AUDIO ) == ALSA ) + if( getConfigInt( PREFERENCES , CONFIG_AUDIO ) == ALSA ) { _audiodriver = new AlsaLayer( this ); } @@ -1878,7 +1894,7 @@ ManagerImpl::initAudioDriver(void) _debug("Init audio driver: %i\n", error); } } - + } /** @@ -1915,23 +1931,23 @@ ManagerImpl::selectAudioDriver (void) setConfig( AUDIO , ALSA_CARD_ID_IN , ALSA_DFT_CARD_ID ); } if( !alsalayer -> soundCardIndexExist( numCardOut , SFL_PCM_PLAYBACK ) ) - { + { _debug(" Card with index %i doesn't exist or cannot playback . Switch to 0.\n", numCardOut); numCardOut = ALSA_DFT_CARD_ID ; setConfig( AUDIO , ALSA_CARD_ID_OUT , ALSA_DFT_CARD_ID ); } } - + _audiodriver->setErrorMessage(-1); /* Open the audio devices */ - _audiodriver->openDevice( numCardIn , numCardOut, sampleRate, frameSize, SFL_PCM_BOTH, alsaPlugin ); + _audiodriver->openDevice( numCardIn , numCardOut, sampleRate, frameSize, SFL_PCM_BOTH, alsaPlugin ); /* Notify the error if there is one */ if( _audiodriver -> getErrorMessage() != -1 ) notifyErrClient( _audiodriver -> getErrorMessage()); } -void ManagerImpl::switchAudioManager (void) +void ManagerImpl::switchAudioManager (void) { int type, samplerate, framesize, numCardIn, numCardOut; std::string alsaPlugin; @@ -1951,7 +1967,7 @@ void ManagerImpl::switchAudioManager (void) _debug("Deleting current layer... \n" ); //_audiodriver->closeLayer(); delete _audiodriver; _audiodriver = NULL; - + switch( type ){ case ALSA: _debug("Creating Pulseaudio layer...\n"); @@ -1964,12 +1980,12 @@ void ManagerImpl::switchAudioManager (void) default: _debug("Error: audio layer unknown\n"); } - + _audiodriver->setErrorMessage(-1); - _audiodriver->openDevice( numCardIn , numCardOut, samplerate, framesize, SFL_PCM_BOTH, alsaPlugin ); + _audiodriver->openDevice( numCardIn , numCardOut, samplerate, framesize, SFL_PCM_BOTH, alsaPlugin ); if( _audiodriver -> getErrorMessage() != -1 ) notifyErrClient( _audiodriver -> getErrorMessage()); - + _debug("Current device: %i \n", type); _debug("has current call: %i \n", hasCurrentCall()); @@ -1977,9 +1993,9 @@ void ManagerImpl::switchAudioManager (void) if( (type != PULSEAUDIO) && (!hasCurrentCall())) { _debug("There is currently a call!!\n"); _audiodriver->stopStream(); - + } -} +} /** * Init the volume for speakers/micro from 0 to 100 value @@ -1994,12 +2010,12 @@ ManagerImpl::initVolume() } -void ManagerImpl::setSpkrVolume(unsigned short spkr_vol) -{ +void ManagerImpl::setSpkrVolume(unsigned short spkr_vol) +{ PulseLayer *pulselayer = NULL; /* Set the manager sound volume */ - _spkr_volume = spkr_vol; + _spkr_volume = spkr_vol; /* Only for PulseAudio */ pulselayer = dynamic_cast<PulseLayer*> (getAudioDriver()); @@ -2012,9 +2028,9 @@ void ManagerImpl::setSpkrVolume(unsigned short spkr_vol) } } -void ManagerImpl::setMicVolume(unsigned short mic_vol) -{ - _mic_volume = mic_vol; +void ManagerImpl::setMicVolume(unsigned short mic_vol) +{ + _mic_volume = mic_vol; } void ManagerImpl::setSipPort( int port ) @@ -2031,7 +2047,7 @@ int ManagerImpl::getSipPort( void ) /** * Main Thread */ - bool + bool ManagerImpl::getCallStatus(const std::string& sequenceId UNUSED) { if (!_dbus) { return false; } @@ -2040,7 +2056,7 @@ ManagerImpl::getCallStatus(const std::string& sequenceId UNUSED) TokenList tk; std::string code; std::string status; - std::string destination; + std::string destination; std::string number; while (iter != _callAccountMap.end()) @@ -2088,7 +2104,7 @@ ManagerImpl::getCallStatus(const std::string& sequenceId UNUSED) } //THREAD=Main - bool + bool ManagerImpl::getConfig(const std::string& section, const std::string& name, TokenList& arg) { return _config.getConfigTreeItemToken(section, name, arg); @@ -2096,7 +2112,7 @@ ManagerImpl::getConfig(const std::string& section, const std::string& name, Toke //THREAD=Main // throw an Conf::ConfigTreeItemException if not found - int + int ManagerImpl::getConfigInt(const std::string& section, const std::string& name) { try { @@ -2108,7 +2124,7 @@ ManagerImpl::getConfigInt(const std::string& section, const std::string& name) } //THREAD=Main -std::string +std::string ManagerImpl::getConfigString(const std::string& section, const std::string& name) { @@ -2121,14 +2137,14 @@ ManagerImpl::getConfigString(const std::string& section, const std::string& } //THREAD=Main - bool + bool ManagerImpl::setConfig(const std::string& section, const std::string& name, const std::string& value) { return _config.setConfigTreeItem(section, name, value); } //THREAD=Main - bool + bool ManagerImpl::setConfig(const std::string& section, const std::string& name, int value) { std::ostringstream valueStream; @@ -2136,56 +2152,89 @@ ManagerImpl::setConfig(const std::string& section, const std::string& name, int return _config.setConfigTreeItem(section, name, valueStream.str()); } - std::vector< std::string > -ManagerImpl::getAccountList() + +void ManagerImpl::setAccountsOrder (const std::string& order) { - std::vector< std::string > v; + // Set the new config + setConfig (PREFERENCES, CONFIG_ACCOUNTS_ORDER, order); +} - AccountMap::iterator iter = _accountMap.begin(); - while ( iter != _accountMap.end() ) { - if ( iter->second != 0 ) { - _debug("Account List: %s\n", iter->first.data()); - v.push_back(iter->first.data()); + std::vector< std::string > +ManagerImpl::getAccountList() +{ + std::vector< std::string > v; + std::vector< std::string > account_order; + int i; + account_order = loadAccountOrder (); + AccountMap::iterator iter; + + // If no order has been set, load the default one + // ie according to the creation date. + if (account_order.size () == 0) { + iter = _accountMap.begin (); + while ( iter != _accountMap.end() ) { + if ( iter->second != 0 ) { + v.push_back(iter->first.data()); + } + iter++; + } } - iter++; - } - _debug("Size: %d\n", v.size()); - return v; + + // Otherelse, load the custom one + // ie according to the saved order + else { + + for (i=0; i<account_order.size (); i++) { + // This account has not been loaded, so we ignore it + if ( (iter=_accountMap.find (account_order[i])) != _accountMap.end() ) + { + // If the account is valid + if (iter->second != 0) + { + v.push_back (iter->first.data ()); + } + } + } + + + } + + return v; } -std::map< std::string, std::string > ManagerImpl::getAccountDetails(const AccountID& accountID) +std::map< std::string, std::string > ManagerImpl::getAccountDetails(const AccountID& accountID) { std::map<std::string, std::string> a; std::string accountType; RegistrationState state; - + state = _accountMap[accountID]->getRegistrationState(); accountType = getConfigString(accountID, CONFIG_ACCOUNT_TYPE); a.insert( std::pair<std::string, std::string>( CONFIG_ACCOUNT_ALIAS, getConfigString(accountID, CONFIG_ACCOUNT_ALIAS)) ); a.insert( std::pair<std::string, std::string>( CONFIG_ACCOUNT_ENABLE, getConfigString(accountID, CONFIG_ACCOUNT_ENABLE) == "1" ? "TRUE": "FALSE")); a.insert( std::pair<std::string, std::string>( - "Status", + "Status", (state == Registered ? "REGISTERED": (state == Unregistered ? "UNREGISTERED": (state == Trying ? "TRYING": - (state == ErrorAuth ? "ERROR_AUTH": - (state == ErrorNetwork ? "ERROR_NETWORK": - (state == ErrorHost ? "ERROR_HOST": - (state == ErrorExistStun ? "ERROR_EXIST_STUN": - (state == ErrorConfStun ? "ERROR_CONF_STUN": + (state == ErrorAuth ? "ERROR_AUTH": + (state == ErrorNetwork ? "ERROR_NETWORK": + (state == ErrorHost ? "ERROR_HOST": + (state == ErrorExistStun ? "ERROR_EXIST_STUN": + (state == ErrorConfStun ? "ERROR_CONF_STUN": (state == Error ? "ERROR": "ERROR"))))))))) ) ); - + a.insert( std::pair<std::string, std::string>( CONFIG_ACCOUNT_TYPE, accountType ) ); a.insert( std::pair<std::string, std::string>( USERNAME, getConfigString(accountID, USERNAME) ) ); a.insert( std::pair<std::string, std::string>( PASSWORD, getConfigString(accountID, PASSWORD) ) ); a.insert( std::pair<std::string, std::string>( HOSTNAME, getConfigString(accountID, HOSTNAME) ) ); a.insert( std::pair<std::string, std::string>( CONFIG_ACCOUNT_MAILBOX, getConfigString(accountID, CONFIG_ACCOUNT_MAILBOX)) ); - + return a; } @@ -2195,7 +2244,7 @@ void ManagerImpl::setAccountDetails( const std::string& accountID, const std::ma std::string accountType; Account *acc; VoIPLink *link; - + accountType = (*details.find(CONFIG_ACCOUNT_TYPE)).second; setConfig(accountID, CONFIG_ACCOUNT_ALIAS, (*details.find(CONFIG_ACCOUNT_ALIAS)).second); @@ -2205,16 +2254,16 @@ void ManagerImpl::setAccountDetails( const std::string& accountID, const std::ma setConfig(accountID, PASSWORD, (*details.find(PASSWORD)).second); setConfig(accountID, HOSTNAME, (*details.find(HOSTNAME)).second); setConfig(accountID, CONFIG_ACCOUNT_MAILBOX,(*details.find(CONFIG_ACCOUNT_MAILBOX)).second); - + saveConfig(); - + acc = getAccount(accountID); acc->loadConfig(); - if (acc->isEnabled()){ + if (acc->isEnabled()){ acc->unregisterVoIPLink(); acc->registerVoIPLink(); } - else + else acc->unregisterVoIPLink(); // Update account details to the client side @@ -2227,7 +2276,7 @@ ManagerImpl::sendRegister( const std::string& accountID , const int32_t& expire { // Update the active field setConfig( accountID, CONFIG_ACCOUNT_ENABLE, expire ); - + Account* acc = getAccount(accountID); acc->loadConfig(); // Test on the freshly updated value @@ -2240,18 +2289,24 @@ ManagerImpl::sendRegister( const std::string& accountID , const int32_t& expire _debug("Send unregister for account %s\n" , accountID.c_str()); acc->unregisterVoIPLink(); } -} +} std::string ManagerImpl::addAccount(const std::map< std::string, std::string >& details) { /** @todo Deal with both the _accountMap and the Configuration */ - std::string accountType = (*details.find(CONFIG_ACCOUNT_TYPE)).second; + std::string accountType, account_list; Account* newAccount; std::stringstream accountID; + AccountID newAccountID; + accountID << "Account:" << time(NULL); - AccountID newAccountID = accountID.str(); + newAccountID = accountID.str(); + + // Get the type + accountType = (*details.find(CONFIG_ACCOUNT_TYPE)).second; + /** @todo Verify the uniqueness, in case a program adds accounts, two in a row. */ if (accountType == "SIP") { @@ -2267,14 +2322,24 @@ ManagerImpl::addAccount(const std::map< std::string, std::string >& details) _accountMap[newAccountID] = newAccount; setAccountDetails(accountID.str(), details); + // Add the newly created account in the account order list + account_list = getConfigString (PREFERENCES, CONFIG_ACCOUNTS_ORDER); + if (account_list != "") + { + newAccountID += "/"; + // Prepend the new account + account_list.insert (0, newAccountID); + setConfig (PREFERENCES, CONFIG_ACCOUNTS_ORDER, account_list); + } + saveConfig(); if (_dbus) _dbus->getConfigurationManager()->accountsChanged(); return newAccountID; } - void -ManagerImpl::removeAccount(const AccountID& accountID) + void +ManagerImpl::removeAccount(const AccountID& accountID) { // Get it down and dying Account* remAccount = getAccount(accountID); @@ -2304,7 +2369,7 @@ ManagerImpl::associateCallToAccount(const CallID& callID, const AccountID& accou _debug("Associate Call %s with Account %s\n", callID.data(), accountID.data()); return true; } else { - return false; + return false; } } else { return false; @@ -2333,8 +2398,8 @@ ManagerImpl::removeCallAccount(const CallID& callID) return false; } - CallID -ManagerImpl::getNewCallID() + CallID +ManagerImpl::getNewCallID() { std::ostringstream random_id("s"); random_id << (unsigned)rand(); @@ -2349,47 +2414,61 @@ ManagerImpl::getNewCallID() return random_id.str(); } +std::vector <std::string> ManagerImpl::loadAccountOrder (void) +{ + + std::string account_list; + std::vector <std::string> account_vect; + + account_list = getConfigString (PREFERENCES, CONFIG_ACCOUNTS_ORDER); + return unserialize (account_list); +} + + short ManagerImpl::loadAccountMap() { - - short nbAccount = 0; - TokenList sections = _config.getSections(); - std::string accountType; - Account* tmpAccount; + short nbAccount = 0; + TokenList sections = _config.getSections(); + std::string accountType; + Account* tmpAccount; + std::vector <std::string> account_order; - TokenList::iterator iter = sections.begin(); - while(iter != sections.end()) { - // Check if it starts with "Account:" (SIP and IAX pour le moment) - if ((int)(iter->find("Account:")) == -1) { - iter++; - continue; - } + TokenList::iterator iter = sections.begin(); + + while(iter != sections.end()) { + // Check if it starts with "Account:" (SIP and IAX pour le moment) + if ((int)(iter->find("Account:")) == -1) { + iter++; + continue; + } - accountType = getConfigString(*iter, CONFIG_ACCOUNT_TYPE); - if (accountType == "SIP") { - tmpAccount = AccountCreator::createAccount(AccountCreator::SIP_ACCOUNT, *iter); - } - else if (accountType == "IAX") { - tmpAccount = AccountCreator::createAccount(AccountCreator::IAX_ACCOUNT, *iter); - } - else { - _debug("Unknown %s param in config file (%s)\n", CONFIG_ACCOUNT_TYPE, accountType.c_str()); - } - - _debug("tmpAccount.getRegistrationState() %i \n ",tmpAccount->getRegistrationState()); - if (tmpAccount != NULL) { + accountType = getConfigString(*iter, CONFIG_ACCOUNT_TYPE); + + if (accountType == "SIP") { + tmpAccount = AccountCreator::createAccount(AccountCreator::SIP_ACCOUNT, *iter); + } - _debug(" %s \n", iter->c_str()); - _accountMap[iter->c_str()] = tmpAccount; - nbAccount++; - } + else if (accountType == "IAX") { + tmpAccount = AccountCreator::createAccount(AccountCreator::IAX_ACCOUNT, *iter); + } + + else { + _debug("Unknown %s param in config file (%s)\n", CONFIG_ACCOUNT_TYPE, accountType.c_str()); + } - iter++; - } - _debug("nbAccount loaded %i \n",nbAccount); - return nbAccount; + if (tmpAccount != NULL) { + _debug(" %s \n", iter->c_str()); + _accountMap[iter->c_str()] = tmpAccount; + nbAccount++; + } + + iter++; + } + + _debug("nbAccount loaded %i \n",nbAccount); + return nbAccount; } void @@ -2427,7 +2506,7 @@ ManagerImpl::getAccount(const AccountID& accountID) return iter->second; } -AccountID +AccountID ManagerImpl::getAccountIdFromNameAndServer(const std::string& userName, const std::string& server) { AccountMap::iterator iter; @@ -2457,7 +2536,7 @@ ManagerImpl::getAccountIdFromNameAndServer(const std::string& userName, const st AccountMap ManagerImpl::getSipAccountMap( void ) { - + AccountMap::iterator iter; AccountMap sipaccounts; AccountID id; @@ -2477,11 +2556,11 @@ void ManagerImpl::restartPJSIP (void) { SIPVoIPLink *siplink; siplink = dynamic_cast<SIPVoIPLink*> (getSIPAccountLink ()); - + this->unregisterCurSIPAccounts(); /* Terminate and initialize the PJSIP library */ - - if (siplink) + + if (siplink) { siplink->terminate (); siplink = SIPVoIPLink::instance(""); @@ -2522,7 +2601,7 @@ VoIPLink* ManagerImpl::getSIPAccountLink() -pjsip_regc +pjsip_regc *getSipRegcFromID(const AccountID& id UNUSED) { /*SIPAccount *tmp = dynamic_cast<SIPAccount *>getAccount(id); @@ -2550,14 +2629,14 @@ void ManagerImpl::unregisterCurSIPAccounts() void ManagerImpl::registerCurSIPAccounts(VoIPLink *link) { - + Account *current; AccountMap::iterator iter = _accountMap.begin(); while( iter != _accountMap.end() ) { current = iter->second; - + if (current) { if (current->isEnabled() && current->getType() == "sip") { //current->setVoIPLink(link); @@ -2566,7 +2645,7 @@ void ManagerImpl::registerCurSIPAccounts(VoIPLink *link) } current = NULL; iter++; - } + } } @@ -2595,6 +2674,19 @@ void ManagerImpl::setAddressbookSettings (const std::map<std::string, int32_t>& saveConfig (); } + void +ManagerImpl::setAddressbookList(const std::vector< std::string >& list){ + + std::string s = serialize(list); + setConfig(ADDRESSBOOK, ADDRESSBOOK_LIST, s); +} + + std::vector <std::string> +ManagerImpl::getAddressbookList( void ){ + + std::string s = getConfigString(ADDRESSBOOK, ADDRESSBOOK_LIST); + return unserialize(s); +} std::map<std::string, std::string> ManagerImpl::getHookSettings () { @@ -2603,6 +2695,9 @@ std::map<std::string, std::string> ManagerImpl::getHookSettings () { settings.insert (std::pair<std::string, std::string> ("URLHOOK_SIP_FIELD", getConfigString (HOOKS, URLHOOK_SIP_FIELD)) ); settings.insert (std::pair<std::string, std::string> ("URLHOOK_COMMAND", getConfigString (HOOKS, URLHOOK_COMMAND)) ); settings.insert (std::pair<std::string, std::string> ("URLHOOK_SIP_ENABLED", getConfigString (HOOKS, URLHOOK_SIP_ENABLED)) ); + settings.insert (std::pair<std::string, std::string> ("URLHOOK_IAX2_ENABLED", getConfigString (HOOKS, URLHOOK_IAX2_ENABLED)) ); + settings.insert (std::pair<std::string, std::string> ("PHONE_NUMBER_HOOK_ENABLED", getConfigString (HOOKS, PHONE_NUMBER_HOOK_ENABLED)) ); + settings.insert (std::pair<std::string, std::string> ("PHONE_NUMBER_HOOK_ADD_PREFIX", getConfigString (HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX)) ); return settings; } @@ -2612,6 +2707,9 @@ void ManagerImpl::setHookSettings (const std::map<std::string, std::string>& set setConfig(HOOKS, URLHOOK_SIP_FIELD, (*settings.find("URLHOOK_SIP_FIELD")).second); setConfig(HOOKS, URLHOOK_COMMAND, (*settings.find("URLHOOK_COMMAND")).second); setConfig(HOOKS, URLHOOK_SIP_ENABLED, (*settings.find("URLHOOK_SIP_ENABLED")).second); + setConfig(HOOKS, URLHOOK_IAX2_ENABLED, (*settings.find("URLHOOK_IAX2_ENABLED")).second); + setConfig(HOOKS, PHONE_NUMBER_HOOK_ENABLED, (*settings.find("PHONE_NUMBER_HOOK_ENABLED")).second); + setConfig(HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX, (*settings.find("PHONE_NUMBER_HOOK_ADD_PREFIX")).second); // Write it to the configuration file saveConfig (); @@ -2667,3 +2765,44 @@ bool ManagerImpl::removeCallConfig(const CallID& callID) { return false; } +std::map< std::string, std::string > ManagerImpl::getCallDetails(const CallID& callID) { + + std::map<std::string, std::string> call_details; + AccountID accountid; + Account *account; + VoIPLink *link; + Call *call; + + // We need here to retrieve the call information attached to the call ID + // To achieve that, we need to get the voip link attached to the call + // But to achieve that, we need to get the account the call was made with + + // So first we fetch the account + accountid = getAccountFromCall (callID); + + // Then the VoIP link this account is linked with (IAX2 or SIP) + if ( (account=getAccount (accountid)) != 0) { + link = account->getVoIPLink (); + + if (link) { + call = link->getCall (callID); + } + + } + + if (call) + { + call_details.insert (std::pair<std::string, std::string> ("ACCOUNTID", accountid)); + call_details.insert (std::pair<std::string, std::string> ("PEER_NUMBER", call->getPeerNumber ())); + call_details.insert (std::pair<std::string, std::string> ("PEER_NAME", call->getPeerName ())); + } + else + { + _debug ("Error: Managerimpl - getCallDetails ()\n"); + call_details.insert (std::pair<std::string, std::string> ("ACCOUNTID", AccountNULL)); + call_details.insert (std::pair<std::string, std::string> ("PEER_NUMBER", "Unknown")); + call_details.insert (std::pair<std::string, std::string> ("PEER_NAME", "Unknown")); + } + + return call_details; +} diff --git a/src/managerimpl.h b/src/managerimpl.h index 6abf1106da973892f892f850de1474bad296f613..2337cc4bbf86889bc37095554ddcaacb53078920 100644 --- a/src/managerimpl.h +++ b/src/managerimpl.h @@ -36,6 +36,7 @@ #include "account.h" #include "call.h" +#include "numbercleaner.h" #include "audio/tonelist.h" // for Tone::TONEID declaration #include "audio/audiofile.h" @@ -163,8 +164,8 @@ class ManagerImpl { */ bool refuseCall(const CallID& id); - /** - * Save config to file + /** + * Save config to file * @return true on success * false otherwise */ @@ -204,7 +205,7 @@ class ManagerImpl { bool playTone (); /** - * Play a special ringtone ( BUSY ) if there's at least one message on the voice mail + * Play a special ringtone ( BUSY ) if there's at least one message on the voice mail * @return bool True on success * false otherwise */ @@ -259,14 +260,14 @@ class ManagerImpl { */ void startVoiceMessageNotification(const AccountID& accountId, int nb_msg); - /** - * Notify the client through DBus that registration state has been updated + /** + * Notify the client through DBus that registration state has been updated */ void connectionStatusNotification(void); /** * ConfigurationManager - Send registration request - * @param accountId The account to register/unregister + * @param accountId The account to register/unregister * @param expire The flag for the type of registration * 0 for unregistration request * 1 for registration request @@ -275,12 +276,17 @@ class ManagerImpl { bool getCallStatus(const std::string& sequenceId); - /** - * Get account list + /** + * Get account list * @return std::vector<std::string> A list of accoundIDs */ std::vector< std::string > getAccountList(); + /** + * Set the account order in the config file + */ + void setAccountsOrder (const std::string& order); + /** * Retrieve details about a given account * @param accountID The account identifier @@ -288,6 +294,13 @@ class ManagerImpl { */ std::map< std::string, std::string > getAccountDetails(const AccountID& accountID); + /** + * Retrieve details about a given call + * @param callID The account identifier + * @return std::map< std::string, std::string > The call details + */ + std::map< std::string, std::string > getCallDetails(const CallID& callID); + /** * Save the details of an existing account, given the account ID * This will load the configuration map with the given data. @@ -295,7 +308,7 @@ class ManagerImpl { * @param accountID The account identifier * @param details The account parameters */ - void setAccountDetails( const ::std::string& accountID, + void setAccountDetails( const ::std::string& accountID, const std::map< ::std::string, ::std::string >& details ); /** @@ -315,7 +328,7 @@ class ManagerImpl { /** * Get the list of codecs we supports, not ordered * @return The list of the codecs - */ + */ std::vector< ::std::string > getCodecList( void ); /** @@ -346,13 +359,13 @@ class ManagerImpl { std::vector< std::string> getOutputAudioPluginList(void); /** - * Set input audio plugin + * Set input audio plugin * @param audioPlugin The audio plugin */ void setInputAudioPlugin(const std::string& audioPlugin); /** - * Set output audio plugin + * Set output audio plugin * @param audioPlugin The audio plugin */ void setOutputAudioPlugin(const std::string& audioPlugin); @@ -398,7 +411,7 @@ class ManagerImpl { * Get current alsa plugin * @return std::string The Alsa plugin */ - std::string getCurrentAudioOutputPlugin( void ); + std::string getCurrentAudioOutputPlugin( void ); /** * Convert a list of payload in a special format, readable by the server. @@ -407,29 +420,31 @@ class ManagerImpl { */ std::string serialize(std::vector<std::string> v); + std::vector<std::string> unserialize(std::string v); + /** * Tells if IAX2 support is enabled * @return int 1 if IAX2 is enabled * 0 otherwise */ - int isIax2Enabled( void ); + int isIax2Enabled( void ); /** * Ringtone option. - * If ringtone is enabled, ringtone on incoming call use custom choice. If not, only standart tone. + * If ringtone is enabled, ringtone on incoming call use custom choice. If not, only standart tone. * @return int 1 if enabled * 0 otherwise */ - int isRingtoneEnabled( void ); + int isRingtoneEnabled( void ); /** - * Set the ringtone option + * Set the ringtone option * Inverse current value */ - void ringtoneEnabled( void ); + void ringtoneEnabled( void ); /** - * Get the ringtone + * Get the ringtone * @return gchar* The file name selected as a ringtone */ std::string getRingtoneChoice( void ); @@ -453,7 +468,7 @@ class ManagerImpl { void setRecordPath( const std::string& recPath); /** - * Tells if the user wants to display the dialpad or not + * Tells if the user wants to display the dialpad or not * @return int 1 if dialpad has to be displayed * 0 otherwise */ @@ -465,7 +480,7 @@ class ManagerImpl { void setDialpad( void ); /** - * Tells if the user wants to display the volume controls or not + * Tells if the user wants to display the volume controls or not * @return int 1 if the controls have to be displayed * 0 otherwise */ @@ -516,12 +531,12 @@ class ManagerImpl { /** * Configure the popup behaviour * @return int 1 if it should popup on incoming calls - * 0 if it should never popups + * 0 if it should never popups */ int popupMode( void ); /** - * Configure the popup behaviour + * Configure the popup behaviour * When SFLphone is in the system tray, you can configure when it popups * Never or only on incoming calls */ @@ -553,24 +568,34 @@ class ManagerImpl { */ void setMailNotify( void ); - + /** - * Addressbook configuration + * Addressbook configuration */ std::map<std::string, int32_t> getAddressbookSettings (void); /** - * Addressbook configuration + * Addressbook configuration */ - void setAddressbookSettings (const std::map<std::string, int32_t>& settings); - + void setAddressbookSettings (const std::map<std::string, int32_t>& settings); + /** - * Hook configuration + * Addressbook list + */ + void setAddressbookList(const std::vector< std::string >& list); + + /** + * Addressbook list + */ + std::vector <std::string> getAddressbookList( void ); + + /** + * Hook configuration */ std::map<std::string, std::string> getHookSettings (void); /** - * Hook configuration + * Hook configuration */ void setHookSettings (const std::map<std::string, std::string>& settings); @@ -589,9 +614,9 @@ class ManagerImpl { void setAudioManager( const int32_t& api ); void switchAudioManager( void ); - - void setPulseAppVolumeControl( void ); - int32_t getPulseAppVolumeControl( void ); + + void setPulseAppVolumeControl( void ); + int32_t getPulseAppVolumeControl( void ); /** * Get the desktop mail notification level @@ -614,13 +639,13 @@ class ManagerImpl { /** * Get the list of the active codecs * @return std::vector< ::std::string > The list of active codecs - */ - std::vector< ::std::string > getActiveCodecList( void ); + */ + std::vector< ::std::string > getActiveCodecList( void ); /** * Set the list of the active codecs * @param list The new list of active codecs - */ + */ void setActiveCodecList( const std::vector< ::std::string >& list); /* @@ -639,30 +664,30 @@ class ManagerImpl { * false otherwise */ bool getConfig(const std::string& section, const std::string& name, TokenList& arg); - + /** * Change a specific value in the configuration tree. * This value will then be saved in the user config file sflphonedrc - * @param section The section name + * @param section The section name * @param name The parameter name - * @param value The new string value + * @param value The new string value * @return bool true on success * false otherwise */ bool setConfig(const std::string& section, const std::string& name, const std::string& value); - + /** * Change a specific value in the configuration tree. * This value will then be saved in the user config file sflphonedrc - * @param section The section name + * @param section The section name * @param name The parameter name - * @param value The new int value + * @param value The new int value * @return bool true on success * false otherwise */ bool setConfig(const std::string& section, const std::string& name, int value); - - /** + + /** * Get a int from the configuration tree * Throw an Conf::ConfigTreeItemException if not found * @param section The section name to look in @@ -671,7 +696,7 @@ class ManagerImpl { */ int getConfigInt(const std::string& section, const std::string& name); - /** + /** * Get a string from the configuration tree * Throw an Conf::ConfigTreeItemException if not found * @param section The section name to look in @@ -688,7 +713,7 @@ class ManagerImpl { void selectAudioDriver(void); /** - * Handle audio sounds heard by a caller while they wait for their + * Handle audio sounds heard by a caller while they wait for their * connection to a called party to be completed. */ void ringback (); @@ -702,7 +727,7 @@ class ManagerImpl { * Handle played music when a congestion occurs */ void congestion (); - + /** * Handle played sound when a call can not be conpleted because of a busy recipient */ @@ -713,15 +738,15 @@ class ManagerImpl { */ void callFailure(const CallID& id); - /** + /** * Retrieve the current telephone tone - * @return AudioLoop* The audio tone or 0 if no tone (init before calling this function) + * @return AudioLoop* The audio tone or 0 if no tone (init before calling this function) */ AudioLoop* getTelephoneTone(); - - /** + + /** * Retrieve the current telephone file - * @return AudioLoop* The audio file or 0 if the wav is stopped + * @return AudioLoop* The audio file or 0 if the wav is stopped */ AudioLoop* getTelephoneFile(); @@ -743,7 +768,7 @@ class ManagerImpl { * @return unsigned short The volume value */ unsigned short getSpkrVolume(void) { return _spkr_volume; } - + /* * Inline functions to manage speaker volume control * Read by main thread and AudioLayer thread @@ -751,7 +776,7 @@ class ManagerImpl { * @param spkr_vol The volume value */ void setSpkrVolume(unsigned short spkr_vol); - + /* * Inline functions to manage mic volume control * Read by main thread and AudioLayer thread @@ -759,7 +784,7 @@ class ManagerImpl { * @return unsigned short The volume value */ unsigned short getMicVolume(void) { return _mic_volume; } - + /* * Inline functions to manage mic volume control * Read by main thread and AudioLayer thread @@ -769,9 +794,9 @@ class ManagerImpl { void setMicVolume(unsigned short mic_vol); // Manage information about firewall - + /* - * Get information about firewall + * Get information about firewall * @param stunSvrAddr: stun server * @param port port number to open to test the connection * @return true if the connection is successful @@ -783,13 +808,13 @@ class ManagerImpl { * @return int The firewall port */ inline int getFirewallPort(void) { return _firewallPort; } - + /* * Inline functions to manage firewall settings * @param port The firewall port */ inline void setFirewallPort(int port) { _firewallPort = port; } - + /* * Inline functions to manage firewall settings * @return std::string The firewall address @@ -797,8 +822,8 @@ class ManagerImpl { inline std::string getFirewallAddress (void) { return _firewallAddr; } /** - * If you are behind a NAT, you have to use STUN server, specified in - * STUN configuration(you can change this one by default) to give you an + * If you are behind a NAT, you have to use STUN server, specified in + * STUN configuration(you can change this one by default) to give you an * public IP address and assign a port number. * Note: Set firewall port/address retreive * @param svr Server on which to send request @@ -821,7 +846,7 @@ class ManagerImpl { */ bool hasLoadedSetup() { return _setupLoaded; } - /** + /** * Return a new random callid that is not present in the list * @return CallID A brand new callid */ @@ -848,16 +873,16 @@ class ManagerImpl { void restartPJSIP( ); void unregisterCurSIPAccounts(); - + void registerCurSIPAccounts(VoIPLink *link); - + /** * Returns a map with only the existing SIP accounts */ AccountMap getSipAccountMap( void ); private: - + /** * Check if a process is running with the system command * @@ -867,7 +892,7 @@ class ManagerImpl { int app_is_running(std::string process); /** - * Create .PROGNAME directory in home user and create + * Create .PROGNAME directory in home user and create * configuration tree from the settings file if this file exists. * * @return 0 if creating file failed @@ -893,7 +918,7 @@ class ManagerImpl { /* * Init the volume for speakers/micro from 0 to 100 value - */ + */ void initVolume(); /** @@ -907,7 +932,7 @@ class ManagerImpl { * @param id The new callid */ void switchCall(const CallID& id); - + /* * Play one tone * @return false if the driver is uninitialize @@ -950,7 +975,7 @@ class ManagerImpl { // Multithread variable (protected by _mutex) - // + // /** Mutex to protect access to code section */ ost::Mutex _mutex; @@ -962,10 +987,10 @@ class ManagerImpl { /** Protect waiting call list, access by many voip/audio threads */ ost::Mutex _waitingCallMutex; - + /** Number of waiting call, synchronize with waitingcall callidvector */ unsigned int _nbIncomingWaitingCall; - + /** * Add incoming callid to the waiting list * @param id CallID to add @@ -986,7 +1011,7 @@ class ManagerImpl { bool isWaitingCall(const CallID& id); /** - * Path of the ConfigFile + * Path of the ConfigFile */ std::string _path; int _exist; @@ -1007,7 +1032,7 @@ class ManagerImpl { /** Map to associate a CallID to the good account */ CallAccountMap _callAccountMap; - + /** Mutex to lock the call account map (main thread + voiplink thread) */ ost::Mutex _callAccountMapMutex; @@ -1034,7 +1059,7 @@ class ManagerImpl { */ bool removeCallAccount(const CallID& callID); - /** + /** *Contains a list of account (sip, aix, etc) and their respective voiplink/calls */ AccountMap _accountMap; @@ -1044,6 +1069,13 @@ class ManagerImpl { */ short loadAccountMap(); + /** + * Load the accounts order set by the user from the sflphonedrc config file + * @return std::vector<std::string> A vector containing the account ID's + */ + std::vector<std::string> loadAccountOrder (); + + /** * Unload the account (delete them) */ @@ -1056,7 +1088,7 @@ class ManagerImpl { * false otherwise */ bool accountExists(const AccountID& accountID); - + public: /** @@ -1101,6 +1133,8 @@ private: // Assignment Operator ManagerImpl& operator=( const ManagerImpl& rh); + NumberCleaner *_cleaner; + /** * Check if the call is a classic call or a direct IP-to-IP call */ diff --git a/src/numbercleaner.cpp b/src/numbercleaner.cpp new file mode 100644 index 0000000000000000000000000000000000000000..afc07724f4ffafff6e7cd3e6f5ba26f94da9f1b5 --- /dev/null +++ b/src/numbercleaner.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "numbercleaner.h" + +#include <iostream> + +NumberCleaner::NumberCleaner (void) : _prefix("") { +} + +NumberCleaner::~NumberCleaner (void) { +} + +std::string NumberCleaner::clean (std::string to_clean) { + + strip_char (" ", &to_clean); + strip_char ("-", &to_clean); + strip_char ("(", &to_clean); + strip_char (")", &to_clean); + + return to_clean.insert (0, this->get_phone_number_prefix ()); +} + +void NumberCleaner::strip_char (std::string to_strip, std::string *num) { + + std::size_t pos; + + while ( (pos=(*num).find (to_strip)) != std::string::npos) { + *num = (*num).erase (pos, 1); + } +} diff --git a/src/audio/samplecache.h b/src/numbercleaner.h similarity index 58% rename from src/audio/samplecache.h rename to src/numbercleaner.h index 4c07d558b4e0b0f9c421376e0136a32462dc0f67..aff62036d03525c6e10e8566e95e107e94c0412d 100644 --- a/src/audio/samplecache.h +++ b/src/numbercleaner.h @@ -1,5 +1,6 @@ /* - * Copyright (C) 2008 Savoir-Faire Linux inc. + * Copyright (C) 2009 Savoir-Faire Linux inc. + * * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify @@ -17,32 +18,29 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef _SAMPLE_CACHE_H -#define _SAMPLE_CACHE_H +#ifndef _NUMBER_CLEANER_H +#define _NUMBER_CLEANER_H + +#include <string> + +class NumberCleaner { -#include <pulse/pulseaudio.h> -#include <audiolayer.h> + public: + NumberCleaner (void); + ~NumberCleaner (void); -class SampleCache { - - public: - SampleCache( pa_stream* stream ); - ~SampleCache(); + std::string clean (std::string to_clean); + inline void set_phone_number_prefix (std::string prefix) { _prefix = prefix; } - bool uploadSample( SFLDataFormat* buffer, size_t size ); - bool removeSample( ); - bool isSampleCached( ); + inline std::string get_phone_number_prefix (void) { return _prefix; } - private: - // Copy Constructor - SampleCache(const SampleCache& rh); + private: - // Assignment Operator - SampleCache& operator=( const SampleCache& rh); + std::string _prefix; - pa_stream* _stream; + void strip_char(std::string to_strip, std::string *num); }; -#endif // _SAMPLE_CACHE_H +#endif diff --git a/src/sdp.cpp b/src/sdp.cpp index 2c623f8d46e2f9763731c0dc6f07c93ad1927e34..a0604d6da7416725d64b0806465467dba8ef4675 100644 --- a/src/sdp.cpp +++ b/src/sdp.cpp @@ -145,7 +145,10 @@ int Sdp::create_initial_offer( ){ _debug ("Create initial offer\n"); // Build the SDP session descriptor - create_local_offer( ); + status = create_local_offer( ); + if (status != PJ_SUCCESS) { + return status; + } // Create the SDP negociator instance with local offer status = pjmedia_sdp_neg_create_w_local_offer( _pool, get_local_sdp_session(), &_negociator); @@ -169,7 +172,10 @@ int Sdp::receiving_initial_offer( pjmedia_sdp_session* remote ){ // pjmedia_sdp_neg_create_w_remote_offer with the remote offer, and by providing the local offer ( optional ) // Build the local offer to respond - create_local_offer( ); + status = create_local_offer( ); + if (status != PJ_SUCCESS) { + return status; + } // Retrieve some useful remote information this->fetch_media_transport_info_from_remote_sdp (remote); @@ -304,12 +310,16 @@ AudioCodec* Sdp::get_session_media( void ){ int nb_media; int nb_codec; AudioCodec *codec = NULL; + std::vector<sdpMedia*> media_list; + + _debug ("sdp line 314 - get_session_media ()\n"); - nb_media = _session_media.size(); + media_list = get_session_media_list (); + nb_media = media_list.size(); if (nb_media > 0) { - nb_codec = _session_media[0]->get_media_codec_list().size(); + nb_codec = media_list[0]->get_media_codec_list().size(); if (nb_codec > 0) { - codec = _session_media[0]->get_media_codec_list()[0]; + codec = media_list[0]->get_media_codec_list()[0]; } } return codec; diff --git a/src/sdp.h b/src/sdp.h index a30b18807f7ee780f9257189920ad55fcda9b11b..3a0eee5c6e67f4ed7c90757d21368bf2539d1598 100644 --- a/src/sdp.h +++ b/src/sdp.h @@ -181,6 +181,8 @@ class Sdp { void fetch_media_transport_info_from_remote_sdp (pjmedia_sdp_session *remote_sdp); + std::vector<sdpMedia*> get_session_media_list (void) { return _session_media; } + private: /** Codec Map */ std::vector<sdpMedia*> _local_media_cap; diff --git a/src/sipaccount.cpp b/src/sipaccount.cpp index 0dceb51243d46872583ee509a55f79bcdc6b5647..b72eb15e0f9bcbb78c60230b0ecddf2b18af0467 100644 --- a/src/sipaccount.cpp +++ b/src/sipaccount.cpp @@ -40,7 +40,6 @@ SIPAccount::SIPAccount(const AccountID& accountID) } - SIPAccount::~SIPAccount() { /* One SIP account less connected to the sip voiplink */ diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp index 12e014016fd358f8b918f578e002b31cd833b11a..c1820b60cd438d69d494a82d3daf526e6e2c856b 100644 --- a/src/sipvoiplink.cpp +++ b/src/sipvoiplink.cpp @@ -25,9 +25,13 @@ #include "sipaccount.h" #include "audio/audiortp.h" +#include <netinet/in.h> +#include <arpa/nameser.h> +#include <resolv.h> -#define CAN_REINVITE 1 +#define CAN_REINVITE 1 +const pj_str_t STR_USER_AGENT = { (char*)"User-Agent", 10 }; /**************** EXTERN VARIABLES AND FUNCTIONS (callbacks) **************************/ @@ -42,11 +46,11 @@ void get_remote_sdp_from_offer( pjsip_rx_data *rdata, pjmedia_sdp_session** r_sd int getModId(); /** - * * Set audio (SDP) configuration for a call - * * localport, localip, localexternalport - * * @param call a SIPCall valid pointer - * * @return bool True - * */ + * Set audio (SDP) configuration for a call + * localport, localip, localexternalport + * @param call a SIPCall valid pointer + * @return bool True + */ bool setCallAudioLocal(SIPCall* call, std::string localIP, bool stun, std::string server); void handle_incoming_options (pjsip_rx_data *rxdata); @@ -173,8 +177,6 @@ SIPVoIPLink* SIPVoIPLink::_instance = NULL; , _useStun(false) , _clients(0) { - _debug("SIPVoIPLink::~SIPVoIPLink(): sipvoiplink constructor called \n"); - // to get random number for RANDOM_PORT srand (time(NULL)); @@ -186,7 +188,6 @@ SIPVoIPLink* SIPVoIPLink::_instance = NULL; SIPVoIPLink::~SIPVoIPLink() { - _debug("SIPVoIPLink::~SIPVoIPLink(): sipvoiplink destructor called \n"); terminate(); } @@ -289,6 +290,14 @@ void get_remote_sdp_from_offer( pjsip_rx_data *rdata, pjmedia_sdp_session** r_sd *r_sdp = NULL; } + +std::string SIPVoIPLink::get_useragent_name (void) +{ + std::ostringstream useragent; + useragent << PROGNAME << "/" << SFLPHONED_VERSION; + return useragent.str(); +} + void SIPVoIPLink::getEvent() { @@ -307,13 +316,14 @@ int SIPVoIPLink::sendRegister( AccountID id ) pj_status_t status; int expire_value; char contactTmp[256]; - pj_str_t svr, aor, contact; + pj_str_t svr, aor, contact, useragent; pjsip_tx_data *tdata; std::string tmp, hostname, username, password; SIPAccount *account; pjsip_regc *regc; + pjsip_generic_string_hdr *h; + pjsip_hdr hdr_list; - account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount(id)); hostname = account->getHostname(); username = account->getUsername(); @@ -386,6 +396,13 @@ int SIPVoIPLink::sendRegister( AccountID id ) account->setCredInfo(cred); + // Add User-Agent Header + pj_list_init (&hdr_list); + useragent = pj_str( (char*)get_useragent_name ().c_str() ); + h = pjsip_generic_string_hdr_create (_pool, &STR_USER_AGENT, &useragent); + pj_list_push_back (&hdr_list, (pjsip_hdr*)h); + pjsip_regc_add_headers (regc, &hdr_list); + status = pjsip_regc_register(regc, PJ_TRUE, &tdata); if (status != PJ_SUCCESS) { _debug("UserAgent: Unable to register regc.\n"); @@ -450,9 +467,11 @@ SIPVoIPLink::sendUnregister (AccountID id) SIPVoIPLink::newOutgoingCall(const CallID& id, const std::string& toUrl) { Account* account; + pj_status_t status; SIPCall* call = new SIPCall(id, Call::Outgoing, _pool); + if (call) { account = dynamic_cast<SIPAccount *>(Manager::instance().getAccount(Manager::instance().getAccountFromCall(id))); if(!account) @@ -472,7 +491,11 @@ SIPVoIPLink::newOutgoingCall(const CallID& id, const std::string& toUrl) _debug("Try to make a call to: %s with call ID: %s\n", toUrl.data(), id.data()); // Building the local SDP offer call->getLocalSDP()->set_ip_address(getLocalIP()); - call->getLocalSDP()->create_initial_offer(); + status = call->getLocalSDP()->create_initial_offer(); + if (status != PJ_SUCCESS) { + delete call; call=0; + return call; + } if ( SIPOutgoingInvite(call) ) { call->setConnectionState(Call::Progressing); @@ -654,8 +677,10 @@ SIPVoIPLink::onhold(const CallID& id) /* Create re-INVITE with new offer */ status = inv_session_reinvite (call, "sendonly"); + if (status != PJ_SUCCESS) + return false; - return (status == PJ_SUCCESS); + return true; } int SIPVoIPLink::inv_session_reinvite (SIPCall *call, std::string direction) { @@ -669,26 +694,30 @@ int SIPVoIPLink::inv_session_reinvite (SIPCall *call, std::string direction) { if( local_sdp == NULL ){ _debug("! SIP Failure: unable to find local_sdp\n"); - return false; + return !PJ_SUCCESS; } // reinvite only if connected // Build the local SDP offer status = call->getLocalSDP()->create_initial_offer( ); + if (status != PJ_SUCCESS) + return 1; // !PJ_SUCCESS + pjmedia_sdp_media_remove_all_attr(local_sdp->media[0], "sendrecv"); attr = pjmedia_sdp_attr_create(_pool, direction.c_str(), NULL); pjmedia_sdp_media_add_attr(local_sdp->media[0], attr); - PJ_ASSERT_RETURN( status == PJ_SUCCESS, 1 ); // Build the reinvite request status = pjsip_inv_reinvite( call->getInvSession(), NULL, local_sdp, &tdata ); - PJ_ASSERT_RETURN( status == PJ_SUCCESS, 1 ); + if (status != PJ_SUCCESS) + return 1; // !PJ_SUCCESS // Send it status = pjsip_inv_send_msg( call->getInvSession(), tdata ); - PJ_ASSERT_RETURN( status == PJ_SUCCESS, 1 ); - + if (status != PJ_SUCCESS) + return 1; // !PJ_SUCCESS + return PJ_SUCCESS; } @@ -868,11 +897,12 @@ SIPVoIPLink::getCurrentCodecName() { SIPCall *call; - AudioCodec *ac; + AudioCodec *ac = NULL; std::string name = ""; call = getSIPCall(Manager::instance().getCurrentCallId()); - ac = call->getLocalSDP()->get_session_media(); + if (call) + ac = call->getLocalSDP()->get_session_media(); if (ac) name = ac->getCodecName(); @@ -1248,6 +1278,85 @@ std::string SIPVoIPLink::getSipTo(const std::string& to_url, std::string hostnam // Private functions /////////////////////////////////////////////////////////////////////////////// + + bool get_dns_server_addresses (std::vector<std::string> *servers) { + + int server_count, i; + std::vector<std::string> nameservers; + struct sockaddr_in current_server; + in_addr address; + + // Read configuration files + if (res_init () != 0) + { + _debug ("Resolver initialization failed\n"); + return false; + } + + server_count = _res.nscount; + for (i=0; i<server_count; i++) { + current_server = (struct sockaddr_in)_res.nsaddr_list[i]; + address = current_server.sin_addr; + nameservers.push_back (inet_ntoa (address)); + } + + //nameservers.push_back ("192.168.50.3"); + *servers = nameservers; + + return true; + } + + pj_status_t SIPVoIPLink::enable_dns_srv_resolver (pjsip_endpoint *endpt, pj_dns_resolver **p_resv) { + + pj_status_t status; + pj_dns_resolver *resv; + std::vector <std::string> dns_servers; + pj_uint16_t port = 5353; + pjsip_resolver_t *res; + int scount, i; + + // Create the DNS resolver instance + status = pjsip_endpt_create_resolver (endpt, &resv); + if (status != PJ_SUCCESS) { + _debug ("Error creating the DNS resolver instance\n"); + return status; + } + + if (!get_dns_server_addresses (&dns_servers)) + { + _debug ("Error while fetching DNS information\n"); + return -1; + } + + // Build the nameservers list needed by pjsip + scount = dns_servers.size (); + pj_str_t nameservers[scount]; + + for (i = 0; i<scount; i++) { + nameservers[i] = pj_str((char*)dns_servers[i].c_str()); + } + + // Update the name servers for the DNS resolver + status = pj_dns_resolver_set_ns (resv, scount, nameservers, NULL); + if (status != PJ_SUCCESS){ + _debug ("Error updating the name servers for the DNS resolver\n"); + return status; + } + + // Set the DNS resolver instance of the SIP resolver engine + status = pjsip_endpt_set_resolver (endpt, resv); + if (status != PJ_SUCCESS){ + _debug ("Error setting the DNS resolver instance of the SIP resolver engine\n"); + return status; + } + + *p_resv = resv; + + return PJ_SUCCESS; + + } + + bool SIPVoIPLink::pjsip_init() { pj_status_t status; @@ -1258,6 +1367,7 @@ std::string SIPVoIPLink::getSipTo(const std::string& to_url, std::string hostnam std::string name_mod; bool useStun; validStunServer = true; + pj_dns_resolver *p_resv; name_mod = "sflphone"; @@ -1380,6 +1490,9 @@ std::string SIPVoIPLink::getSipTo(const std::string& to_url, std::string hostnam status = pjsip_xfer_init_module(_endpt); PJ_ASSERT_RETURN( status == PJ_SUCCESS, 1 ); + status = enable_dns_srv_resolver (_endpt, &p_resv); + PJ_ASSERT_RETURN( status == PJ_SUCCESS, 1 ); + // Init the callback for INVITE session: pj_bzero(&inv_cb, sizeof (inv_cb)); @@ -1748,6 +1861,7 @@ std::string SIPVoIPLink::getSipTo(const std::string& to_url, std::string hostnam case PJSIP_SC_NOT_ACCEPTABLE_HERE: /* no compatible codecs */ case PJSIP_SC_NOT_ACCEPTABLE_ANYWHERE: case PJSIP_SC_UNSUPPORTED_MEDIA_TYPE: + case PJSIP_SC_UNAUTHORIZED: accId = Manager::instance().getAccountFromCall(call->getCallId()); link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink(accId)); if (link) { @@ -1867,7 +1981,7 @@ void call_on_tsx_changed(pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_e std::string request; // Handle the incoming call invite in this function - _debug("UserAgent: Callback on_rx_request is involved!\n"); + _debug("UserAgent: Callback on_rx_request is involved! *****************************************************\n"); /* First, let's got the username and server name from the invite. * We will use them to detect which account is the callee. @@ -1878,13 +1992,15 @@ void call_on_tsx_changed(pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_e userName = std::string(sip_uri->user.ptr, sip_uri->user.slen); server = std::string(sip_uri->host.ptr, sip_uri->host.slen) ; + std::cout << userName << " ------------------ " << server << std::endl; + // Get the account id of callee from username and server account_id = Manager::instance().getAccountIdFromNameAndServer(userName, server); /* If we don't find any account to receive the call */ if(account_id == AccountNULL) { _debug("UserAgent: Username %s doesn't match any account!\n",userName.c_str()); - return false; + //return false; } /* Get the voip link associated to the incoming call */ @@ -1984,7 +2100,12 @@ void call_on_tsx_changed(pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_e // We retrieve the remote sdp offer in the rdata struct to begin the negociation call->getLocalSDP()->set_ip_address(link->getLocalIPAddress()); get_remote_sdp_from_offer( rdata, &r_sdp ); - call->getLocalSDP()->receiving_initial_offer( r_sdp ); + status = call->getLocalSDP()->receiving_initial_offer( r_sdp ); + if (status!=PJ_SUCCESS) { + delete call; call=0; + return false; + } + call->setConnectionState(Call::Progressing); call->setPeerNumber(peerNumber); diff --git a/src/sipvoiplink.h b/src/sipvoiplink.h index 51bd9a01378b6a6f3dcf1ce90a664736927aba6d..028fcd8a2fd6173135816df5c1682348813daaa4 100644 --- a/src/sipvoiplink.h +++ b/src/sipvoiplink.h @@ -42,7 +42,7 @@ class AudioRtp; #define RANDOM_SIP_PORT rand() % 64000 + 1024 // To set the verbosity. From 0 (min) to 6 (max) -#define PJ_LOG_LEVEL 1 +#define PJ_LOG_LEVEL 0 /** * @file sipvoiplink.h @@ -315,6 +315,8 @@ class SIPVoIPLink : public VoIPLink bool new_ip_to_ip_call (const CallID& id, const std::string& to); + std::string get_useragent_name (void); + private: /** * Constructor @@ -325,6 +327,15 @@ class SIPVoIPLink : public VoIPLink /* The singleton instance */ static SIPVoIPLink* _instance; + /** + * Enable the SIP SRV resolver + * @param endpt The SIP endpoint + * @param p_resv Pointer to receive The DNS resolver instance + * + * @return pj_status_t PJ_SUCCESS on success + */ + pj_status_t enable_dns_srv_resolver (pjsip_endpoint *endpt, pj_dns_resolver ** p_resv); + void busy_sleep(unsigned msec); /** diff --git a/src/user_cfg.h b/src/user_cfg.h index 48b78965d4ca9cf570f479e37f01b26a11270df7..d0522277ea45fa17b22d0f732f00f82a20bb9e78 100644 --- a/src/user_cfg.h +++ b/src/user_cfg.h @@ -8,7 +8,7 @@ * 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 @@ -61,6 +61,7 @@ #define CONFIG_AUDIO "Audio.api" /** Audio manager (ALSA or pulseaudio) */ #define CONFIG_PA_VOLUME_CTRL "Pulseaudio.volumeCtrl" /** Whether or not PA should modify volume of other applications on the same sink */ #define CONFIG_SIP_PORT "SIP.portNum" +#define CONFIG_ACCOUNTS_ORDER "Accounts.order" /** To restore account order */ #define SIGNALISATION "VoIPLink" /** Section Signalisation */ #define PLAY_DTMF "DTMF.playDtmf" /** Whether or not should play dtmf */ @@ -77,18 +78,22 @@ #define ADDRESSBOOK_DISPLAY_PHONE_BUSINESS "Addressbook.phone_business" #define ADDRESSBOOK_DISPLAY_PHONE_HOME "Addressbook.phone_home" #define ADDRESSBOOK_DISPLAY_PHONE_MOBILE "Addressbook.phone_mobile" +#define ADDRESSBOOK_LIST "Addressbook.list" #define HOOKS "Hooks" /** Hooks section */ -#define URLHOOK_SIP_FIELD "Hooks.url_sip_field" -#define URLHOOK_COMMAND "Hooks.url_command" -#define URLHOOK_SIP_ENABLED "Hooks.sip_enabled" +#define URLHOOK_SIP_FIELD "Hooks.url_sip_field" +#define URLHOOK_COMMAND "Hooks.url_command" +#define URLHOOK_SIP_ENABLED "Hooks.sip_enabled" +#define URLHOOK_IAX2_ENABLED "Hooks.iax2_enabled" +#define PHONE_NUMBER_HOOK_ENABLED "Hooks.phone_number_enabled" +#define PHONE_NUMBER_HOOK_ADD_PREFIX "Hooks.phone_number_add_prefix" #define EMPTY_FIELD "" /** Default value for empty field */ #define DFT_STUN_SERVER "stun.ekiga.net" /** Default STUN server address */ -#define YES_STR "1" /** Default YES value */ +#define YES_STR "1" /** Default YES value */ #define NO_STR "0" /** Default NO value */ #define DFT_PULSE_LENGTH_STR "250" /** Default DTMF lenght */ -#define SIP_INFO_STR "0" /** Default DTMF transport mode */ +#define SIP_INFO_STR "0" /** Default DTMF transport mode */ #define ALSA_DFT_CARD "0" /** Default sound card index */ #define DFT_VOL_SPKR_STR "100" /** Default speaker volume */ #define DFT_VOL_MICRO_STR "100" /** Default mic volume */ diff --git a/test/Makefile.am b/test/Makefile.am index 94a2122bfb203c9cb02f18db84db589a034db54c..8f3003587d6e748791b0407c6465ad85d2d6343d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,6 +1,6 @@ include ../globals.mak -bin_PROGRAMS = configurationTester pluginmanagerTester audiorecorderTester +bin_PROGRAMS = numbercleanerTester pluginmanagerTester hookmanagerTester OBJECT_FILES= \ ../src/sflphoned-managerimpl.o \ @@ -17,66 +17,64 @@ OBJECT_FILES= \ ../src/sflphoned-eventthread.o \ ../src/plug-in/pluginmanager.o \ ../src/plug-in/audiorecorder/audiorecord.o \ - ../src/sflphoned-samplerateconverter.o + ../src/sflphoned-samplerateconverter.o \ + ../src/sflphoned-sdp.o \ + ../src/sflphoned-sdpmedia.o \ + ../src/sflphoned-numbercleaner.o -configurationTester_SOURCES = \ - configurationTest.cpp \ - configurationTest.h \ +numbercleanerTester_SOURCES = \ + numbercleanerTest.h \ + numbercleanerTest.cpp \ TestMain.cpp -pluginmanagerTester_SOURCES = \ - pluginmanagerTest.h \ - pluginmanagerTest.cpp \ - TestMain.cpp - -audiorecorderTester_SOURCES = \ - audiorecorderTest.h \ - audiorecorderTest.cpp \ - TestMain.cpp - - -configurationTester_LDADD = \ +numbercleanerTester_LDADD = \ ../src/libsflphone.la \ - $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) $(IAX_LIBS) \ + $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) \ @ALSA_LIBS@ \ @PULSEAUDIO_LIBS@ \ @CPPUNIT_LIBS@ \ @CCEXT2_LIBS@ \ @CCGNU2_LIBS@ \ @CCRTP_LIBS@ \ - @DBUSCPP_LIBS@ \ @SAMPLERATE_LIBS@ \ $(PJSIP_LIBS) \ -luuid \ $(OBJECT_FILES) - + +pluginmanagerTester_SOURCES = \ + pluginmanagerTest.h \ + pluginmanagerTest.cpp \ + TestMain.cpp + pluginmanagerTester_LDADD = \ ../src/libsflphone.la \ - $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) $(IAX_LIBS) \ + $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) \ @ALSA_LIBS@ \ @PULSEAUDIO_LIBS@ \ @CPPUNIT_LIBS@ \ @CCEXT2_LIBS@ \ @CCGNU2_LIBS@ \ @CCRTP_LIBS@ \ - @DBUSCPP_LIBS@ \ @SAMPLERATE_LIBS@ \ $(PJSIP_LIBS) \ -luuid \ $(OBJECT_FILES) - -audiorecorderTester_LDADD = \ + +hookmanagerTester_SOURCES = \ + hookmanagerTest.cpp \ + TestMain.cpp + +hookmanagerTester_LDADD = \ ../src/libsflphone.la \ - $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) $(IAX_LIBS) \ + $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) \ @ALSA_LIBS@ \ @PULSEAUDIO_LIBS@ \ @CPPUNIT_LIBS@ \ @CCEXT2_LIBS@ \ @CCGNU2_LIBS@ \ @CCRTP_LIBS@ \ - @DBUSCPP_LIBS@ \ @SAMPLERATE_LIBS@ \ $(PJSIP_LIBS) \ -luuid \ $(OBJECT_FILES) - + diff --git a/test/README b/test/README new file mode 100644 index 0000000000000000000000000000000000000000..d090ea2cea1700e290c7f42e1e7da091b3ac4f47 --- /dev/null +++ b/test/README @@ -0,0 +1 @@ +The daemon has to be recompiled before compiling the unitary tests. diff --git a/test/TestMain.cpp b/test/TestMain.cpp index 310732ac596991664f6365d5563f3873c4ef5720..1bca8aeab19da9bab970ca4a6d462370aa775493 100644 --- a/test/TestMain.cpp +++ b/test/TestMain.cpp @@ -6,8 +6,7 @@ int main(int argc, const char* argv[]) CppUnit::TextTestRunner runner; runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); - runner.run(); + return runner.run(); - return 0; } diff --git a/test/hookmanagerTest.cpp b/test/hookmanagerTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..071435db7b4f3d8564624b186cc08d6d35b26976 --- /dev/null +++ b/test/hookmanagerTest.cpp @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <stdio.h> +#include <sstream> +#include <dlfcn.h> + +#include "hookmanagerTest.h" + +using std::cout; +using std::endl; + + +void HookManagerTest::setUp(){ + // Instanciate the hook manager singleton + urlhook = new UrlHook (); +} + +void HookManagerTest::testAddAction (){ + + int status; + + status = urlhook->addAction ("www.google.ca", "gnome-www-browser"); + CPPUNIT_ASSERT (status == 0); +} + +void HookManagerTest::tearDown(){ + // Delete the hook manager object + delete urlhook; urlhook=0; +} diff --git a/test/hookmanagerTest.h b/test/hookmanagerTest.h new file mode 100644 index 0000000000000000000000000000000000000000..2c314c7d7f0d8b3f6fe1bfef53e24171167187ec --- /dev/null +++ b/test/hookmanagerTest.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +// Cppunit import +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestCaller.h> +#include <cppunit/TestCase.h> +#include <cppunit/TestSuite.h> + +#include <assert.h> + +// Application import +#include "hooks/urlhook.h" + +/* + * @file hookmanagerTest.cpp + * @brief Regroups unitary tests related to the hook manager. + */ + +#ifndef _HOOKMANAGER_TEST_ +#define _HOOKMANAGER_TEST_ + +class HookManagerTest : public CppUnit::TestCase { + + /** + * Use cppunit library macros to add unit test the factory + */ + CPPUNIT_TEST_SUITE (HookManagerTest); + CPPUNIT_TEST (testAddAction); + CPPUNIT_TEST_SUITE_END (); + + public: + HookManagerTest() : CppUnit::TestCase("Hook Manager Tests") {} + + /* + * Code factoring - Common resources can be initialized here. + * This method is called by unitcpp before each test + */ + void setUp(); + + void testAddAction (); + + /* + * Code factoring - Common resources can be released here. + * This method is called by unitcpp after each test + */ + inline void tearDown (); + + private: + UrlHook *urlhook; +}; + +/* Register our test module */ +CPPUNIT_TEST_SUITE_REGISTRATION( HookManagerTest ); + +#endif diff --git a/test/numbercleanerTest.cpp b/test/numbercleanerTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f6c9a22d8048d1ae2058af8db11f19d6f6363391 --- /dev/null +++ b/test/numbercleanerTest.cpp @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <stdio.h> +#include <sstream> +#include <dlfcn.h> + +#include "numbercleanerTest.h" + +#define NUMBER_TEST_1 "514 333 4444" +#define NUMBER_TEST_2 "514-333-4444" +#define NUMBER_TEST_3 "(514) 333 4444" +#define NUMBER_TEST_4 "(514)-333-4444" +#define NUMBER_TEST_5 "(514) 333-4444" +#define NUMBER_TEST_6 "514 333 4444" +#define NUMBER_TEST_7 "ext 136" +#define NUMBER_TEST_8 "514 333 4444 ext. 136" +#define NUMBER_TEST_9 "514 333 4444 ext 136" +#define NUMBER_TEST_10 "136" + +#define VALID_NUMBER "5143334444" +#define VALID_PREPENDED_NUMBER "95143334444" +#define VALID_EXTENSION "136" + +using std::cout; +using std::endl; + + +void NumberCleanerTest::setUp(){ + // Instanciate the cleaner singleton + cleaner = new NumberCleaner (); +} + +void NumberCleanerTest::test_format_1 (void) { + + CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_1) == VALID_NUMBER); +} + +void NumberCleanerTest::test_format_2 (void) { + + CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_2) == VALID_NUMBER); +} + +void NumberCleanerTest::test_format_3 (void) { + + CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_3) == VALID_NUMBER); +} + +void NumberCleanerTest::test_format_4 (void) { + + CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_4) == VALID_NUMBER); +} + +void NumberCleanerTest::test_format_5 (void) { + + CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_5) == VALID_NUMBER); +} + +void NumberCleanerTest::test_format_6 (void) { + + CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_6) == VALID_NUMBER); +} + +void NumberCleanerTest::test_format_7 (void) { + + CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_7) == VALID_NUMBER); +} + +void NumberCleanerTest::test_format_8 (void) { + + CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_8) == VALID_NUMBER); +} + +void NumberCleanerTest::test_format_9 (void) { + + CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_9) == VALID_NUMBER); +} + +void NumberCleanerTest::test_format_10 (void) { + + cleaner->set_phone_number_prefix ("9"); + CPPUNIT_ASSERT (cleaner->get_phone_number_prefix () == "9"); + CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_1) == VALID_PREPENDED_NUMBER); +} + +void NumberCleanerTest::test_format_11 (void) { + + cleaner->set_phone_number_prefix ("9"); + CPPUNIT_ASSERT (cleaner->get_phone_number_prefix () == "9"); + CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_10) == VALID_EXTENSION); +} +void NumberCleanerTest::tearDown(){ + // Delete the cleaner object + delete cleaner; cleaner=0; +} diff --git a/test/numbercleanerTest.h b/test/numbercleanerTest.h new file mode 100644 index 0000000000000000000000000000000000000000..3152892a0053bcbb43b4e347933bc1bb576b2bca --- /dev/null +++ b/test/numbercleanerTest.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +// Cppunit import +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestCaller.h> +#include <cppunit/TestCase.h> +#include <cppunit/TestSuite.h> + +#include <assert.h> + +// Application import +#include "numbercleaner.h" + +/* + * @file numbercleanerTest.cpp + * @brief Regroups unitary tests related to the phone number cleanup function. + */ + +#ifndef _NUMBERCLEANER_TEST_ +#define _NUMBERCLEANER_TEST_ + +class NumberCleanerTest : public CppUnit::TestCase { + + /** + * Use cppunit library macros to add unit test the factory + */ + CPPUNIT_TEST_SUITE (NumberCleanerTest); + CPPUNIT_TEST (test_format_1); + CPPUNIT_TEST (test_format_2); + CPPUNIT_TEST (test_format_3); + CPPUNIT_TEST (test_format_4); + CPPUNIT_TEST (test_format_5); + CPPUNIT_TEST (test_format_6); + CPPUNIT_TEST (test_format_7); + CPPUNIT_TEST (test_format_8); + CPPUNIT_TEST (test_format_9); + CPPUNIT_TEST (test_format_10); + CPPUNIT_TEST (test_format_11); + CPPUNIT_TEST_SUITE_END (); + + public: + NumberCleanerTest() : CppUnit::TestCase("Hook Manager Tests") {} + + /* + * Code factoring - Common resources can be initialized here. + * This method is called by unitcpp before each test + */ + void setUp(); + + void test_format_1 (); + + void test_format_2 (); + + void test_format_3 (); + + void test_format_4 (); + + void test_format_5 (); + + void test_format_6 (); + + void test_format_7 (); + + void test_format_8 (); + + void test_format_9 (); + + void test_format_10 (); + + void test_format_11 (); + + /* + * Code factoring - Common resources can be released here. + * This method is called by unitcpp after each test + */ + inline void tearDown (); + + private: + NumberCleaner *cleaner; +}; + +/* Register our test module */ +CPPUNIT_TEST_SUITE_REGISTRATION( NumberCleanerTest ); + +#endif diff --git a/test/run-tests b/test/run-tests new file mode 100755 index 0000000000000000000000000000000000000000..9b5d01405c9e5f6883b58946d129ae17b0b43f91 --- /dev/null +++ b/test/run-tests @@ -0,0 +1,24 @@ +#!/bin/bash + +myname="`basename $0`" +failures=0 + +for f in * +do + # Skip ourself + if [ "$f" = "$myname" ]; then + continue + fi + + if [ -x "$f" ]; then + echo + echo "=== Running [$f] test ===" + # Warning, libCppUnit returns 0 on failure. + ./"$f" && { + echo Warning: Failure in $f. + failures=$((failures+1)) + } + fi +done + +echo "Tests finshed, there were $failures failures." diff --git a/tools/build-package.sh b/tools/build-package.sh index ec95e8e38a9d3fb53de97fa94b1d208c8b260b54..215d8545c0cd5a6f05aa6f90361b3674040628d7 100755 --- a/tools/build-package.sh +++ b/tools/build-package.sh @@ -54,7 +54,7 @@ git checkout origin/release -b release # Get system parameters arch_flag=`getconf -a|grep LONG_BIT | sed -e 's/LONG_BIT\s*//'` os_version=`lsb_release -d -s -c | sed -e '1d'` -ver=0.9.4 +ver=0.9.5 if [ $platform == "ubuntu" ];then # Generate the changelog, according to the distribution and the git commit messages diff --git a/tools/sflphone-callto b/tools/sflphone-callto new file mode 100755 index 0000000000000000000000000000000000000000..839f9638479fb29ff47771b1dcb2c03e2397ba88 --- /dev/null +++ b/tools/sflphone-callto @@ -0,0 +1,50 @@ +#!/bin/sh +# +# This script can be used as a callto: (or other) protocol handler in +# Mozilla/Firefox/whatever browser. +# In Firefox use Preferences > Applications and set the callto handler +# to this script. + +# Configuration: +# All you have to do is set this to your account alias name +# (see ~/.sflphone/sflphonedrc file) +ACCOUNT_ALIAS="manu" + +################################################################################ + +# The sflphone daemon config file +RESFILE=~/.sflphone/sflphonedrc + +# Parse sflphonedrc and get account id string from defined alias +if [ -f "$RESFILE" ]; then + ACCOUNTID=`grep -B2 "Account.alias=$ACCOUNT_ALIAS" "$RESFILE" | \ + grep "Account:[0-9]" | \ + head -n 1 | \ + sed -e 's/[^a-zA-Z0-9:]//g' ` +else + echo Fatal: Cant find sflphonedrc config file. + exit 1 +fi + +# Check 1st argument (phone number) +if [ "$1" = "" ]; then + echo "Error: argument 1 (phone number) not provided." + exit 1 +fi + +# Cleanup destination removing callto: prefix +TO="`echo $1 | sed -e 's/callto://'`" + +# Generate call id. +CALLID=${RANDOM}$$ + +dbus-send \ + --type="method_call" \ + --dest="org.sflphone.SFLphone" \ + "/org/sflphone/SFLphone/CallManager" \ + "org.sflphone.SFLphone.CallManager.placeCall" \ + string:"$ACCOUNTID" \ + string:"$CALLID" \ + string:"$TO" + +# EOF