bluez-tools-0.1.38+git662e/0000755000175000017500000000000011476032634015520 5ustar iwamatsuiwamatsubluez-tools-0.1.38+git662e/depcomp0000755000175000017500000004426711472245106017106 0ustar iwamatsuiwamatsu#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi 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 "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$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 "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" 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 "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: bluez-tools-0.1.38+git662e/INSTALL0000644000175000017500000003633211377205651016561 0ustar iwamatsuiwamatsuInstallation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. 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. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. 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, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. 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. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. 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 `..'. This is known as a "VPATH" build. 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. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. 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', where PREFIX must be an absolute file name. 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. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= 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'. 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. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common 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 all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--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. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. bluez-tools-0.1.38+git662e/COPYING0000644000175000017500000004312611076122565016560 0ustar iwamatsuiwamatsu GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. bluez-tools-0.1.38+git662e/aclocal.m40000644000175000017500000012053311472245105017357 0ustar iwamatsuiwamatsu# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR bluez-tools-0.1.38+git662e/ChangeLog0000644000175000017500000000000011376460143017257 0ustar iwamatsuiwamatsubluez-tools-0.1.38+git662e/configure0000755000175000017500000055053611472245105017440 0ustar iwamatsuiwamatsu#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for bluez-tools 0.1.38-662e. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and zxteam@gmail.com $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bluez-tools' PACKAGE_TARNAME='bluez-tools' PACKAGE_VERSION='0.1.38-662e' PACKAGE_STRING='bluez-tools 0.1.38-662e' PACKAGE_BUGREPORT='zxteam@gmail.com' PACKAGE_URL='http://code.google.com/p/bluez-tools/' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS OBEX_FALSE OBEX_TRUE LIBREADLINE DBUS_GLIB_LIBS DBUS_GLIB_CFLAGS GLIB_LIBS GLIB_CFLAGS DBUS_LIBS DBUS_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_obex ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR DBUS_CFLAGS DBUS_LIBS GLIB_CFLAGS GLIB_LIBS DBUS_GLIB_CFLAGS DBUS_GLIB_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures bluez-tools 0.1.38-662e to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/bluez-tools] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of bluez-tools 0.1.38-662e:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-obex disable obex support Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config DBUS_LIBS linker flags for DBUS, overriding pkg-config GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config DBUS_GLIB_CFLAGS C compiler flags for DBUS_GLIB, overriding pkg-config DBUS_GLIB_LIBS linker flags for DBUS_GLIB, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . bluez-tools home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF bluez-tools configure 0.1.38-662e generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------- ## ## Report this to zxteam@gmail.com ## ## ------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by bluez-tools $as_me 0.1.38-662e, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='bluez-tools' VERSION='0.1.38-662e' # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" # The default CFLAGS and CXXFLAGS in Autoconf are "-g -O2" for gcc and just # "-g" for any other compiler. There doesn't seem to be a standard way of # getting rid of the -g (which I don't think is needed for a production # library). This fudge seems to achieve the necessary. First, we remember the # externally set values of CFLAGS and CXXFLAGS. Then call the AC_PROG_CC and # AC_PROG_CXX macros to find the compilers - if CFLAGS and CXXFLAGS are not # set, they will be set to Autoconf's defaults. Afterwards, if the original # values were not set, remove the -g from the Autoconf defaults. # (PH 02-May-07) remember_set_CFLAGS="$CFLAGS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : fi if test "x$remember_set_CFLAGS" = "x" then if test "$CFLAGS" = "-g -O2" then CFLAGS="-O2" elif test "$CFLAGS" = "-g" then CFLAGS="" fi fi if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi # Handle --disable-obex # Check whether --enable-obex was given. if test "${enable_obex+set}" = set; then : enableval=$enable_obex; else enable_obex=yes fi # Checks for header files. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # Check for the availability of dbus and glib libs if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5 $as_echo_n "checking for DBUS... " >&6; } if test -n "$DBUS_CFLAGS"; then pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.2.16\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.2.16") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.2.16" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_LIBS"; then pkg_cv_DBUS_LIBS="$DBUS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.2.16\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.2.16") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.2.16" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "dbus-1 >= 1.2.16" 2>&1` else DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors "dbus-1 >= 1.2.16" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (dbus-1 >= 1.2.16) were not met: $DBUS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DBUS_CFLAGS and DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DBUS_CFLAGS and DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS DBUS_LIBS=$pkg_cv_DBUS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.24.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.24.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.24.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.24.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.24.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.24.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.24.0" 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.24.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0 >= 2.24.0) were not met: $GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_GLIB" >&5 $as_echo_n "checking for DBUS_GLIB... " >&6; } if test -n "$DBUS_GLIB_CFLAGS"; then pkg_cv_DBUS_GLIB_CFLAGS="$DBUS_GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1 >= 0.84\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-glib-1 >= 0.84") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_GLIB_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1 >= 0.84" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_GLIB_LIBS"; then pkg_cv_DBUS_GLIB_LIBS="$DBUS_GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1 >= 0.84\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-glib-1 >= 0.84") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_GLIB_LIBS=`$PKG_CONFIG --libs "dbus-glib-1 >= 0.84" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "dbus-glib-1 >= 0.84" 2>&1` else DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "dbus-glib-1 >= 0.84" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (dbus-glib-1 >= 0.84) were not met: $DBUS_GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DBUS_GLIB_CFLAGS and DBUS_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DBUS_GLIB_CFLAGS and DBUS_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DBUS_GLIB_CFLAGS=$pkg_cv_DBUS_GLIB_CFLAGS DBUS_GLIB_LIBS=$pkg_cv_DBUS_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Check for the availability of libreadline # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in readline/readline.h do : ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" if test "x$ac_cv_header_readline_readline_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_READLINE_READLINE_H 1 _ACEOF HAVE_READLINE_H=1 fi done for ac_header in readline/history.h do : ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" if test "x$ac_cv_header_readline_history_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_READLINE_HISTORY_H 1 _ACEOF HAVE_HISTORY_H=1 fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : HAVE_LIB_READLINE=1 fi if test "$enable_obex" = "yes"; then $as_echo "#define OBEX_SUPPORT /**/" >>confdefs.h if test "$HAVE_READLINE_H" != "1"; then echo "** readline/readline.h was not found." exit 1 fi if test "$HAVE_HISTORY_H" != "1"; then echo "** readline/history.h was not found." exit 1 fi LIBREADLINE="-lreadline" fi if test "$enable_obex" = "yes"; then OBEX_TRUE= OBEX_FALSE='#' else OBEX_TRUE='#' OBEX_FALSE= fi ac_config_files="$ac_config_files Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OBEX_TRUE}" && test -z "${OBEX_FALSE}"; then as_fn_error $? "conditional \"OBEX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by bluez-tools $as_me 0.1.38-662e, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . bluez-tools home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ bluez-tools config.status 0.1.38-662e configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi bluez-tools-0.1.38+git662e/Makefile.in0000644000175000017500000005345411472245106017574 0ustar iwamatsuiwamatsu# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ compile depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBREADLINE = @LIBREADLINE@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ BUILT_SOURCES = $(top_srcdir)/.version CLEANFILES = $(top_srcdir)/.version SUBDIRS = src EXTRA_DIST = git-version-gen all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ ctags-recursive install install-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-hook dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: bluez-tools-0.1.38+git662e/NEWS0000644000175000017500000000000011376460143016204 0ustar iwamatsuiwamatsubluez-tools-0.1.38+git662e/git-version-gen0000755000175000017500000001310511417236656020470 0ustar iwamatsuiwamatsu#!/bin/sh # Print a version string. scriptversion=2010-06-14.19; # UTC # Copyright (C) 2007-2010 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 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. # It may be run two ways: # - from a git repository in which the "git describe" command below # produces useful output (thus requiring at least one signed tag) # - from a non-git-repo directory containing a .tarball-version file, which # presumes this script is invoked like "./git-version-gen .tarball-version". # In order to use intra-version strings in your project, you will need two # separate generated version string files: # # .tarball-version - present only in a distribution tarball, and not in # a checked-out repository. Created with contents that were learned at # the last time autoconf was run, and used by git-version-gen. Must not # be present in either $(srcdir) or $(builddir) for git-version-gen to # give accurate answers during normal development with a checked out tree, # but must be present in a tarball when there is no version control system. # Therefore, it cannot be used in any dependencies. GNUmakefile has # hooks to force a reconfigure at distribution time to get the value # correct, without penalizing normal development with extra reconfigures. # # .version - present in a checked-out repository and in a distribution # tarball. Usable in dependencies, particularly for files that don't # want to depend on config.h but do want to track version changes. # Delete this file prior to any autoconf run where you want to rebuild # files to pick up a version string change; and leave it stale to # minimize rebuild time after unrelated changes to configure sources. # # It is probably wise to add these two files to .gitignore, so that you # don't accidentally commit either generated file. # # Use the following line in your configure.ac, so that $(VERSION) will # automatically be up-to-date each time configure is run (and note that # since configure.ac no longer includes a version string, Makefile rules # should not depend on configure.ac for version updates). # # AC_INIT([GNU project], # m4_esyscmd([build-aux/git-version-gen .tarball-version]), # [bug-project@example]) # # Then use the following lines in your Makefile.am, so that .version # will be present for dependencies, and so that .tarball-version will # exist in distribution tarballs. # # BUILT_SOURCES = $(top_srcdir)/.version # $(top_srcdir)/.version: # echo $(VERSION) > $@-t && mv $@-t $@ # dist-hook: # echo $(VERSION) > $(distdir)/.tarball-version case $# in 1|2) ;; *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version" \ '[TAG-NORMALIZATION-SED-SCRIPT]' exit 1;; esac tarball_version_file=$1 tag_sed_script="${2:-s/x/x/}" nl=' ' # Avoid meddling by environment variable of the same name. v= # First see if there is a tarball-only version file. # then try "git describe", then default. if test -f $tarball_version_file then v=`cat $tarball_version_file` || exit 1 case $v in *$nl*) v= ;; # reject multi-line output [0-9]*) ;; *) v= ;; esac test -z "$v" \ && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2 fi if test -n "$v" then : # use $v elif test -d .git \ && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \ && case $v in v[0-9]*) ;; *) (exit 1) ;; esac then # Is this a new git that lists number of commits since the last # tag or the previous older version that did not? # Newer: v6.10-77-g0f8faeb # Older: v6.10-g0f8faeb case $v in *-*-*) : git describe is okay three part flavor ;; *-*) : git describe is older two part flavor # Recreate the number of commits and rewrite such that the # result is the same as if we were using the newer version # of git describe. vtag=`echo "$v" | sed 's/-.*//'` numcommits=`git rev-list "$vtag"..HEAD | wc -l` v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; ;; esac # Change the first '-' to a '.', so version-comparing tools work properly. # Remove the "g" in git describe's output string, to save a byte. v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; else v=UNKNOWN fi v=`echo "$v" |sed 's/^v//'` # Don't declare a version "dirty" merely because a time stamp has changed. git update-index --refresh > /dev/null 2>&1 dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= case "$dirty" in '') ;; *) # Append the suffix only if there isn't one already. case $v in *-dirty) ;; *) v="$v-dirty" ;; esac ;; esac # Omit the trailing newline, so that m4_esyscmd can use the result directly. echo "$v" | tr -d "$nl" # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: bluez-tools-0.1.38+git662e/Makefile.am0000644000175000017500000000036311472244510017550 0ustar iwamatsuiwamatsuBUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version CLEANFILES = $(top_srcdir)/.version SUBDIRS = src EXTRA_DIST = git-version-gen bluez-tools-0.1.38+git662e/config.h.in0000644000175000017500000000331511472245106017541 0ustar iwamatsuiwamatsu/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Define to allow bluez-tools to be compiled with obex support. */ #undef OBEX_SUPPORT /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS bluez-tools-0.1.38+git662e/compile0000755000175000017500000000727111472245106017101 0ustar iwamatsuiwamatsu#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2009-10-06.20; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software # Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use `[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: bluez-tools-0.1.38+git662e/configure.ac0000644000175000017500000000437011430122145017775 0ustar iwamatsuiwamatsuAC_INIT([bluez-tools], m4_esyscmd([./git-version-gen .tarball-version]), [zxteam@gmail.com], [bluez-tools], [http://code.google.com/p/bluez-tools/]) AC_PREREQ([2.65]) AM_INIT_AUTOMAKE([1.11 no-define foreign -Wall subdir-objects]) AC_CONFIG_HEADERS([config.h]) # The default CFLAGS and CXXFLAGS in Autoconf are "-g -O2" for gcc and just # "-g" for any other compiler. There doesn't seem to be a standard way of # getting rid of the -g (which I don't think is needed for a production # library). This fudge seems to achieve the necessary. First, we remember the # externally set values of CFLAGS and CXXFLAGS. Then call the AC_PROG_CC and # AC_PROG_CXX macros to find the compilers - if CFLAGS and CXXFLAGS are not # set, they will be set to Autoconf's defaults. Afterwards, if the original # values were not set, remove the -g from the Autoconf defaults. # (PH 02-May-07) remember_set_CFLAGS="$CFLAGS" AC_PROG_CC AC_PROG_CC_C99 if test "x$remember_set_CFLAGS" = "x" then if test "$CFLAGS" = "-g -O2" then CFLAGS="-O2" elif test "$CFLAGS" = "-g" then CFLAGS="" fi fi AC_PROG_INSTALL AM_PROG_CC_C_O # Handle --disable-obex AC_ARG_ENABLE(obex, AS_HELP_STRING([--disable-obex], [disable obex support]), , enable_obex=yes) # Checks for header files. AC_HEADER_STDC # Check for the availability of dbus and glib libs PKG_PROG_PKG_CONFIG PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16]) PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.24.0]) PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1 >= 0.84]) # Check for the availability of libreadline AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1]) AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1]) AC_CHECK_LIB([readline], [readline], [HAVE_LIB_READLINE=1]) if test "$enable_obex" = "yes"; then AC_DEFINE([OBEX_SUPPORT], [], [ Define to allow bluez-tools to be compiled with obex support.]) if test "$HAVE_READLINE_H" != "1"; then echo "** readline/readline.h was not found." exit 1 fi if test "$HAVE_HISTORY_H" != "1"; then echo "** readline/history.h was not found." exit 1 fi LIBREADLINE="-lreadline" fi AC_SUBST(LIBREADLINE) AM_CONDITIONAL(OBEX, test "$enable_obex" = "yes") AC_CONFIG_FILES([Makefile src/Makefile]) AC_OUTPUT bluez-tools-0.1.38+git662e/.tarball-version0000644000175000017500000000001411472245124020614 0ustar iwamatsuiwamatsu0.1.38-662e bluez-tools-0.1.38+git662e/README0000644000175000017500000000355511472243002016375 0ustar iwamatsuiwamatsubluez-tools =========== This is a GSoC'10 project to implement a new command line tools for bluez (bluetooth stack for linux). The project implemented in C and uses the D-Bus interface of bluez. Project website: http://code.google.com/p/bluez-tools/ Project Git repository: http://gitorious.org/bluez-tools/ bt-adapter ========== - List available adapters - Show information about adapter (incl properties) - Discover remote devices (with remote device name resolving) - Change adapter properties (eg. Name, Discoverable, Pairable, etc) bt-agent ======== - Manage incoming Bluetooth requests (eg. request of pincode, request of authorize a connection/service request, etc) bt-audio ======== - Connecting to audio devices bt-device ========= - List added devices - Connect to the remote device by his MAC, retrieve all SDP records and then initiate the pairing - Disconnect the remote device - Remove device (and also the pairing information) - Show information about device (incl properties) - Service discovery - Change device properties (eg. Name, Trusted, Blocked, etc) bt-input ======== - Connecting to input devices bt-monitor ========== - Capturing D-Bus signals of bluetoothd bt-network ========== - Connect to the network device - Register network server for the provided UUID (gn/panu/nap) bt-serial ========= - Connects to a specific RFCOMM based service on a remote device and then creates a RFCOMM TTY device for it bt-obex ======= - Agent (to accept/reject incoming bluetooth object push requests) for OBEXD (OPP/FTP profile) - Send local file to the specified remote device using object push profile - Start FTP session with remote device Requirements ============ bluez-tools pre v0.2 uses bluez-4.69 and obexd-0.30 API's Known Issues ============ - FTP session closes unexpectedly after the command "ls" (bug in OBEXD?) - Copy/Move methods not yet implemented (OBEXD) bluez-tools-0.1.38+git662e/AUTHORS0000644000175000017500000000004511376460713016571 0ustar iwamatsuiwamatsuAlexander Orlenko bluez-tools-0.1.38+git662e/install-sh0000755000175000017500000003253711472245106017532 0ustar iwamatsuiwamatsu#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: bluez-tools-0.1.38+git662e/missing0000755000175000017500000002623311472245106017121 0ustar iwamatsuiwamatsu#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi 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] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # 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). This is about non-GNU programs, so use $1 not # $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 $program 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 $? 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: bluez-tools-0.1.38+git662e/src/0000755000175000017500000000000011472245124016303 5ustar iwamatsuiwamatsubluez-tools-0.1.38+git662e/src/bt-device.10000644000175000017500000001617011472236011020227 0ustar iwamatsuiwamatsu.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "bt-device 1" .TH bt-device 1 "2010-11-22" "" "bluez-tools" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" bt\-device \- a bluetooth device manager .SH "SYNOPSIS" .IX Header "SYNOPSIS" bt-device [\s-1OPTION\s0...] .PP Help Options: \-h, \-\-help .PP Application Options: \-a, \-\-adapter= \-l, \-\-list \-c, \-\-connect= \-d, \-\-disconnect= \-r, \-\-remove= \-i, \-\-info= \-s, \-\-services [] \-\-set \-v, \-\-verbose .SH "DESCRIPTION" .IX Header "DESCRIPTION" This utility is used to manage Bluetooth devices. You can list added devices, connect to a new device, disconnect device, remove added device, show info about device, discover remote device services or change device properties. .SH "OPTIONS" .IX Header "OPTIONS" \&\fB\-h, \-\-help\fR Show help .PP \&\fB\-a, \-\-adapter \fR Specify adapter to use by his Name or \s-1MAC\s0 address (if this option does not defined \- default adapter used) .PP \&\fB\-l, \-\-list\fR List added devices .PP \&\fB\-c, \-\-connect \fR Connect to the remote device by his \s-1MAC\s0, retrieve all \s-1SDP\s0 records and then initiate the pairing .PP \&\fB\-d, \-\-disconnect \fR Disconnects a specific remote device by terminating the low-level \s-1ACL\s0 connection. .PP \&\fB\-r, \-\-remove\fR Remove device (and also the pairing information) .PP \&\fB\-i, \-\-info\fR Show information about device (returns all properties) .PP \&\fB\-s, \-\-services []\fR Starts the service discovery to retrieve remote service records, the `pattern` parameter can be used to specify specific UUIDs .PP \&\fB\-\-set \fR Change device properties (see \s-1DEVICE\s0 \s-1PROPERTIES\s0 section for list of available properties) .PP \&\fB\-v, \-\-verbose\fR Verbosely display remote service records (affect to service discovery mode) .SH "DEVICE PROPERTIES" .IX Header "DEVICE PROPERTIES" string Address [ro] The Bluetooth device address (\s-1MAC\s0) of the remote device. .PP string Name [ro] The Bluetooth remote device name. .PP string Icon [ro] Proposed icon name according to the freedesktop.org icon naming specification. .PP uint32 Class [ro] The Bluetooth class of device of the remote device. .PP list UUIDs [ro] List of 128\-bit UUIDs that represents the available remote services. .PP boolean Paired [ro] Indicates if the remote device is paired. .PP boolean Connected [ro] Indicates if the remote device is currently connected. .PP boolean Trusted [rw] Indicates if the remote is seen as trusted. .PP boolean Blocked [rw] If set to true any incoming connections from the device will be immediately rejected. .PP string Alias [rw] The name alias for the remote device. The alias can be used to have a different friendly name for the remote device. .PP .Vb 3 \& In case no alias is set, it will return the remote \& device name. Setting an empty string as alias will \& convert it back to the remote device name. .Ve .PP boolean LegacyPairing [ro] Set to true if the device only supports the pre\-2.1 pairing mechanism. .SH "AUTHOR" .IX Header "AUTHOR" Alexander Orlenko . .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIbt\-adapter\fR\|(1) \fIbt\-agent\fR\|(1) \fIbt\-audio\fR\|(1) \fIbt\-input\fR\|(1) \fIbt\-monitor\fR\|(1) \fIbt\-network\fR\|(1) \fIbt\-serial\fR\|(1) bluez-tools-0.1.38+git662e/src/bt-input.c0000644000175000017500000001071111463542671020220 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "lib/dbus-common.h" #include "lib/helpers.h" #include "lib/bluez-api.h" static void input_property_changed(Input *input, const gchar *name, const GValue *value, gpointer data) { g_assert(data != NULL); GMainLoop *mainloop = data; if (g_strcmp0(name, "Connected") == 0) { if (g_value_get_boolean(value) == TRUE) { g_print("Input service is connected\n"); } else { g_print("Input service is disconnected\n"); } g_main_loop_quit(mainloop); } } static gchar *adapter_arg = NULL; static gchar *connect_arg = NULL; static gchar *disconnect_arg = NULL; static GOptionEntry entries[] = { {"adapter", 'a', 0, G_OPTION_ARG_STRING, &adapter_arg, "Adapter Name or MAC", ""}, {"connect", 'c', 0, G_OPTION_ARG_STRING, &connect_arg, "Connect to the input device", ""}, {"disconnect", 'd', 0, G_OPTION_ARG_STRING, &disconnect_arg, "Disconnect from the input device", ""}, {NULL} }; int main(int argc, char *argv[]) { GError *error = NULL; GOptionContext *context; /* Query current locale */ setlocale(LC_CTYPE, ""); g_type_init(); dbus_init(); context = g_option_context_new("- a bluetooth input manager"); g_option_context_add_main_entries(context, entries, NULL); g_option_context_set_summary(context, "Version "PACKAGE_VERSION); g_option_context_set_description(context, //"Report bugs to <"PACKAGE_BUGREPORT">." "Project home page <"PACKAGE_URL">." ); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("%s: %s\n", g_get_prgname(), error->message); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } else if ((!connect_arg || strlen(connect_arg) == 0) && (!disconnect_arg || strlen(disconnect_arg) == 0)) { g_print("%s", g_option_context_get_help(context, FALSE, NULL)); exit(EXIT_FAILURE); } g_option_context_free(context); if (!dbus_system_connect(&error)) { g_printerr("Couldn't connect to DBus system bus: %s\n", error->message); exit(EXIT_FAILURE); } /* Check, that bluetooth daemon is running */ if (!intf_supported(BLUEZ_DBUS_NAME, MANAGER_DBUS_PATH, MANAGER_DBUS_INTERFACE)) { g_printerr("%s: bluez service is not found\n", g_get_prgname()); g_printerr("Did you forget to run bluetoothd?\n"); exit(EXIT_FAILURE); } Adapter *adapter = find_adapter(adapter_arg, &error); exit_if_error(error); Device *device = find_device(adapter, connect_arg != NULL ? connect_arg : disconnect_arg, &error); exit_if_error(error); if (!intf_supported(BLUEZ_DBUS_NAME, device_get_dbus_object_path(device), INPUT_DBUS_INTERFACE)) { g_printerr("Input service is not supported by this device\n"); exit(EXIT_FAILURE); } GMainLoop *mainloop = g_main_loop_new(NULL, FALSE); Input *input = g_object_new(INPUT_TYPE, "DBusObjectPath", device_get_dbus_object_path(device), NULL); g_signal_connect(input, "PropertyChanged", G_CALLBACK(input_property_changed), mainloop); if (connect_arg) { if (input_get_connected(input) == TRUE) { g_print("Input service is already connected\n"); } else { input_connect(input, &error); exit_if_error(error); g_main_loop_run(mainloop); } } else if (disconnect_arg) { if (input_get_connected(input) == FALSE) { g_print("Input service is already disconnected\n"); } else { input_disconnect(input, &error); exit_if_error(error); g_main_loop_run(mainloop); } } g_main_loop_unref(mainloop); g_object_unref(input); g_object_unref(device); g_object_unref(adapter); dbus_disconnect(); exit(EXIT_SUCCESS); } bluez-tools-0.1.38+git662e/src/bt-audio.10000644000175000017500000001133411472236011020066 0ustar iwamatsuiwamatsu.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "bt-audio 1" .TH bt-audio 1 "2010-08-11" "" "bluez-tools" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" bt\-audio \- a bluetooth generic audio manager .SH "SYNOPSIS" .IX Header "SYNOPSIS" bt-audio [\s-1OPTION\s0...] .PP Help Options: \-h, \-\-help .PP Application Options: \-a, \-\-adapter= \-c, \-\-connect= \-d, \-\-disconnect= .SH "DESCRIPTION" .IX Header "DESCRIPTION" This utility is used to manage outgoing audio service connections. .SH "OPTIONS" .IX Header "OPTIONS" \&\fB\-h, \-\-help\fR Show help .PP \&\fB\-a, \-\-adapter \fR Specify adapter to use by his Name or \s-1MAC\s0 address (if this option does not defined \- default adapter used) .PP \&\fB\-c, \-\-connect \fR Connect all supported audio profiles on the device .PP \&\fB\-d, \-\-disconnect \fR Disconnect all audio profiles on the device .SH "AUTHOR" .IX Header "AUTHOR" Alexander Orlenko . .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIbt\-adapter\fR\|(1) \fIbt\-agent\fR\|(1) \fIbt\-device\fR\|(1) \fIbt\-input\fR\|(1) \fIbt\-monitor\fR\|(1) \fIbt\-network\fR\|(1) \fIbt\-serial\fR\|(1) bluez-tools-0.1.38+git662e/src/bt-monitor.10000644000175000017500000001155711472236011020463 0ustar iwamatsuiwamatsu.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "bt-monitor 1" .TH bt-monitor 1 "2010-08-16" "" "bluez-tools" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" bt\-monitor \- a bluetooth monitor .SH "SYNOPSIS" .IX Header "SYNOPSIS" bt-monitor [\s-1OPTION\s0...] .PP Help Options: \-h, \-\-help .PP Application Options: \-a, \-\-adapter= .SH "DESCRIPTION" .IX Header "DESCRIPTION" This utility is used to capture DBus signals of bluetoothd. Captured next signals: .PP \&\fBManager signals\fR: AdapterAdded AdapterRemoved DefaultAdapterChanged .PP \&\fBAdapter signals\fR: DeviceCreated DeviceDisappeared DeviceFound DeviceRemoved AdapterPropertyChanged .PP \&\fBDevice signals\fR: DisconnectRequested DevicePropertyChanged .PP \&\fBServices signals\fR: AudioServiceConnected InputServiceConnected NetworkServiceConnected .SH "OPTIONS" .IX Header "OPTIONS" \&\fB\-h, \-\-help\fR Show help .PP \&\fB\-a, \-\-adapter \fR Specify adapter to capture by his Name or \s-1MAC\s0 address (if this option does not defined \- all adapters captured) .SH "AUTHOR" .IX Header "AUTHOR" Alexander Orlenko . .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIbt\-adapter\fR\|(1) \fIbt\-agent\fR\|(1) \fIbt\-audio\fR\|(1) \fIbt\-device\fR\|(1) \fIbt\-input\fR\|(1) \fIbt\-network\fR\|(1) \fIbt\-serial\fR\|(1) bluez-tools-0.1.38+git662e/src/bt-serial.10000644000175000017500000001167311472236012020253 0ustar iwamatsuiwamatsu.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "bt-serial 1" .TH bt-serial 1 "2010-08-12" "" "bluez-tools" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" bt\-serial \- a bluetooth serial manager .SH "SYNOPSIS" .IX Header "SYNOPSIS" bt-serial [\s-1OPTION\s0...] .PP Help Options: \-h, \-\-help .PP Application Options: \-a, \-\-adapter= \-c, \-\-connect \-d, \-\-disconnect .SH "DESCRIPTION" .IX Header "DESCRIPTION" This utility is used to manage serial service connections. .SH "OPTIONS" .IX Header "OPTIONS" \&\fB\-h, \-\-help\fR Show help .PP \&\fB\-a, \-\-adapter \fR Specify adapter to use by his Name or \s-1MAC\s0 address (if this option does not defined \- default adapter used) .PP \&\fB\-c, \-\-connect \fR Connects to a specific \s-1RFCOMM\s0 based service on a remote device and then creates a \s-1RFCOMM\s0 \s-1TTY\s0 device for it; `pattern` is a profile short name (spp, dun), \s-1RFCOMM\s0 channel (1\-30) .PP \&\fB\-d, \-\-disconnect \fR Disconnect a \s-1RFCOMM\s0 \s-1TTY\s0 device that has been created .SH "AUTHOR" .IX Header "AUTHOR" Alexander Orlenko . .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIbt\-adapter\fR\|(1) \fIbt\-agent\fR\|(1) \fIbt\-audio\fR\|(1) \fIbt\-device\fR\|(1) \fIbt\-input\fR\|(1) \fIbt\-monitor\fR\|(1) \fIbt\-network\fR\|(1) bluez-tools-0.1.38+git662e/src/bt-serial.c0000644000175000017500000001206011463544057020337 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "lib/dbus-common.h" #include "lib/helpers.h" #include "lib/bluez-api.h" static gchar *adapter_arg = NULL; static gboolean connect_arg = FALSE; static gchar *connect_device_arg = NULL; static gchar *connect_service_arg = NULL; static gboolean disconnect_arg = FALSE; static gchar *disconnect_device_arg = NULL; static gchar *disconnect_tty_device_arg = NULL; static GOptionEntry entries[] = { {"adapter", 'a', 0, G_OPTION_ARG_STRING, &adapter_arg, "Adapter Name or MAC", ""}, {"connect", 'c', 0, G_OPTION_ARG_NONE, &connect_arg, "Connect to the serial device", NULL}, {"disconnect", 'd', 0, G_OPTION_ARG_NONE, &disconnect_arg, "Disconnect from the serial device", NULL}, {NULL} }; int main(int argc, char *argv[]) { GError *error = NULL; GOptionContext *context; /* Query current locale */ setlocale(LC_CTYPE, ""); g_type_init(); dbus_init(); context = g_option_context_new(" - a bluetooth serial manager"); g_option_context_add_main_entries(context, entries, NULL); g_option_context_set_summary(context, "Version "PACKAGE_VERSION); g_option_context_set_description(context, "Connect Options:\n" " -c, --connect \n" " Where\n" " `name|mac` is a device Name or MAC\n" " `pattern` is:\n" " UUID 128 bit string\n" " Profile short name, e.g: spp, dun\n" " RFCOMM channel, 1-30\n\n" "Disconnect Options:\n" " -d, --disconnect \n" " Where\n" " `name|mac` is a device Name or MAC\n" " `tty_device` is a RFCOMM TTY device that has been connected\n\n" //"Report bugs to <"PACKAGE_BUGREPORT">." "Project home page <"PACKAGE_URL">." ); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("%s: %s\n", g_get_prgname(), error->message); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } else if (!connect_arg && !disconnect_arg) { g_print("%s", g_option_context_get_help(context, FALSE, NULL)); exit(EXIT_FAILURE); } else if (connect_arg && (argc != 3 || strlen(argv[1]) == 0 || strlen(argv[2]) == 0)) { g_print("%s: Invalid arguments for --connect\n", g_get_prgname()); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } else if (disconnect_arg && (argc != 3 || strlen(argv[1]) == 0 || strlen(argv[2]) == 0)) { g_print("%s: Invalid arguments for --disconnect\n", g_get_prgname()); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } g_option_context_free(context); if (connect_arg) { connect_device_arg = argv[1]; connect_service_arg = argv[2]; } else { disconnect_device_arg = argv[1]; disconnect_tty_device_arg = argv[2]; } if (!dbus_system_connect(&error)) { g_printerr("Couldn't connect to DBus system bus: %s\n", error->message); exit(EXIT_FAILURE); } /* Check, that bluetooth daemon is running */ if (!intf_supported(BLUEZ_DBUS_NAME, MANAGER_DBUS_PATH, MANAGER_DBUS_INTERFACE)) { g_printerr("%s: bluez service is not found\n", g_get_prgname()); g_printerr("Did you forget to run bluetoothd?\n"); exit(EXIT_FAILURE); } Adapter *adapter = find_adapter(adapter_arg, &error); exit_if_error(error); Device *device = find_device(adapter, connect_device_arg != NULL ? connect_device_arg : disconnect_device_arg, &error); exit_if_error(error); if (!intf_supported(BLUEZ_DBUS_NAME, device_get_dbus_object_path(device), SERIAL_DBUS_INTERFACE)) { g_printerr("Serial service is not supported by this device\n"); exit(EXIT_FAILURE); } Serial *serial = g_object_new(SERIAL_TYPE, "DBusObjectPath", device_get_dbus_object_path(device), NULL); if (connect_arg) { gchar *tty_device = serial_connect(serial, connect_service_arg, &error); exit_if_error(error); g_print("Created RFCOMM TTY device: %s\n", tty_device); g_free(tty_device); } else if (disconnect_arg) { serial_disconnect(serial, disconnect_tty_device_arg, &error); exit_if_error(error); g_print("Done\n"); } g_object_unref(serial); g_object_unref(device); g_object_unref(adapter); dbus_disconnect(); exit(EXIT_SUCCESS); } bluez-tools-0.1.38+git662e/src/bt-adapter.c0000644000175000017500000002426311463542265020507 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "lib/dbus-common.h" #include "lib/helpers.h" #include "lib/bluez-api.h" static void adapter_device_found(Adapter *adapter, const gchar *address, GHashTable *values, gpointer data) { g_assert(data != NULL); GHashTable *found_devices = data; if (g_hash_table_lookup(found_devices, address) != NULL) { return; } if (g_hash_table_size(found_devices) == 0) g_print("\n"); g_print("[%s]\n", address); g_print(" Name: %s\n", g_hash_table_lookup(values, "Name") != NULL ? g_value_get_string(g_hash_table_lookup(values, "Name")) : NULL); g_print(" Alias: %s\n", g_hash_table_lookup(values, "Alias") != NULL ? g_value_get_string(g_hash_table_lookup(values, "Alias")) : NULL); g_print(" Address: %s\n", g_value_get_string(g_hash_table_lookup(values, "Address"))); g_print(" Icon: %s\n", g_value_get_string(g_hash_table_lookup(values, "Icon"))); g_print(" Class: 0x%x\n", g_value_get_uint(g_hash_table_lookup(values, "Class"))); g_print(" LegacyPairing: %d\n", g_value_get_boolean(g_hash_table_lookup(values, "LegacyPairing"))); g_print(" Paired: %d\n", g_value_get_boolean(g_hash_table_lookup(values, "Paired"))); g_print(" RSSI: %d\n", g_value_get_int(g_hash_table_lookup(values, "RSSI"))); g_print("\n"); g_hash_table_insert(found_devices, g_strdup(address), g_value_dup_string(g_hash_table_lookup(values, "Alias"))); } /* static void adapter_device_disappeared(Adapter *adapter, const gchar *address, gpointer data) { g_assert(data != NULL); GHashTable *found_devices = data; g_print("Device disappeared: %s (%s)\n", g_value_get_string(g_hash_table_lookup(found_devices, address)), address); } */ static void adapter_property_changed(Adapter *adapter, const gchar *name, const GValue *value, gpointer data) { g_assert(data != NULL); GMainLoop *mainloop = data; if (g_strcmp0(name, "Discovering") == 0 && g_value_get_boolean(value) == FALSE) { g_main_loop_quit(mainloop); } } static gboolean list_arg = FALSE; static gchar *adapter_arg = NULL; static gboolean info_arg = FALSE; static gboolean discover_arg = FALSE; static gboolean set_arg = FALSE; static gchar *set_property_arg = NULL; static gchar *set_value_arg = NULL; static GOptionEntry entries[] = { {"list", 'l', 0, G_OPTION_ARG_NONE, &list_arg, "List all available adapters", NULL}, {"adapter", 'a', 0, G_OPTION_ARG_STRING, &adapter_arg, "Adapter Name or MAC", ""}, {"info", 'i', 0, G_OPTION_ARG_NONE, &info_arg, "Show adapter info", NULL}, {"discover", 'd', 0, G_OPTION_ARG_NONE, &discover_arg, "Discover remote devices", NULL}, {"set", 0, 0, G_OPTION_ARG_NONE, &set_arg, "Set adapter property", NULL}, {NULL} }; int main(int argc, char *argv[]) { GError *error = NULL; GOptionContext *context; /* Query current locale */ setlocale(LC_CTYPE, ""); g_type_init(); dbus_init(); context = g_option_context_new("- a bluetooth adapter manager"); g_option_context_add_main_entries(context, entries, NULL); g_option_context_set_summary(context, "Version "PACKAGE_VERSION); g_option_context_set_description(context, "Set Options:\n" " --set \n" " Where `property` is one of:\n" " Name\n" " Discoverable\n" " DiscoverableTimeout\n" " Pairable\n" " PairableTimeout\n" " Powered\n\n" //"Report bugs to <"PACKAGE_BUGREPORT">." "Project home page <"PACKAGE_URL">." ); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("%s: %s\n", g_get_prgname(), error->message); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } else if (!list_arg && !info_arg && !discover_arg && !set_arg) { g_print("%s", g_option_context_get_help(context, FALSE, NULL)); exit(EXIT_FAILURE); } else if (set_arg && (argc != 3 || strlen(argv[1]) == 0 || strlen(argv[2]) == 0)) { g_print("%s: Invalid arguments for --set\n", g_get_prgname()); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } g_option_context_free(context); if (!dbus_system_connect(&error)) { g_printerr("Couldn't connect to DBus system bus: %s\n", error->message); exit(EXIT_FAILURE); } /* Check, that bluetooth daemon is running */ if (!intf_supported(BLUEZ_DBUS_NAME, MANAGER_DBUS_PATH, MANAGER_DBUS_INTERFACE)) { g_printerr("%s: bluez service is not found\n", g_get_prgname()); g_printerr("Did you forget to run bluetoothd?\n"); exit(EXIT_FAILURE); } Manager *manager = g_object_new(MANAGER_TYPE, NULL); if (list_arg) { const GPtrArray *adapters_list = manager_get_adapters(manager); g_assert(adapters_list != NULL); if (adapters_list->len == 0) { g_print("No adapters found\n"); exit(EXIT_FAILURE); } g_print("Available adapters:\n"); for (int i = 0; i < adapters_list->len; i++) { const gchar *adapter_path = g_ptr_array_index(adapters_list, i); Adapter *adapter = g_object_new(ADAPTER_TYPE, "DBusObjectPath", adapter_path, NULL); g_print("%s (%s)\n", adapter_get_name(adapter), adapter_get_address(adapter)); g_object_unref(adapter); } } else if (info_arg) { Adapter *adapter = find_adapter(adapter_arg, &error); exit_if_error(error); gchar *adapter_intf = g_path_get_basename(adapter_get_dbus_object_path(adapter)); g_print("[%s]\n", adapter_intf); g_print(" Name: %s [rw]\n", adapter_get_name(adapter)); g_print(" Address: %s\n", adapter_get_address(adapter)); g_print(" Class: 0x%x\n", adapter_get_class(adapter)); g_print(" Discoverable: %d [rw]\n", adapter_get_discoverable(adapter)); g_print(" DiscoverableTimeout: %d [rw]\n", adapter_get_discoverable_timeout(adapter)); g_print(" Discovering: %d\n", adapter_get_discovering(adapter)); g_print(" Pairable: %d [rw]\n", adapter_get_pairable(adapter)); g_print(" PairableTimeout: %d [rw]\n", adapter_get_pairable_timeout(adapter)); g_print(" Powered: %d [rw]\n", adapter_get_powered(adapter)); g_print(" UUIDs: ["); const gchar **uuids = adapter_get_uuids(adapter); for (int j = 0; uuids[j] != NULL; j++) { if (j > 0) g_print(", "); g_print("%s", uuid2name(uuids[j])); } g_print("]\n"); g_free(adapter_intf); g_object_unref(adapter); } else if (discover_arg) { Adapter *adapter = find_adapter(adapter_arg, &error); exit_if_error(error); // To store pairs MAC => Name GHashTable *found_devices = g_hash_table_new(g_str_hash, g_str_equal); // Mainloop GMainLoop *mainloop = g_main_loop_new(NULL, FALSE); g_signal_connect(adapter, "DeviceFound", G_CALLBACK(adapter_device_found), found_devices); //g_signal_connect(adapter, "DeviceDisappeared", G_CALLBACK(adapter_device_disappeared), found_devices); g_signal_connect(adapter, "PropertyChanged", G_CALLBACK(adapter_property_changed), mainloop); g_print("Searching...\n"); adapter_start_discovery(adapter, &error); exit_if_error(error); g_main_loop_run(mainloop); /* Discovering process here... */ g_main_loop_unref(mainloop); g_print("Done\n"); g_hash_table_unref(found_devices); g_object_unref(adapter); } else if (set_arg) { set_property_arg = argv[1]; set_value_arg = argv[2]; Adapter *adapter = find_adapter(adapter_arg, &error); exit_if_error(error); GValue v = {0,}; if (g_strcmp0(set_property_arg, "Name") == 0) { g_value_init(&v, G_TYPE_STRING); g_value_set_string(&v, set_value_arg); } else if ( g_strcmp0(set_property_arg, "Discoverable") == 0 || g_strcmp0(set_property_arg, "Pairable") == 0 || g_strcmp0(set_property_arg, "Powered") == 0 ) { g_value_init(&v, G_TYPE_BOOLEAN); if (g_strcmp0(set_value_arg, "0") == 0 || g_ascii_strcasecmp(set_value_arg, "FALSE") == 0 || g_ascii_strcasecmp(set_value_arg, "OFF") == 0) { g_value_set_boolean(&v, FALSE); } else if (g_strcmp0(set_value_arg, "1") == 0 || g_ascii_strcasecmp(set_value_arg, "TRUE") == 0 || g_ascii_strcasecmp(set_value_arg, "ON") == 0) { g_value_set_boolean(&v, TRUE); } else { g_print("%s: Invalid boolean value: %s\n", g_get_prgname(), set_value_arg); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } } else if ( g_strcmp0(set_property_arg, "DiscoverableTimeout") == 0 || g_strcmp0(set_property_arg, "PairableTimeout") == 0 ) { g_value_init(&v, G_TYPE_UINT); g_value_set_uint(&v, (guint) atoi(set_value_arg)); } else { g_print("%s: Invalid property: %s\n", g_get_prgname(), set_property_arg); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } GHashTable *props = adapter_get_properties(adapter, &error); exit_if_error(error); GValue *old_value = g_hash_table_lookup(props, set_property_arg); g_assert(old_value != NULL); if (G_VALUE_HOLDS_STRING(old_value)) { g_print("%s: %s -> %s\n", set_property_arg, g_value_get_string(old_value), g_value_get_string(&v)); } else if (G_VALUE_HOLDS_BOOLEAN(old_value)) { g_print("%s: %d -> %d\n", set_property_arg, g_value_get_boolean(old_value), g_value_get_boolean(&v)); } else if (G_VALUE_HOLDS_UINT(old_value)) { g_print("%s: %d -> %d\n", set_property_arg, g_value_get_uint(old_value), g_value_get_uint(&v)); } g_hash_table_unref(props); adapter_set_property(adapter, set_property_arg, &v, &error); exit_if_error(error); g_value_unset(&v); g_object_unref(adapter); } g_object_unref(manager); dbus_disconnect(); exit(EXIT_SUCCESS); } bluez-tools-0.1.38+git662e/src/bt-network.10000644000175000017500000001176111472236012020463 0ustar iwamatsuiwamatsu.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "bt-network 1" .TH bt-network 1 "2010-11-22" "" "bluez-tools" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" bt\-network \- a bluetooth network manager .SH "SYNOPSIS" .IX Header "SYNOPSIS" bt-network [\s-1OPTION\s0...] .PP Help Options: \-h, \-\-help .PP Application Options: \-a, \-\-adapter= \-c, \-\-connect \-s, \-\-server .SH "DESCRIPTION" .IX Header "DESCRIPTION" This utility is used to manage network services (client/server). All servers will be automatically unregistered when the application terminates. .SH "OPTIONS" .IX Header "OPTIONS" \&\fB\-h, \-\-help\fR Show help .PP \&\fB\-a, \-\-adapter \fR Specify adapter to use by his Name or \s-1MAC\s0 address (if this option does not defined \- default adapter used) .PP \&\fB\-c, \-\-connect \fR Connect to the network device and return the network interface name, uuid can be either one of \*(L"gn\*(R", \*(L"panu\*(R" or \*(L"nap\*(R" .PP \&\fB\-s, \-\-server \fR Register server for the provided \s-1UUID\s0, every new connection to this server will be added the bridge interface .SH "AUTHOR" .IX Header "AUTHOR" Alexander Orlenko . .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIbt\-adapter\fR\|(1) \fIbt\-agent\fR\|(1) \fIbt\-audio\fR\|(1) \fIbt\-device\fR\|(1) \fIbt\-input\fR\|(1) \fIbt\-monitor\fR\|(1) \fIbt\-serial\fR\|(1) bluez-tools-0.1.38+git662e/src/Makefile.in0000644000175000017500000011627511472245106020364 0ustar iwamatsuiwamatsu# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : @OBEX_TRUE@am__append_1 = lib/obexd-api.h bin_PROGRAMS = bt-monitor$(EXEEXT) bt-adapter$(EXEEXT) \ bt-agent$(EXEEXT) bt-device$(EXEEXT) bt-input$(EXEEXT) \ bt-audio$(EXEEXT) bt-network$(EXEEXT) bt-serial$(EXEEXT) \ $(am__EXEEXT_1) @OBEX_TRUE@am__append_2 = bt-obex @OBEX_TRUE@am__append_3 = bt-obex.1 subdir = src DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @OBEX_TRUE@am__EXEEXT_1 = bt-obex$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__bt_adapter_SOURCES_DIST = lib/marshallers.c lib/marshallers.h \ lib/dbus-common.c lib/dbus-common.h lib/helpers.c \ lib/helpers.h lib/sdp.c lib/sdp.h lib/bluez-api.h \ lib/obexd-api.h lib/bluez/adapter.c lib/bluez/adapter.h \ lib/bluez/agent.c lib/bluez/agent.h lib/bluez/audio.c \ lib/bluez/audio.h lib/bluez/device.c lib/bluez/device.h \ lib/bluez/input.c lib/bluez/input.h lib/bluez/manager.c \ lib/bluez/manager.h lib/bluez/network.c lib/bluez/network.h \ lib/bluez/network_server.c lib/bluez/network_server.h \ lib/bluez/serial.c lib/bluez/serial.h lib/obexd/obexagent.c \ lib/obexd/obexagent.h lib/obexd/obexclient.c \ lib/obexd/obexclient.h lib/obexd/obexclient_file_transfer.c \ lib/obexd/obexclient_file_transfer.h \ lib/obexd/obexclient_session.c lib/obexd/obexclient_session.h \ lib/obexd/obexclient_transfer.c \ lib/obexd/obexclient_transfer.h lib/obexd/obexmanager.c \ lib/obexd/obexmanager.h lib/obexd/obexsession.c \ lib/obexd/obexsession.h lib/obexd/obextransfer.c \ lib/obexd/obextransfer.h bt-adapter.c am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = am__objects_2 = lib/marshallers.$(OBJEXT) lib/dbus-common.$(OBJEXT) \ lib/helpers.$(OBJEXT) lib/sdp.$(OBJEXT) $(am__objects_1) am__objects_3 = lib/bluez/adapter.$(OBJEXT) lib/bluez/agent.$(OBJEXT) \ lib/bluez/audio.$(OBJEXT) lib/bluez/device.$(OBJEXT) \ lib/bluez/input.$(OBJEXT) lib/bluez/manager.$(OBJEXT) \ lib/bluez/network.$(OBJEXT) lib/bluez/network_server.$(OBJEXT) \ lib/bluez/serial.$(OBJEXT) @OBEX_TRUE@am__objects_4 = lib/obexd/obexagent.$(OBJEXT) \ @OBEX_TRUE@ lib/obexd/obexclient.$(OBJEXT) \ @OBEX_TRUE@ lib/obexd/obexclient_file_transfer.$(OBJEXT) \ @OBEX_TRUE@ lib/obexd/obexclient_session.$(OBJEXT) \ @OBEX_TRUE@ lib/obexd/obexclient_transfer.$(OBJEXT) \ @OBEX_TRUE@ lib/obexd/obexmanager.$(OBJEXT) \ @OBEX_TRUE@ lib/obexd/obexsession.$(OBJEXT) \ @OBEX_TRUE@ lib/obexd/obextransfer.$(OBJEXT) am_bt_adapter_OBJECTS = $(am__objects_2) $(am__objects_3) \ $(am__objects_4) bt-adapter.$(OBJEXT) bt_adapter_OBJECTS = $(am_bt_adapter_OBJECTS) bt_adapter_LDADD = $(LDADD) am__bt_agent_SOURCES_DIST = lib/marshallers.c lib/marshallers.h \ lib/dbus-common.c lib/dbus-common.h lib/helpers.c \ lib/helpers.h lib/sdp.c lib/sdp.h lib/bluez-api.h \ lib/obexd-api.h lib/bluez/adapter.c lib/bluez/adapter.h \ lib/bluez/agent.c lib/bluez/agent.h lib/bluez/audio.c \ lib/bluez/audio.h lib/bluez/device.c lib/bluez/device.h \ lib/bluez/input.c lib/bluez/input.h lib/bluez/manager.c \ lib/bluez/manager.h lib/bluez/network.c lib/bluez/network.h \ lib/bluez/network_server.c lib/bluez/network_server.h \ lib/bluez/serial.c lib/bluez/serial.h lib/obexd/obexagent.c \ lib/obexd/obexagent.h lib/obexd/obexclient.c \ lib/obexd/obexclient.h lib/obexd/obexclient_file_transfer.c \ lib/obexd/obexclient_file_transfer.h \ lib/obexd/obexclient_session.c lib/obexd/obexclient_session.h \ lib/obexd/obexclient_transfer.c \ lib/obexd/obexclient_transfer.h lib/obexd/obexmanager.c \ lib/obexd/obexmanager.h lib/obexd/obexsession.c \ lib/obexd/obexsession.h lib/obexd/obextransfer.c \ lib/obexd/obextransfer.h bt-agent.c am_bt_agent_OBJECTS = $(am__objects_2) $(am__objects_3) \ $(am__objects_4) bt-agent.$(OBJEXT) bt_agent_OBJECTS = $(am_bt_agent_OBJECTS) bt_agent_LDADD = $(LDADD) am__bt_audio_SOURCES_DIST = lib/marshallers.c lib/marshallers.h \ lib/dbus-common.c lib/dbus-common.h lib/helpers.c \ lib/helpers.h lib/sdp.c lib/sdp.h lib/bluez-api.h \ lib/obexd-api.h lib/bluez/adapter.c lib/bluez/adapter.h \ lib/bluez/agent.c lib/bluez/agent.h lib/bluez/audio.c \ lib/bluez/audio.h lib/bluez/device.c lib/bluez/device.h \ lib/bluez/input.c lib/bluez/input.h lib/bluez/manager.c \ lib/bluez/manager.h lib/bluez/network.c lib/bluez/network.h \ lib/bluez/network_server.c lib/bluez/network_server.h \ lib/bluez/serial.c lib/bluez/serial.h lib/obexd/obexagent.c \ lib/obexd/obexagent.h lib/obexd/obexclient.c \ lib/obexd/obexclient.h lib/obexd/obexclient_file_transfer.c \ lib/obexd/obexclient_file_transfer.h \ lib/obexd/obexclient_session.c lib/obexd/obexclient_session.h \ lib/obexd/obexclient_transfer.c \ lib/obexd/obexclient_transfer.h lib/obexd/obexmanager.c \ lib/obexd/obexmanager.h lib/obexd/obexsession.c \ lib/obexd/obexsession.h lib/obexd/obextransfer.c \ lib/obexd/obextransfer.h bt-audio.c am_bt_audio_OBJECTS = $(am__objects_2) $(am__objects_3) \ $(am__objects_4) bt-audio.$(OBJEXT) bt_audio_OBJECTS = $(am_bt_audio_OBJECTS) bt_audio_LDADD = $(LDADD) am__bt_device_SOURCES_DIST = lib/marshallers.c lib/marshallers.h \ lib/dbus-common.c lib/dbus-common.h lib/helpers.c \ lib/helpers.h lib/sdp.c lib/sdp.h lib/bluez-api.h \ lib/obexd-api.h lib/bluez/adapter.c lib/bluez/adapter.h \ lib/bluez/agent.c lib/bluez/agent.h lib/bluez/audio.c \ lib/bluez/audio.h lib/bluez/device.c lib/bluez/device.h \ lib/bluez/input.c lib/bluez/input.h lib/bluez/manager.c \ lib/bluez/manager.h lib/bluez/network.c lib/bluez/network.h \ lib/bluez/network_server.c lib/bluez/network_server.h \ lib/bluez/serial.c lib/bluez/serial.h lib/obexd/obexagent.c \ lib/obexd/obexagent.h lib/obexd/obexclient.c \ lib/obexd/obexclient.h lib/obexd/obexclient_file_transfer.c \ lib/obexd/obexclient_file_transfer.h \ lib/obexd/obexclient_session.c lib/obexd/obexclient_session.h \ lib/obexd/obexclient_transfer.c \ lib/obexd/obexclient_transfer.h lib/obexd/obexmanager.c \ lib/obexd/obexmanager.h lib/obexd/obexsession.c \ lib/obexd/obexsession.h lib/obexd/obextransfer.c \ lib/obexd/obextransfer.h bt-device.c am_bt_device_OBJECTS = $(am__objects_2) $(am__objects_3) \ $(am__objects_4) bt-device.$(OBJEXT) bt_device_OBJECTS = $(am_bt_device_OBJECTS) bt_device_LDADD = $(LDADD) am__bt_input_SOURCES_DIST = lib/marshallers.c lib/marshallers.h \ lib/dbus-common.c lib/dbus-common.h lib/helpers.c \ lib/helpers.h lib/sdp.c lib/sdp.h lib/bluez-api.h \ lib/obexd-api.h lib/bluez/adapter.c lib/bluez/adapter.h \ lib/bluez/agent.c lib/bluez/agent.h lib/bluez/audio.c \ lib/bluez/audio.h lib/bluez/device.c lib/bluez/device.h \ lib/bluez/input.c lib/bluez/input.h lib/bluez/manager.c \ lib/bluez/manager.h lib/bluez/network.c lib/bluez/network.h \ lib/bluez/network_server.c lib/bluez/network_server.h \ lib/bluez/serial.c lib/bluez/serial.h lib/obexd/obexagent.c \ lib/obexd/obexagent.h lib/obexd/obexclient.c \ lib/obexd/obexclient.h lib/obexd/obexclient_file_transfer.c \ lib/obexd/obexclient_file_transfer.h \ lib/obexd/obexclient_session.c lib/obexd/obexclient_session.h \ lib/obexd/obexclient_transfer.c \ lib/obexd/obexclient_transfer.h lib/obexd/obexmanager.c \ lib/obexd/obexmanager.h lib/obexd/obexsession.c \ lib/obexd/obexsession.h lib/obexd/obextransfer.c \ lib/obexd/obextransfer.h bt-input.c am_bt_input_OBJECTS = $(am__objects_2) $(am__objects_3) \ $(am__objects_4) bt-input.$(OBJEXT) bt_input_OBJECTS = $(am_bt_input_OBJECTS) bt_input_LDADD = $(LDADD) am__bt_monitor_SOURCES_DIST = lib/marshallers.c lib/marshallers.h \ lib/dbus-common.c lib/dbus-common.h lib/helpers.c \ lib/helpers.h lib/sdp.c lib/sdp.h lib/bluez-api.h \ lib/obexd-api.h lib/bluez/adapter.c lib/bluez/adapter.h \ lib/bluez/agent.c lib/bluez/agent.h lib/bluez/audio.c \ lib/bluez/audio.h lib/bluez/device.c lib/bluez/device.h \ lib/bluez/input.c lib/bluez/input.h lib/bluez/manager.c \ lib/bluez/manager.h lib/bluez/network.c lib/bluez/network.h \ lib/bluez/network_server.c lib/bluez/network_server.h \ lib/bluez/serial.c lib/bluez/serial.h lib/obexd/obexagent.c \ lib/obexd/obexagent.h lib/obexd/obexclient.c \ lib/obexd/obexclient.h lib/obexd/obexclient_file_transfer.c \ lib/obexd/obexclient_file_transfer.h \ lib/obexd/obexclient_session.c lib/obexd/obexclient_session.h \ lib/obexd/obexclient_transfer.c \ lib/obexd/obexclient_transfer.h lib/obexd/obexmanager.c \ lib/obexd/obexmanager.h lib/obexd/obexsession.c \ lib/obexd/obexsession.h lib/obexd/obextransfer.c \ lib/obexd/obextransfer.h bt-monitor.c am_bt_monitor_OBJECTS = $(am__objects_2) $(am__objects_3) \ $(am__objects_4) bt-monitor.$(OBJEXT) bt_monitor_OBJECTS = $(am_bt_monitor_OBJECTS) bt_monitor_LDADD = $(LDADD) am__bt_network_SOURCES_DIST = lib/marshallers.c lib/marshallers.h \ lib/dbus-common.c lib/dbus-common.h lib/helpers.c \ lib/helpers.h lib/sdp.c lib/sdp.h lib/bluez-api.h \ lib/obexd-api.h lib/bluez/adapter.c lib/bluez/adapter.h \ lib/bluez/agent.c lib/bluez/agent.h lib/bluez/audio.c \ lib/bluez/audio.h lib/bluez/device.c lib/bluez/device.h \ lib/bluez/input.c lib/bluez/input.h lib/bluez/manager.c \ lib/bluez/manager.h lib/bluez/network.c lib/bluez/network.h \ lib/bluez/network_server.c lib/bluez/network_server.h \ lib/bluez/serial.c lib/bluez/serial.h lib/obexd/obexagent.c \ lib/obexd/obexagent.h lib/obexd/obexclient.c \ lib/obexd/obexclient.h lib/obexd/obexclient_file_transfer.c \ lib/obexd/obexclient_file_transfer.h \ lib/obexd/obexclient_session.c lib/obexd/obexclient_session.h \ lib/obexd/obexclient_transfer.c \ lib/obexd/obexclient_transfer.h lib/obexd/obexmanager.c \ lib/obexd/obexmanager.h lib/obexd/obexsession.c \ lib/obexd/obexsession.h lib/obexd/obextransfer.c \ lib/obexd/obextransfer.h bt-network.c am_bt_network_OBJECTS = $(am__objects_2) $(am__objects_3) \ $(am__objects_4) bt-network.$(OBJEXT) bt_network_OBJECTS = $(am_bt_network_OBJECTS) bt_network_LDADD = $(LDADD) am__bt_obex_SOURCES_DIST = lib/marshallers.c lib/marshallers.h \ lib/dbus-common.c lib/dbus-common.h lib/helpers.c \ lib/helpers.h lib/sdp.c lib/sdp.h lib/bluez-api.h \ lib/obexd-api.h lib/bluez/adapter.c lib/bluez/adapter.h \ lib/bluez/agent.c lib/bluez/agent.h lib/bluez/audio.c \ lib/bluez/audio.h lib/bluez/device.c lib/bluez/device.h \ lib/bluez/input.c lib/bluez/input.h lib/bluez/manager.c \ lib/bluez/manager.h lib/bluez/network.c lib/bluez/network.h \ lib/bluez/network_server.c lib/bluez/network_server.h \ lib/bluez/serial.c lib/bluez/serial.h lib/obexd/obexagent.c \ lib/obexd/obexagent.h lib/obexd/obexclient.c \ lib/obexd/obexclient.h lib/obexd/obexclient_file_transfer.c \ lib/obexd/obexclient_file_transfer.h \ lib/obexd/obexclient_session.c lib/obexd/obexclient_session.h \ lib/obexd/obexclient_transfer.c \ lib/obexd/obexclient_transfer.h lib/obexd/obexmanager.c \ lib/obexd/obexmanager.h lib/obexd/obexsession.c \ lib/obexd/obexsession.h lib/obexd/obextransfer.c \ lib/obexd/obextransfer.h bt-obex.c @OBEX_TRUE@am_bt_obex_OBJECTS = $(am__objects_2) $(am__objects_3) \ @OBEX_TRUE@ $(am__objects_4) bt-obex.$(OBJEXT) bt_obex_OBJECTS = $(am_bt_obex_OBJECTS) am__DEPENDENCIES_1 = @OBEX_TRUE@bt_obex_DEPENDENCIES = $(am__DEPENDENCIES_1) am__bt_serial_SOURCES_DIST = lib/marshallers.c lib/marshallers.h \ lib/dbus-common.c lib/dbus-common.h lib/helpers.c \ lib/helpers.h lib/sdp.c lib/sdp.h lib/bluez-api.h \ lib/obexd-api.h lib/bluez/adapter.c lib/bluez/adapter.h \ lib/bluez/agent.c lib/bluez/agent.h lib/bluez/audio.c \ lib/bluez/audio.h lib/bluez/device.c lib/bluez/device.h \ lib/bluez/input.c lib/bluez/input.h lib/bluez/manager.c \ lib/bluez/manager.h lib/bluez/network.c lib/bluez/network.h \ lib/bluez/network_server.c lib/bluez/network_server.h \ lib/bluez/serial.c lib/bluez/serial.h lib/obexd/obexagent.c \ lib/obexd/obexagent.h lib/obexd/obexclient.c \ lib/obexd/obexclient.h lib/obexd/obexclient_file_transfer.c \ lib/obexd/obexclient_file_transfer.h \ lib/obexd/obexclient_session.c lib/obexd/obexclient_session.h \ lib/obexd/obexclient_transfer.c \ lib/obexd/obexclient_transfer.h lib/obexd/obexmanager.c \ lib/obexd/obexmanager.h lib/obexd/obexsession.c \ lib/obexd/obexsession.h lib/obexd/obextransfer.c \ lib/obexd/obextransfer.h bt-serial.c am_bt_serial_OBJECTS = $(am__objects_2) $(am__objects_3) \ $(am__objects_4) bt-serial.$(OBJEXT) bt_serial_OBJECTS = $(am_bt_serial_OBJECTS) bt_serial_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(bt_adapter_SOURCES) $(bt_agent_SOURCES) \ $(bt_audio_SOURCES) $(bt_device_SOURCES) $(bt_input_SOURCES) \ $(bt_monitor_SOURCES) $(bt_network_SOURCES) $(bt_obex_SOURCES) \ $(bt_serial_SOURCES) DIST_SOURCES = $(am__bt_adapter_SOURCES_DIST) \ $(am__bt_agent_SOURCES_DIST) $(am__bt_audio_SOURCES_DIST) \ $(am__bt_device_SOURCES_DIST) $(am__bt_input_SOURCES_DIST) \ $(am__bt_monitor_SOURCES_DIST) $(am__bt_network_SOURCES_DIST) \ $(am__bt_obex_SOURCES_DIST) $(am__bt_serial_SOURCES_DIST) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBREADLINE = @LIBREADLINE@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = $(DBUS_CFLAGS) $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS) AM_LDFLAGS = $(DBUS_LIBS) $(GLIB_LIBS) $(DBUS_GLIB_LIBS) # Marshallers generation #BUILT_SOURCES = lib/marshallers.c lib/marshallers.h #GENMARSHAL_FLAGS = --prefix="g_cclosure_bt_marshal" --g-fatal-warnings # #lib/marshallers.h: lib/marshallers.list # glib-genmarshal $(GENMARSHAL_FLAGS) --header lib/marshallers.list > lib/marshallers.h # #lib/marshallers.c: lib/marshallers.list # glib-genmarshal $(GENMARSHAL_FLAGS) --body lib/marshallers.list > lib/marshallers.c bluez_sources = lib/bluez/adapter.c lib/bluez/adapter.h \ lib/bluez/agent.c lib/bluez/agent.h \ lib/bluez/audio.c lib/bluez/audio.h \ lib/bluez/device.c lib/bluez/device.h \ lib/bluez/input.c lib/bluez/input.h \ lib/bluez/manager.c lib/bluez/manager.h \ lib/bluez/network.c lib/bluez/network.h \ lib/bluez/network_server.c lib/bluez/network_server.h \ lib/bluez/serial.c lib/bluez/serial.h @OBEX_FALSE@obexd_sources = @OBEX_TRUE@obexd_sources = lib/obexd/obexagent.c lib/obexd/obexagent.h \ @OBEX_TRUE@ lib/obexd/obexclient.c lib/obexd/obexclient.h \ @OBEX_TRUE@ lib/obexd/obexclient_file_transfer.c lib/obexd/obexclient_file_transfer.h \ @OBEX_TRUE@ lib/obexd/obexclient_session.c lib/obexd/obexclient_session.h \ @OBEX_TRUE@ lib/obexd/obexclient_transfer.c lib/obexd/obexclient_transfer.h \ @OBEX_TRUE@ lib/obexd/obexmanager.c lib/obexd/obexmanager.h \ @OBEX_TRUE@ lib/obexd/obexsession.c lib/obexd/obexsession.h \ @OBEX_TRUE@ lib/obexd/obextransfer.c lib/obexd/obextransfer.h lib_sources = lib/marshallers.c lib/marshallers.h lib/dbus-common.c \ lib/dbus-common.h lib/helpers.c lib/helpers.h lib/sdp.c \ lib/sdp.h lib/bluez-api.h $(am__append_1) bt_monitor_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-monitor.c bt_adapter_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-adapter.c bt_agent_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-agent.c bt_device_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-device.c bt_input_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-input.c bt_audio_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-audio.c bt_network_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-network.c bt_serial_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-serial.c @OBEX_TRUE@bt_obex_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-obex.c @OBEX_TRUE@bt_obex_LDADD = $(LIBREADLINE) dist_man_MANS = bt-monitor.1 bt-adapter.1 bt-agent.1 bt-device.1 \ bt-input.1 bt-audio.1 bt-network.1 bt-serial.1 $(am__append_3) all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) lib/$(am__dirstamp): @$(MKDIR_P) lib @: > lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) lib/$(DEPDIR) @: > lib/$(DEPDIR)/$(am__dirstamp) lib/marshallers.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/dbus-common.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/helpers.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/sdp.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/bluez/$(am__dirstamp): @$(MKDIR_P) lib/bluez @: > lib/bluez/$(am__dirstamp) lib/bluez/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) lib/bluez/$(DEPDIR) @: > lib/bluez/$(DEPDIR)/$(am__dirstamp) lib/bluez/adapter.$(OBJEXT): lib/bluez/$(am__dirstamp) \ lib/bluez/$(DEPDIR)/$(am__dirstamp) lib/bluez/agent.$(OBJEXT): lib/bluez/$(am__dirstamp) \ lib/bluez/$(DEPDIR)/$(am__dirstamp) lib/bluez/audio.$(OBJEXT): lib/bluez/$(am__dirstamp) \ lib/bluez/$(DEPDIR)/$(am__dirstamp) lib/bluez/device.$(OBJEXT): lib/bluez/$(am__dirstamp) \ lib/bluez/$(DEPDIR)/$(am__dirstamp) lib/bluez/input.$(OBJEXT): lib/bluez/$(am__dirstamp) \ lib/bluez/$(DEPDIR)/$(am__dirstamp) lib/bluez/manager.$(OBJEXT): lib/bluez/$(am__dirstamp) \ lib/bluez/$(DEPDIR)/$(am__dirstamp) lib/bluez/network.$(OBJEXT): lib/bluez/$(am__dirstamp) \ lib/bluez/$(DEPDIR)/$(am__dirstamp) lib/bluez/network_server.$(OBJEXT): lib/bluez/$(am__dirstamp) \ lib/bluez/$(DEPDIR)/$(am__dirstamp) lib/bluez/serial.$(OBJEXT): lib/bluez/$(am__dirstamp) \ lib/bluez/$(DEPDIR)/$(am__dirstamp) lib/obexd/$(am__dirstamp): @$(MKDIR_P) lib/obexd @: > lib/obexd/$(am__dirstamp) lib/obexd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) lib/obexd/$(DEPDIR) @: > lib/obexd/$(DEPDIR)/$(am__dirstamp) lib/obexd/obexagent.$(OBJEXT): lib/obexd/$(am__dirstamp) \ lib/obexd/$(DEPDIR)/$(am__dirstamp) lib/obexd/obexclient.$(OBJEXT): lib/obexd/$(am__dirstamp) \ lib/obexd/$(DEPDIR)/$(am__dirstamp) lib/obexd/obexclient_file_transfer.$(OBJEXT): \ lib/obexd/$(am__dirstamp) lib/obexd/$(DEPDIR)/$(am__dirstamp) lib/obexd/obexclient_session.$(OBJEXT): lib/obexd/$(am__dirstamp) \ lib/obexd/$(DEPDIR)/$(am__dirstamp) lib/obexd/obexclient_transfer.$(OBJEXT): lib/obexd/$(am__dirstamp) \ lib/obexd/$(DEPDIR)/$(am__dirstamp) lib/obexd/obexmanager.$(OBJEXT): lib/obexd/$(am__dirstamp) \ lib/obexd/$(DEPDIR)/$(am__dirstamp) lib/obexd/obexsession.$(OBJEXT): lib/obexd/$(am__dirstamp) \ lib/obexd/$(DEPDIR)/$(am__dirstamp) lib/obexd/obextransfer.$(OBJEXT): lib/obexd/$(am__dirstamp) \ lib/obexd/$(DEPDIR)/$(am__dirstamp) bt-adapter$(EXEEXT): $(bt_adapter_OBJECTS) $(bt_adapter_DEPENDENCIES) @rm -f bt-adapter$(EXEEXT) $(LINK) $(bt_adapter_OBJECTS) $(bt_adapter_LDADD) $(LIBS) bt-agent$(EXEEXT): $(bt_agent_OBJECTS) $(bt_agent_DEPENDENCIES) @rm -f bt-agent$(EXEEXT) $(LINK) $(bt_agent_OBJECTS) $(bt_agent_LDADD) $(LIBS) bt-audio$(EXEEXT): $(bt_audio_OBJECTS) $(bt_audio_DEPENDENCIES) @rm -f bt-audio$(EXEEXT) $(LINK) $(bt_audio_OBJECTS) $(bt_audio_LDADD) $(LIBS) bt-device$(EXEEXT): $(bt_device_OBJECTS) $(bt_device_DEPENDENCIES) @rm -f bt-device$(EXEEXT) $(LINK) $(bt_device_OBJECTS) $(bt_device_LDADD) $(LIBS) bt-input$(EXEEXT): $(bt_input_OBJECTS) $(bt_input_DEPENDENCIES) @rm -f bt-input$(EXEEXT) $(LINK) $(bt_input_OBJECTS) $(bt_input_LDADD) $(LIBS) bt-monitor$(EXEEXT): $(bt_monitor_OBJECTS) $(bt_monitor_DEPENDENCIES) @rm -f bt-monitor$(EXEEXT) $(LINK) $(bt_monitor_OBJECTS) $(bt_monitor_LDADD) $(LIBS) bt-network$(EXEEXT): $(bt_network_OBJECTS) $(bt_network_DEPENDENCIES) @rm -f bt-network$(EXEEXT) $(LINK) $(bt_network_OBJECTS) $(bt_network_LDADD) $(LIBS) bt-obex$(EXEEXT): $(bt_obex_OBJECTS) $(bt_obex_DEPENDENCIES) @rm -f bt-obex$(EXEEXT) $(LINK) $(bt_obex_OBJECTS) $(bt_obex_LDADD) $(LIBS) bt-serial$(EXEEXT): $(bt_serial_OBJECTS) $(bt_serial_DEPENDENCIES) @rm -f bt-serial$(EXEEXT) $(LINK) $(bt_serial_OBJECTS) $(bt_serial_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f lib/bluez/adapter.$(OBJEXT) -rm -f lib/bluez/agent.$(OBJEXT) -rm -f lib/bluez/audio.$(OBJEXT) -rm -f lib/bluez/device.$(OBJEXT) -rm -f lib/bluez/input.$(OBJEXT) -rm -f lib/bluez/manager.$(OBJEXT) -rm -f lib/bluez/network.$(OBJEXT) -rm -f lib/bluez/network_server.$(OBJEXT) -rm -f lib/bluez/serial.$(OBJEXT) -rm -f lib/dbus-common.$(OBJEXT) -rm -f lib/helpers.$(OBJEXT) -rm -f lib/marshallers.$(OBJEXT) -rm -f lib/obexd/obexagent.$(OBJEXT) -rm -f lib/obexd/obexclient.$(OBJEXT) -rm -f lib/obexd/obexclient_file_transfer.$(OBJEXT) -rm -f lib/obexd/obexclient_session.$(OBJEXT) -rm -f lib/obexd/obexclient_transfer.$(OBJEXT) -rm -f lib/obexd/obexmanager.$(OBJEXT) -rm -f lib/obexd/obexsession.$(OBJEXT) -rm -f lib/obexd/obextransfer.$(OBJEXT) -rm -f lib/sdp.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt-adapter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt-agent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt-audio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt-device.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt-input.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt-monitor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt-network.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt-obex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bt-serial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dbus-common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/helpers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/marshallers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sdp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/bluez/$(DEPDIR)/adapter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/bluez/$(DEPDIR)/agent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/bluez/$(DEPDIR)/audio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/bluez/$(DEPDIR)/device.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/bluez/$(DEPDIR)/input.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/bluez/$(DEPDIR)/manager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/bluez/$(DEPDIR)/network.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/bluez/$(DEPDIR)/network_server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/bluez/$(DEPDIR)/serial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/obexd/$(DEPDIR)/obexagent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/obexd/$(DEPDIR)/obexclient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/obexd/$(DEPDIR)/obexclient_file_transfer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/obexd/$(DEPDIR)/obexclient_session.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/obexd/$(DEPDIR)/obexclient_transfer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/obexd/$(DEPDIR)/obexmanager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/obexd/$(DEPDIR)/obexsession.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/obexd/$(DEPDIR)/obextransfer.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f lib/$(DEPDIR)/$(am__dirstamp) -rm -f lib/$(am__dirstamp) -rm -f lib/bluez/$(DEPDIR)/$(am__dirstamp) -rm -f lib/bluez/$(am__dirstamp) -rm -f lib/obexd/$(DEPDIR)/$(am__dirstamp) -rm -f lib/obexd/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) lib/$(DEPDIR) lib/bluez/$(DEPDIR) lib/obexd/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) lib/$(DEPDIR) lib/bluez/$(DEPDIR) lib/obexd/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 #CLEANFILES = lib/marshallers.c lib/marshallers.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: bluez-tools-0.1.38+git662e/src/Makefile.am0000644000175000017500000000532111472241457020345 0ustar iwamatsuiwamatsuAM_CPPFLAGS = $(DBUS_CFLAGS) $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS) AM_LDFLAGS = $(DBUS_LIBS) $(GLIB_LIBS) $(DBUS_GLIB_LIBS) # Marshallers generation #BUILT_SOURCES = lib/marshallers.c lib/marshallers.h #GENMARSHAL_FLAGS = --prefix="g_cclosure_bt_marshal" --g-fatal-warnings # #lib/marshallers.h: lib/marshallers.list # glib-genmarshal $(GENMARSHAL_FLAGS) --header lib/marshallers.list > lib/marshallers.h # #lib/marshallers.c: lib/marshallers.list # glib-genmarshal $(GENMARSHAL_FLAGS) --body lib/marshallers.list > lib/marshallers.c bluez_sources = lib/bluez/adapter.c lib/bluez/adapter.h \ lib/bluez/agent.c lib/bluez/agent.h \ lib/bluez/audio.c lib/bluez/audio.h \ lib/bluez/device.c lib/bluez/device.h \ lib/bluez/input.c lib/bluez/input.h \ lib/bluez/manager.c lib/bluez/manager.h \ lib/bluez/network.c lib/bluez/network.h \ lib/bluez/network_server.c lib/bluez/network_server.h \ lib/bluez/serial.c lib/bluez/serial.h if OBEX obexd_sources = lib/obexd/obexagent.c lib/obexd/obexagent.h \ lib/obexd/obexclient.c lib/obexd/obexclient.h \ lib/obexd/obexclient_file_transfer.c lib/obexd/obexclient_file_transfer.h \ lib/obexd/obexclient_session.c lib/obexd/obexclient_session.h \ lib/obexd/obexclient_transfer.c lib/obexd/obexclient_transfer.h \ lib/obexd/obexmanager.c lib/obexd/obexmanager.h \ lib/obexd/obexsession.c lib/obexd/obexsession.h \ lib/obexd/obextransfer.c lib/obexd/obextransfer.h else obexd_sources = endif lib_sources = lib/marshallers.c lib/marshallers.h \ lib/dbus-common.c lib/dbus-common.h \ lib/helpers.c lib/helpers.h \ lib/sdp.c lib/sdp.h \ lib/bluez-api.h if OBEX lib_sources += lib/obexd-api.h endif bin_PROGRAMS = bt-monitor bt-adapter bt-agent bt-device bt-input bt-audio bt-network bt-serial bt_monitor_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-monitor.c bt_adapter_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-adapter.c bt_agent_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-agent.c bt_device_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-device.c bt_input_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-input.c bt_audio_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-audio.c bt_network_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-network.c bt_serial_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-serial.c if OBEX bin_PROGRAMS += bt-obex bt_obex_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-obex.c bt_obex_LDADD = $(LIBREADLINE) endif dist_man_MANS = bt-monitor.1 bt-adapter.1 bt-agent.1 bt-device.1 bt-input.1 bt-audio.1 bt-network.1 bt-serial.1 if OBEX dist_man_MANS += bt-obex.1 endif #CLEANFILES = lib/marshallers.c lib/marshallers.h bluez-tools-0.1.38+git662e/src/bt-device.c0000644000175000017500000003535411472234421020321 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "lib/dbus-common.h" #include "lib/helpers.h" #include "lib/sdp.h" #include "lib/bluez-api.h" enum { REC, ATTR, SEQ, ELEM, ATTR_ID, UUID_ID, LAST_E }; static int xml_t[LAST_E] = {0, 0, 0, 0, -1, -1}; /* Main arguments */ static gchar *adapter_arg = NULL; static gboolean list_arg = FALSE; static gchar *connect_arg = NULL; static gchar *disconnect_arg = NULL; static gchar *remove_arg = NULL; static gchar *info_arg = NULL; static gboolean services_arg = FALSE; static gchar *services_device_arg = NULL; static gchar *services_pattern_arg = NULL; static gboolean set_arg = FALSE; static gchar *set_device_arg = NULL; static gchar *set_property_arg = NULL; static gchar *set_value_arg = NULL; static gboolean verbose_arg = FALSE; static gboolean is_verbose_attr(int attr_id) { if ( attr_id == SDP_ATTR_ID_SERVICE_CLASS_ID_LIST || attr_id == SDP_ATTR_ID_PROTOCOL_DESCRIPTOR_LIST || attr_id == SDP_ATTR_ID_BLUETOOTH_PROFILE_DESCRIPTOR_LIST || attr_id == SDP_ATTR_ID_DOCUMENTATION_URL || attr_id == SDP_ATTR_ID_SERVICE_NAME || attr_id == SDP_ATTR_ID_SERVICE_DESCRIPTION || attr_id == SDP_ATTR_ID_PROVIDER_NAME || attr_id == SDP_ATTR_ID_SECURITY_DESCRIPTION ) return FALSE; return TRUE; } static const gchar *xml_get_attr_value(const gchar *attr_name, const gchar **attribute_names, const gchar **attribute_values) { for (int i = 0; attribute_names[i] != NULL; i++) { if (g_strcmp0(attribute_names[i], attr_name) == 0) { return attribute_values[i]; } } return NULL; } static void xml_start_element(GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer user_data, GError **error) { const gchar *id_t = xml_get_attr_value("id", attribute_names, attribute_values); const gchar *value_t = xml_get_attr_value("value", attribute_names, attribute_values); if (g_strcmp0(element_name, "record") == 0) { xml_t[REC]++; } else if (g_strcmp0(element_name, "attribute") == 0 && id_t) { int attr_id = xtoi(id_t); const gchar *attr_name = sdp_get_attr_id_name(attr_id); xml_t[ATTR]++; xml_t[ATTR_ID] = attr_id; if (!verbose_arg && is_verbose_attr(xml_t[ATTR_ID])) return; if (attr_name == NULL) { g_print("AttrID-%s: ", id_t); } else { g_print("%s: ", attr_name); } } else if (g_strcmp0(element_name, "sequence") == 0) { xml_t[SEQ]++; } else if (g_pattern_match_simple("*int*", element_name) && value_t) { xml_t[ELEM]++; if (!verbose_arg && is_verbose_attr(xml_t[ATTR_ID])) return; if (xml_t[ELEM] == 1 && xml_t[SEQ] > 1) { g_print("\n"); for (int i = 0; i < xml_t[SEQ]; i++) g_print(" "); } else if (xml_t[ELEM] > 1) { g_print(", "); } if (xml_t[UUID_ID] == SDP_UUID_RFCOMM) { g_print("Channel: %d", xtoi(value_t)); } else { g_print("0x%x", xtoi(value_t)); } } else if (g_strcmp0(element_name, "uuid") == 0 && value_t) { int uuid_id = -1; const gchar *uuid_name; if (value_t[0] == '0' && value_t[1] == 'x') { uuid_id = xtoi(value_t); uuid_name = sdp_get_uuid_name(uuid_id); } else { uuid_name = uuid2name(value_t); } xml_t[ELEM]++; xml_t[UUID_ID] = uuid_id; if (!verbose_arg && is_verbose_attr(xml_t[ATTR_ID])) return; if (xml_t[ELEM] == 1 && xml_t[SEQ] > 1) { g_print("\n"); for (int i = 0; i < xml_t[SEQ]; i++) g_print(" "); } else if (xml_t[ELEM] > 1) { g_print(", "); } if (uuid_name == NULL) { g_print("\"UUID-%s\"", value_t); } else { g_print("\"%s\"", uuid_name); } } else if (g_strcmp0(element_name, "text") == 0 && value_t) { xml_t[ELEM]++; if (!verbose_arg && is_verbose_attr(xml_t[ATTR_ID])) return; if (xml_t[ELEM] == 1 && xml_t[SEQ] > 1) { g_print("\n"); for (int i = 0; i < xml_t[SEQ]; i++) g_print(" "); } else if (xml_t[ELEM] > 1) { g_print(", "); } g_print("\"%s\"", value_t); } else if (g_strcmp0(element_name, "boolean") == 0 && value_t) { xml_t[ELEM]++; if (!verbose_arg && is_verbose_attr(xml_t[ATTR_ID])) return; if (xml_t[ELEM] == 1 && xml_t[SEQ] > 1) { g_print("\n"); for (int i = 0; i < xml_t[SEQ]; i++) g_print(" "); } else if (xml_t[ELEM] > 1) { g_print(", "); } g_print("%s", value_t); } else { if (error) *error = g_error_new(G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT, "Invalid XML element: %s", element_name); } } static void xml_end_element(GMarkupParseContext *context, const gchar *element_name, gpointer user_data, GError **error) { if (g_strcmp0(element_name, "record") == 0) { xml_t[ATTR] = 0; xml_t[SEQ] = 0; xml_t[ELEM] = 0; xml_t[ATTR_ID] = -1; xml_t[UUID_ID] = -1; } else if (g_strcmp0(element_name, "attribute") == 0) { xml_t[SEQ] = 0; xml_t[ELEM] = 0; int old_attr_id = xml_t[ATTR_ID]; xml_t[ATTR_ID] = -1; xml_t[UUID_ID] = -1; if (!verbose_arg && is_verbose_attr(old_attr_id)) return; g_print("\n"); } else if (g_strcmp0(element_name, "sequence") == 0) { xml_t[SEQ]--; xml_t[ELEM] = 0; xml_t[UUID_ID] = -1; } } static void create_paired_device_done(gpointer data) { g_assert(data != NULL); GMainLoop *mainloop = data; g_main_loop_quit(mainloop); } static GOptionEntry entries[] = { {"adapter", 'a', 0, G_OPTION_ARG_STRING, &adapter_arg, "Adapter Name or MAC", ""}, {"list", 'l', 0, G_OPTION_ARG_NONE, &list_arg, "List added devices", NULL}, {"connect", 'c', 0, G_OPTION_ARG_STRING, &connect_arg, "Connect to the remote device", ""}, {"disconnect", 'd', 0, G_OPTION_ARG_STRING, &disconnect_arg, "Disconnect the remote device", ""}, {"remove", 'r', 0, G_OPTION_ARG_STRING, &remove_arg, "Remove device", ""}, {"info", 'i', 0, G_OPTION_ARG_STRING, &info_arg, "Get info about device", ""}, {"services", 's', 0, G_OPTION_ARG_NONE, &services_arg, "Discover device services", NULL}, {"set", 0, 0, G_OPTION_ARG_NONE, &set_arg, "Set device property", NULL}, {"verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose_arg, "Verbosely display remote service records", NULL}, {NULL} }; int main(int argc, char *argv[]) { GError *error = NULL; GOptionContext *context; /* Query current locale */ setlocale(LC_CTYPE, ""); g_type_init(); dbus_init(); context = g_option_context_new("- a bluetooth device manager"); g_option_context_add_main_entries(context, entries, NULL); g_option_context_set_summary(context, "Version "PACKAGE_VERSION); g_option_context_set_description(context, "Services Options:\n" " -s, --services []\n" " Where `pattern` is an optional specific UUID to search\n\n" "Set Options:\n" " --set \n" " Where\n" " `name|mac` is a device Name or MAC\n" " `property` is one of:\n" " Alias\n" " Trusted\n" " Blocked\n\n" //"Report bugs to <"PACKAGE_BUGREPORT">." "Project home page <"PACKAGE_URL">." ); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("%s: %s\n", g_get_prgname(), error->message); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } else if (!list_arg && (!connect_arg || strlen(connect_arg) == 0) && (!disconnect_arg || strlen(disconnect_arg) == 0) && (!remove_arg || strlen(remove_arg) == 0) && (!info_arg || strlen(info_arg) == 0) && !services_arg && !set_arg) { g_print("%s", g_option_context_get_help(context, FALSE, NULL)); exit(EXIT_FAILURE); } else if (services_arg && (argc != 2 || strlen(argv[1]) == 0) && (argc != 3 || strlen(argv[1]) == 0)) { g_print("%s: Invalid arguments for --services\n", g_get_prgname()); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } else if (set_arg && (argc != 4 || strlen(argv[1]) == 0 || strlen(argv[2]) == 0 || strlen(argv[3]) == 0)) { g_print("%s: Invalid arguments for --set\n", g_get_prgname()); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } g_option_context_free(context); if (!dbus_system_connect(&error)) { g_printerr("Couldn't connect to DBus system bus: %s\n", error->message); exit(EXIT_FAILURE); } /* Check, that bluetooth daemon is running */ if (!intf_supported(BLUEZ_DBUS_NAME, MANAGER_DBUS_PATH, MANAGER_DBUS_INTERFACE)) { g_printerr("%s: bluez service is not found\n", g_get_prgname()); g_printerr("Did you forget to run bluetoothd?\n"); exit(EXIT_FAILURE); } Adapter *adapter = find_adapter(adapter_arg, &error); exit_if_error(error); if (list_arg) { const GPtrArray *devices_list = adapter_get_devices(adapter); g_assert(devices_list != NULL); if (devices_list->len == 0) { g_print("No devices found\n"); exit(EXIT_FAILURE); } g_print("Added devices:\n"); for (int i = 0; i < devices_list->len; i++) { const gchar *device_path = g_ptr_array_index(devices_list, i); Device *device = g_object_new(DEVICE_TYPE, "DBusObjectPath", device_path, NULL); g_print("%s (%s)\n", device_get_alias(device), device_get_address(device)); g_object_unref(device); } } else if (connect_arg) { g_print("Connecting to: %s\n", connect_arg); Agent *agent = g_object_new(AGENT_TYPE, NULL); GMainLoop *mainloop = g_main_loop_new(NULL, FALSE); adapter_create_paired_device_begin(adapter, create_paired_device_done, mainloop, connect_arg, AGENT_DBUS_PATH, "DisplayYesNo"); g_main_loop_run(mainloop); gchar *created_device = adapter_create_paired_device_end(adapter, &error); exit_if_error(error); g_print("Done\n"); g_main_loop_unref(mainloop); g_free(created_device); g_object_unref(agent); } else if (disconnect_arg) { Device *device = find_device(adapter, disconnect_arg, &error); exit_if_error(error); g_print("Disconnecting: %s\n", disconnect_arg); device_disconnect(device, &error); exit_if_error(error); g_print("Done\n"); g_object_unref(device); } else if (remove_arg) { Device *device = find_device(adapter, remove_arg, &error); exit_if_error(error); adapter_remove_device(adapter, device_get_dbus_object_path(device), &error); exit_if_error(error); g_print("Done\n"); g_object_unref(device); } else if (info_arg) { Device *device = find_device(adapter, info_arg, &error); exit_if_error(error); g_print("[%s]\n", device_get_address(device)); g_print(" Name: %s\n", device_get_name(device)); g_print(" Alias: %s [rw]\n", device_get_alias(device)); g_print(" Address: %s\n", device_get_address(device)); g_print(" Icon: %s\n", device_get_icon(device)); g_print(" Class: 0x%x\n", device_get_class(device)); g_print(" Paired: %d\n", device_get_paired(device)); g_print(" Trusted: %d [rw]\n", device_get_trusted(device)); g_print(" Blocked: %d [rw]\n", device_get_blocked(device)); g_print(" Connected: %d\n", device_get_connected(device)); g_print(" UUIDs: ["); const gchar **uuids = device_get_uuids(device); for (int j = 0; uuids[j] != NULL; j++) { if (j > 0) g_print(", "); g_print("%s", uuid2name(uuids[j])); } g_print("]\n"); g_object_unref(device); } else if (services_arg) { services_device_arg = argv[1]; if (argc == 3) { services_pattern_arg = argv[2]; } Device *device = find_device(adapter, services_device_arg, &error); exit_if_error(error); g_print("Discovering services...\n"); GHashTable *device_services = device_discover_services(device, name2uuid(services_pattern_arg), &error); exit_if_error(error); GHashTableIter iter; gpointer key, value; g_hash_table_iter_init(&iter, device_services); int n = 0; while (g_hash_table_iter_next(&iter, &key, &value)) { n++; if (n == 1) g_print("\n"); g_print("[RECORD:%d]\n", (gint) key); GMarkupParser xml_parser = {xml_start_element, xml_end_element, NULL, NULL, NULL}; GMarkupParseContext *xml_parse_context = g_markup_parse_context_new(&xml_parser, 0, NULL, NULL); g_markup_parse_context_parse(xml_parse_context, value, strlen(value), &error); exit_if_error(error); g_markup_parse_context_free(xml_parse_context); g_print("\n"); } g_print("Done\n"); g_object_unref(device); } else if (set_arg) { set_device_arg = argv[1]; set_property_arg = argv[2]; set_value_arg = argv[3]; Device *device = find_device(adapter, set_device_arg, &error); exit_if_error(error); GValue v = {0,}; if (g_strcmp0(set_property_arg, "Alias") == 0) { g_value_init(&v, G_TYPE_STRING); g_value_set_string(&v, set_value_arg); } else if ( g_strcmp0(set_property_arg, "Trusted") == 0 || g_strcmp0(set_property_arg, "Blocked") == 0 ) { g_value_init(&v, G_TYPE_BOOLEAN); if (g_strcmp0(set_value_arg, "0") == 0 || g_ascii_strcasecmp(set_value_arg, "FALSE") == 0 || g_ascii_strcasecmp(set_value_arg, "OFF") == 0) { g_value_set_boolean(&v, FALSE); } else if (g_strcmp0(set_value_arg, "1") == 0 || g_ascii_strcasecmp(set_value_arg, "TRUE") == 0 || g_ascii_strcasecmp(set_value_arg, "ON") == 0) { g_value_set_boolean(&v, TRUE); } else { g_print("%s: Invalid boolean value: %s\n", g_get_prgname(), set_value_arg); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } } else { g_print("%s: Invalid property: %s\n", g_get_prgname(), set_property_arg); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } GHashTable *props = device_get_properties(device, &error); exit_if_error(error); GValue *old_value = g_hash_table_lookup(props, set_property_arg); g_assert(old_value != NULL); if (G_VALUE_HOLDS_STRING(old_value)) { g_print("%s: %s -> %s\n", set_property_arg, g_value_get_string(old_value), g_value_get_string(&v)); } else if (G_VALUE_HOLDS_BOOLEAN(old_value)) { g_print("%s: %d -> %d\n", set_property_arg, g_value_get_boolean(old_value), g_value_get_boolean(&v)); } g_hash_table_unref(props); device_set_property(device, set_property_arg, &v, &error); exit_if_error(error); g_value_unset(&v); g_object_unref(device); } g_object_unref(adapter); dbus_disconnect(); exit(EXIT_SUCCESS); } bluez-tools-0.1.38+git662e/src/bt-network.c0000644000175000017500000001651411472240107020546 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "lib/dbus-common.h" #include "lib/helpers.h" #include "lib/bluez-api.h" static GMainLoop *mainloop = NULL; static void sigterm_handler(int sig) { g_message("%s received", sig == SIGTERM ? "SIGTERM" : "SIGINT"); g_main_loop_quit(mainloop); } static void trap_signals() { /* Add SIGTERM && SIGINT handlers */ struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = sigterm_handler; sigaction(SIGTERM, &sa, NULL); sigaction(SIGINT, &sa, NULL); } static void network_property_changed(Network *network, const gchar *name, const GValue *value, gpointer data) { g_assert(data != NULL); GMainLoop *mainloop = data; if (g_strcmp0(name, "Connected") == 0) { if (g_value_get_boolean(value) == TRUE) { g_print("Network service is connected\n"); } else { g_print("Network service is disconnected\n"); g_main_loop_quit(mainloop); } } else if (g_strcmp0(name, "Interface") == 0) { g_print("Interface: %s\n", g_value_get_string(value)); } else if (g_strcmp0(name, "UUID") == 0) { g_print("UUID: %s (%s)\n", uuid2name(g_value_get_string(value)), g_value_get_string(value)); } } static gchar *adapter_arg = NULL; static gboolean connect_arg = FALSE; static gchar *connect_device_arg = NULL; static gchar *connect_uuid_arg = NULL; static gboolean server_arg = FALSE; static gchar *server_uuid_arg = NULL; static gchar *server_brige_arg = NULL; static GOptionEntry entries[] = { {"adapter", 'a', 0, G_OPTION_ARG_STRING, &adapter_arg, "Adapter Name or MAC", ""}, {"connect", 'c', 0, G_OPTION_ARG_NONE, &connect_arg, "Connect to the network device", NULL}, {"server", 's', 0, G_OPTION_ARG_NONE, &server_arg, "Start GN/PANU/NAP server", NULL}, {NULL} }; int main(int argc, char *argv[]) { GError *error = NULL; GOptionContext *context; /* Query current locale */ setlocale(LC_CTYPE, ""); g_type_init(); dbus_init(); context = g_option_context_new("- a bluetooth network manager"); g_option_context_add_main_entries(context, entries, NULL); g_option_context_set_summary(context, "Version "PACKAGE_VERSION); g_option_context_set_description(context, "Connect Options:\n" " -c, --connect \n" " Where\n" " `name|mac` is a device Name or MAC\n" " `uuid` is:\n" " Profile short name: gn, panu or nap\n\n" "Server Options:\n" " -s, --server \n" " Every new connection to this server will be added the `bridge` interface\n\n" //"Report bugs to <"PACKAGE_BUGREPORT">." "Project home page <"PACKAGE_URL">." ); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("%s: %s\n", g_get_prgname(), error->message); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } else if (!connect_arg && !server_arg) { g_print("%s", g_option_context_get_help(context, FALSE, NULL)); exit(EXIT_FAILURE); } else if (connect_arg && (argc != 3 || strlen(argv[1]) == 0 || strlen(argv[2]) == 0)) { g_print("%s: Invalid arguments for --connect\n", g_get_prgname()); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } else if (server_arg && (argc != 3 || strlen(argv[1]) == 0 || strlen(argv[2]) == 0)) { g_print("%s: Invalid arguments for --server\n", g_get_prgname()); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } g_option_context_free(context); if (!dbus_system_connect(&error)) { g_printerr("Couldn't connect to DBus system bus: %s\n", error->message); exit(EXIT_FAILURE); } /* Check, that bluetooth daemon is running */ if (!intf_supported(BLUEZ_DBUS_NAME, MANAGER_DBUS_PATH, MANAGER_DBUS_INTERFACE)) { g_printerr("%s: bluez service is not found\n", g_get_prgname()); g_printerr("Did you forget to run bluetoothd?\n"); exit(EXIT_FAILURE); } Adapter *adapter = find_adapter(adapter_arg, &error); exit_if_error(error); if (connect_arg) { connect_device_arg = argv[1]; connect_uuid_arg = argv[2]; Device *device = find_device(adapter, connect_device_arg, &error); exit_if_error(error); if (!intf_supported(BLUEZ_DBUS_NAME, device_get_dbus_object_path(device), NETWORK_DBUS_INTERFACE)) { g_printerr("Network service is not supported by this device\n"); exit(EXIT_FAILURE); } mainloop = g_main_loop_new(NULL, FALSE); Network *network = g_object_new(NETWORK_TYPE, "DBusObjectPath", device_get_dbus_object_path(device), NULL); g_signal_connect(network, "PropertyChanged", G_CALLBACK(network_property_changed), mainloop); if (network_get_connected(network) == TRUE) { g_print("Network service is already connected\n"); } else { gchar *intf = network_connect(network, connect_uuid_arg, &error); exit_if_error(error); trap_signals(); g_main_loop_run(mainloop); /* Force disconnect the network device */ if (network_get_connected(network) == TRUE) { network_disconnect(network, NULL); } g_free(intf); } g_main_loop_unref(mainloop); g_object_unref(network); g_object_unref(device); } else if (server_arg) { server_uuid_arg = argv[1]; server_brige_arg = argv[2]; if (g_ascii_strcasecmp(server_uuid_arg, "gn") != 0 && g_ascii_strcasecmp(server_uuid_arg, "panu") != 0 && g_ascii_strcasecmp(server_uuid_arg, "nap") != 0) { g_print("%s: Invalid server UUID: %s\n", g_get_prgname(), server_uuid_arg); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } if (!intf_supported(BLUEZ_DBUS_NAME, adapter_get_dbus_object_path(adapter), NETWORK_SERVER_DBUS_INTERFACE)) { g_printerr("Network server is not supported by this adapter\n"); exit(EXIT_FAILURE); } gchar *server_uuid_upper = g_ascii_strup(server_uuid_arg, -1); NetworkServer *network_server = g_object_new(NETWORK_SERVER_TYPE, "DBusObjectPath", adapter_get_dbus_object_path(adapter), NULL); network_server_register(network_server, server_uuid_arg, server_brige_arg, &error); exit_if_error(error); g_print("%s server registered\n", server_uuid_upper); mainloop = g_main_loop_new(NULL, FALSE); trap_signals(); g_main_loop_run(mainloop); network_server_unregister(network_server, server_uuid_arg, &error); exit_if_error(error); g_print("%s server unregistered\n", server_uuid_upper); g_main_loop_unref(mainloop); g_free(server_uuid_upper); g_object_unref(network_server); } g_object_unref(adapter); dbus_disconnect(); exit(EXIT_SUCCESS); } bluez-tools-0.1.38+git662e/src/bt-audio.c0000644000175000017500000001151511463542610020156 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "lib/dbus-common.h" #include "lib/helpers.h" #include "lib/bluez-api.h" static void audio_property_changed(Audio *audio, const gchar *name, const GValue *value, gpointer data) { g_assert(data != NULL); GMainLoop *mainloop = data; if (g_strcmp0(name, "State") == 0) { if (g_ascii_strcasecmp(g_value_get_string(value), "connecting") == 0) { g_print("Connecting to an audio service\n"); } else if (g_ascii_strcasecmp(g_value_get_string(value), "connected") == 0) { g_print("Audio service is connected\n"); g_main_loop_quit(mainloop); } else { g_print("Audio service is disconnected\n"); g_main_loop_quit(mainloop); } } } static gchar *adapter_arg = NULL; static gchar *connect_arg = NULL; static gchar *disconnect_arg = NULL; static GOptionEntry entries[] = { {"adapter", 'a', 0, G_OPTION_ARG_STRING, &adapter_arg, "Adapter Name or MAC", ""}, {"connect", 'c', 0, G_OPTION_ARG_STRING, &connect_arg, "Connect to the audio device", ""}, {"disconnect", 'd', 0, G_OPTION_ARG_STRING, &disconnect_arg, "Disconnect from the audio device", ""}, {NULL} }; int main(int argc, char *argv[]) { GError *error = NULL; GOptionContext *context; /* Query current locale */ setlocale(LC_CTYPE, ""); g_type_init(); dbus_init(); context = g_option_context_new("- a bluetooth generic audio manager"); g_option_context_add_main_entries(context, entries, NULL); g_option_context_set_summary(context, "Version "PACKAGE_VERSION); g_option_context_set_description(context, //"Report bugs to <"PACKAGE_BUGREPORT">." "Project home page <"PACKAGE_URL">." ); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("%s: %s\n", g_get_prgname(), error->message); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } else if ((!connect_arg || strlen(connect_arg) == 0) && (!disconnect_arg || strlen(disconnect_arg) == 0)) { g_print("%s", g_option_context_get_help(context, FALSE, NULL)); exit(EXIT_FAILURE); } g_option_context_free(context); if (!dbus_system_connect(&error)) { g_printerr("Couldn't connect to DBus system bus: %s\n", error->message); exit(EXIT_FAILURE); } /* Check, that bluetooth daemon is running */ if (!intf_supported(BLUEZ_DBUS_NAME, MANAGER_DBUS_PATH, MANAGER_DBUS_INTERFACE)) { g_printerr("%s: bluez service is not found\n", g_get_prgname()); g_printerr("Did you forget to run bluetoothd?\n"); exit(EXIT_FAILURE); } Adapter *adapter = find_adapter(adapter_arg, &error); exit_if_error(error); Device *device = find_device(adapter, connect_arg != NULL ? connect_arg : disconnect_arg, &error); exit_if_error(error); if (!intf_supported(BLUEZ_DBUS_NAME, device_get_dbus_object_path(device), AUDIO_DBUS_INTERFACE)) { g_printerr("Audio service is not supported by this device\n"); exit(EXIT_FAILURE); } GMainLoop *mainloop = g_main_loop_new(NULL, FALSE); Audio *audio = g_object_new(AUDIO_TYPE, "DBusObjectPath", device_get_dbus_object_path(device), NULL); g_signal_connect(audio, "PropertyChanged", G_CALLBACK(audio_property_changed), mainloop); if (connect_arg) { if (g_ascii_strcasecmp(audio_get_state(audio), "connected") == 0) { g_print("Audio service is already connected\n"); } else if (g_ascii_strcasecmp(audio_get_state(audio), "connecting") == 0) { g_print("Audio service is already in connection state\n"); } else { audio_connect(audio, &error); exit_if_error(error); g_main_loop_run(mainloop); } } else if (disconnect_arg) { if (g_ascii_strcasecmp(audio_get_state(audio), "disconnected") == 0) { g_print("Audio service is already disconnected\n"); } else { audio_disconnect(audio, &error); exit_if_error(error); g_main_loop_run(mainloop); } } g_main_loop_unref(mainloop); g_object_unref(audio); g_object_unref(device); g_object_unref(adapter); dbus_disconnect(); exit(EXIT_SUCCESS); } bluez-tools-0.1.38+git662e/src/bt-agent.c0000644000175000017500000000743411463542535020166 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "lib/dbus-common.h" #include "lib/helpers.h" #include "lib/bluez-api.h" static gboolean need_unregister = TRUE; static GMainLoop *mainloop = NULL; static void sigterm_handler(int sig) { g_message("%s received", sig == SIGTERM ? "SIGTERM" : "SIGINT"); if (g_main_loop_is_running(mainloop)) g_main_loop_quit(mainloop); } static void agent_released(Agent *agent, gpointer data) { g_assert(data != NULL); GMainLoop *mainloop = data; need_unregister = FALSE; if (g_main_loop_is_running(mainloop)) g_main_loop_quit(mainloop); } static gchar *adapter_arg = NULL; static GOptionEntry entries[] = { {"adapter", 'a', 0, G_OPTION_ARG_STRING, &adapter_arg, "Adapter Name or MAC", ""}, {NULL} }; int main(int argc, char *argv[]) { GError *error = NULL; GOptionContext *context; /* Query current locale */ setlocale(LC_CTYPE, ""); g_type_init(); dbus_init(); context = g_option_context_new(" - a bluetooth agent"); g_option_context_add_main_entries(context, entries, NULL); g_option_context_set_summary(context, "Version "PACKAGE_VERSION); g_option_context_set_description(context, //"Report bugs to <"PACKAGE_BUGREPORT">." "Project home page <"PACKAGE_URL">." ); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("%s: %s\n", g_get_prgname(), error->message); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } g_option_context_free(context); if (!dbus_system_connect(&error)) { g_printerr("Couldn't connect to DBus system bus: %s\n", error->message); exit(EXIT_FAILURE); } /* Check, that bluetooth daemon is running */ if (!intf_supported(BLUEZ_DBUS_NAME, MANAGER_DBUS_PATH, MANAGER_DBUS_INTERFACE)) { g_printerr("%s: bluez service is not found\n", g_get_prgname()); g_printerr("Did you forget to run bluetoothd?\n"); exit(EXIT_FAILURE); } mainloop = g_main_loop_new(NULL, FALSE); Manager *manager = g_object_new(MANAGER_TYPE, NULL); Adapter *adapter = find_adapter(adapter_arg, &error); exit_if_error(error); Agent *agent = g_object_new(AGENT_TYPE, NULL); adapter_register_agent(adapter, AGENT_DBUS_PATH, "DisplayYesNo", &error); exit_if_error(error); g_signal_connect(agent, "AgentReleased", G_CALLBACK(agent_released), mainloop); /* Add SIGTERM && SIGINT handlers */ struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = sigterm_handler; sigaction(SIGTERM, &sa, NULL); sigaction(SIGINT, &sa, NULL); g_main_loop_run(mainloop); if (need_unregister) { adapter_unregister_agent(adapter, AGENT_DBUS_PATH, &error); exit_if_error(error); /* Waiting for AgentReleased signal */ g_main_loop_run(mainloop); } g_main_loop_unref(mainloop); g_object_unref(agent); g_object_unref(adapter); g_object_unref(manager); dbus_disconnect(); exit(EXIT_SUCCESS); } bluez-tools-0.1.38+git662e/src/bt-obex.10000644000175000017500000001376611472236012017736 0ustar iwamatsuiwamatsu.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "bt-obex 1" .TH bt-obex 1 "2010-08-16" "" "bluez-tools" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" bt\-obex \- a bluetooth OBEX client/server .SH "SYNOPSIS" .IX Header "SYNOPSIS" bt-obex [\s-1OPTION\s0...] .PP Help Options: \-h, \-\-help .PP Application Options: \-a, \-\-adapter= \-s, \-\-server [] \-p, \-\-opp \-f, \-\-ftp= .SH "DESCRIPTION" .IX Header "DESCRIPTION" This utility implemented support of Object Push Profile (\s-1OPP\s0) and File Transfer Profile (\s-1FTP\s0). You can send and receive files to/from remote device using this tool. .SH "OPTIONS" .IX Header "OPTIONS" \&\fB\-h, \-\-help\fR Show help .PP \&\fB\-a, \-\-adapter \fR Specify adapter to use by his Name or \s-1MAC\s0 address (if this option does not defined \- default adapter used) .PP \&\fB\-s, \-\-server []\fR Register agent at \s-1OBEX\s0 server and set incoming/root directory to `path` or current folder will be used; Agent is used to accept/reject incoming bluetooth object push requests .PP \&\fB\-p, \-\-opp \fR Send local file to the specified remote device using object push profile .PP \&\fB\-f, \-\-ftp \fR Start \s-1FTP\s0 session with remote device; If session opened successfuly, \s-1FTP\s0 shell will be opened .PP .Vb 1 \& FTP commands: \& \& help Show help message \& exit Close FTP session \& cd Change the current folder of the remote device \& mkdir Create a new folder in the remote device \& ls List folder contents \& get Copy the src file (from remote device) to the dst file (on local filesystem) \& put Copy the src file (from local filesystem) to the dst file (on remote device) \& cp Copy a file within the remote device from src file to dst file \& mv Move a file within the remote device from src file to dst file \& rm Deletes the specified file/folder .Ve .SH "AUTHOR" .IX Header "AUTHOR" Alexander Orlenko . .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIbt\-adapter\fR\|(1) \fIbt\-agent\fR\|(1) \fIbt\-audio\fR\|(1) \fIbt\-device\fR\|(1) \fIbt\-input\fR\|(1) \fIbt\-monitor\fR\|(1) \fIbt\-network\fR\|(1) \fIbt\-serial\fR\|(1) bluez-tools-0.1.38+git662e/src/lib/0000755000175000017500000000000011472245124017051 5ustar iwamatsuiwamatsubluez-tools-0.1.38+git662e/src/lib/bluez-api.h0000644000175000017500000000253411430122445021110 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __BLUEZ_API_H #define __BLUEZ_API_H #ifdef HAVE_CONFIG_H #include #endif /* Global includes */ #include #include #define BLUEZ_DBUS_NAME "org.bluez" /* BlueZ DBus API */ #include "bluez/adapter.h" #include "bluez/agent.h" #include "bluez/audio.h" #include "bluez/device.h" #include "bluez/input.h" #include "bluez/manager.h" #include "bluez/network.h" #include "bluez/network_server.h" #include "bluez/serial.h" #endif /* __BLUEZ_API_H */ bluez-tools-0.1.38+git662e/src/lib/marshallers.c0000644000175000017500000006343611430125625021543 0ustar iwamatsuiwamatsu #include #ifdef G_ENABLE_DEBUG #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) #define g_marshal_value_peek_char(v) g_value_get_char (v) #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) #define g_marshal_value_peek_int(v) g_value_get_int (v) #define g_marshal_value_peek_uint(v) g_value_get_uint (v) #define g_marshal_value_peek_long(v) g_value_get_long (v) #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) #define g_marshal_value_peek_enum(v) g_value_get_enum (v) #define g_marshal_value_peek_flags(v) g_value_get_flags (v) #define g_marshal_value_peek_float(v) g_value_get_float (v) #define g_marshal_value_peek_double(v) g_value_get_double (v) #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) #define g_marshal_value_peek_param(v) g_value_get_param (v) #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) #define g_marshal_value_peek_object(v) g_value_get_object (v) #else /* !G_ENABLE_DEBUG */ /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. * Do not access GValues directly in your code. Instead, use the * g_value_get_*() functions */ #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int #define g_marshal_value_peek_char(v) (v)->data[0].v_int #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint #define g_marshal_value_peek_int(v) (v)->data[0].v_int #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint #define g_marshal_value_peek_long(v) (v)->data[0].v_long #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 #define g_marshal_value_peek_enum(v) (v)->data[0].v_long #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong #define g_marshal_value_peek_float(v) (v)->data[0].v_float #define g_marshal_value_peek_double(v) (v)->data[0].v_double #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ /* VOID:STRING,BOXED (lib/marshallers.list:2) */ void g_cclosure_bt_marshal_VOID__STRING_BOXED (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_BOXED) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_VOID__STRING_BOXED callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__STRING_BOXED) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_string (param_values + 1), g_marshal_value_peek_boxed (param_values + 2), data2); } /* BOOLEAN:POINTER (lib/marshallers.list:5) */ void g_cclosure_bt_marshal_BOOLEAN__POINTER (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER) (gpointer data1, gpointer arg_1, gpointer data2); register GMarshalFunc_BOOLEAN__POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 2); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__POINTER) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_pointer (param_values + 1), data2); g_value_set_boolean (return_value, v_return); } /* BOOLEAN:BOXED,POINTER,POINTER (lib/marshallers.list:6) */ void g_cclosure_bt_marshal_BOOLEAN__BOXED_POINTER_POINTER (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_POINTER_POINTER) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer arg_3, gpointer data2); register GMarshalFunc_BOOLEAN__BOXED_POINTER_POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 4); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__BOXED_POINTER_POINTER) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_boxed (param_values + 1), g_marshal_value_peek_pointer (param_values + 2), g_marshal_value_peek_pointer (param_values + 3), data2); g_value_set_boolean (return_value, v_return); } /* BOOLEAN:BOXED,UINT,UCHAR,POINTER (lib/marshallers.list:7) */ void g_cclosure_bt_marshal_BOOLEAN__BOXED_UINT_UCHAR_POINTER (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_UINT_UCHAR_POINTER) (gpointer data1, gpointer arg_1, guint arg_2, guchar arg_3, gpointer arg_4, gpointer data2); register GMarshalFunc_BOOLEAN__BOXED_UINT_UCHAR_POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 5); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__BOXED_UINT_UCHAR_POINTER) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_boxed (param_values + 1), g_marshal_value_peek_uint (param_values + 2), g_marshal_value_peek_uchar (param_values + 3), g_marshal_value_peek_pointer (param_values + 4), data2); g_value_set_boolean (return_value, v_return); } /* BOOLEAN:BOXED,UINT,POINTER (lib/marshallers.list:8) */ void g_cclosure_bt_marshal_BOOLEAN__BOXED_UINT_POINTER (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_UINT_POINTER) (gpointer data1, gpointer arg_1, guint arg_2, gpointer arg_3, gpointer data2); register GMarshalFunc_BOOLEAN__BOXED_UINT_POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 4); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__BOXED_UINT_POINTER) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_boxed (param_values + 1), g_marshal_value_peek_uint (param_values + 2), g_marshal_value_peek_pointer (param_values + 3), data2); g_value_set_boolean (return_value, v_return); } /* BOOLEAN:BOXED,STRING,POINTER (lib/marshallers.list:9) */ void g_cclosure_bt_marshal_BOOLEAN__BOXED_STRING_POINTER (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_STRING_POINTER) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer arg_3, gpointer data2); register GMarshalFunc_BOOLEAN__BOXED_STRING_POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 4); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__BOXED_STRING_POINTER) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_boxed (param_values + 1), g_marshal_value_peek_string (param_values + 2), g_marshal_value_peek_pointer (param_values + 3), data2); g_value_set_boolean (return_value, v_return); } /* BOOLEAN:STRING,POINTER (lib/marshallers.list:10) */ void g_cclosure_bt_marshal_BOOLEAN__STRING_POINTER (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_POINTER) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_BOOLEAN__STRING_POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__STRING_POINTER) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_string (param_values + 1), g_marshal_value_peek_pointer (param_values + 2), data2); g_value_set_boolean (return_value, v_return); } /* VOID:INT,INT (lib/marshallers.list:13) */ void g_cclosure_bt_marshal_VOID__INT_INT (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1, gint arg_1, gint arg_2, gpointer data2); register GMarshalFunc_VOID__INT_INT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_int (param_values + 1), g_marshal_value_peek_int (param_values + 2), data2); } /* VOID:STRING,BOOLEAN (lib/marshallers.list:16) */ void g_cclosure_bt_marshal_VOID__STRING_BOOLEAN (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_BOOLEAN) (gpointer data1, gpointer arg_1, gboolean arg_2, gpointer data2); register GMarshalFunc_VOID__STRING_BOOLEAN callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__STRING_BOOLEAN) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_string (param_values + 1), g_marshal_value_peek_boolean (param_values + 2), data2); } /* VOID:BOXED,BOOLEAN (lib/marshallers.list:17) */ void g_cclosure_bt_marshal_VOID__BOXED_BOOLEAN (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__BOXED_BOOLEAN) (gpointer data1, gpointer arg_1, gboolean arg_2, gpointer data2); register GMarshalFunc_VOID__BOXED_BOOLEAN callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__BOXED_BOOLEAN) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_boxed (param_values + 1), g_marshal_value_peek_boolean (param_values + 2), data2); } /* BOOLEAN:BOXED,STRING,STRING,STRING,INT,INT,POINTER,POINTER (lib/marshallers.list:20) */ void g_cclosure_bt_marshal_BOOLEAN__BOXED_STRING_STRING_STRING_INT_INT_POINTER_POINTER (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_STRING_STRING_STRING_INT_INT_POINTER_POINTER) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer arg_3, gpointer arg_4, gint arg_5, gint arg_6, gpointer arg_7, gpointer arg_8, gpointer data2); register GMarshalFunc_BOOLEAN__BOXED_STRING_STRING_STRING_INT_INT_POINTER_POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 9); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__BOXED_STRING_STRING_STRING_INT_INT_POINTER_POINTER) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_boxed (param_values + 1), g_marshal_value_peek_string (param_values + 2), g_marshal_value_peek_string (param_values + 3), g_marshal_value_peek_string (param_values + 4), g_marshal_value_peek_int (param_values + 5), g_marshal_value_peek_int (param_values + 6), g_marshal_value_peek_pointer (param_values + 7), g_marshal_value_peek_pointer (param_values + 8), data2); g_value_set_boolean (return_value, v_return); } /* BOOLEAN:BOXED,UINT64,POINTER (lib/marshallers.list:23) */ void g_cclosure_bt_marshal_BOOLEAN__BOXED_UINT64_POINTER (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_UINT64_POINTER) (gpointer data1, gpointer arg_1, guint64 arg_2, gpointer arg_3, gpointer data2); register GMarshalFunc_BOOLEAN__BOXED_UINT64_POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 4); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__BOXED_UINT64_POINTER) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_boxed (param_values + 1), g_marshal_value_peek_uint64 (param_values + 2), g_marshal_value_peek_pointer (param_values + 3), data2); g_value_set_boolean (return_value, v_return); } /* BOOLEAN:BOXED,POINTER (lib/marshallers.list:24) */ void g_cclosure_bt_marshal_BOOLEAN__BOXED_POINTER (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_POINTER) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_BOOLEAN__BOXED_POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__BOXED_POINTER) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_boxed (param_values + 1), g_marshal_value_peek_pointer (param_values + 2), data2); g_value_set_boolean (return_value, v_return); } bluez-tools-0.1.38+git662e/src/lib/dbus-common.c0000644000175000017500000000506211430123740021434 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "bluez-api.h" #ifdef OBEX_SUPPORT #include "obexd-api.h" #endif #include "dbus-common.h" DBusGConnection *session_conn = NULL; DBusGConnection *system_conn = NULL; static gboolean dbus_initialized = FALSE; void dbus_init() { /* Marshallers registration * Used for signals */ dbus_g_object_register_marshaller(g_cclosure_bt_marshal_VOID__STRING_BOXED, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); dbus_g_object_register_marshaller(g_cclosure_bt_marshal_VOID__INT_INT, G_TYPE_NONE, G_TYPE_INT, G_TYPE_INT, G_TYPE_INVALID); dbus_g_object_register_marshaller(g_cclosure_bt_marshal_VOID__BOXED_BOOLEAN, G_TYPE_NONE, G_TYPE_VALUE, G_TYPE_BOOLEAN, G_TYPE_INVALID); /* Agents installation */ dbus_g_object_type_install_info(AGENT_TYPE, &dbus_glib_agent_object_info); #ifdef OBEX_SUPPORT dbus_g_object_type_install_info(OBEXAGENT_TYPE, &dbus_glib_obexagent_object_info); #endif dbus_initialized = TRUE; } gboolean dbus_session_connect(GError **error) { g_assert(dbus_initialized == TRUE); session_conn = dbus_g_bus_get(DBUS_BUS_SESSION, error); if (!session_conn) { return FALSE; } return TRUE; } void dbus_session_disconnect() { dbus_g_connection_unref(session_conn); } gboolean dbus_system_connect(GError **error) { g_assert(dbus_initialized == TRUE); system_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, error); if (!system_conn) { return FALSE; } return TRUE; } void dbus_system_disconnect() { dbus_g_connection_unref(system_conn); } void dbus_disconnect() { if (system_conn) dbus_g_connection_unref(system_conn); if (session_conn) dbus_g_connection_unref(session_conn); } bluez-tools-0.1.38+git662e/src/lib/helpers.c0000644000175000017500000002601411451071741020661 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "dbus-common.h" #include "helpers.h" /* UUID Name lookup table */ typedef struct { gchar *uuid; gchar *name; gchar *alt_name; } uuid_name_lookup_table_t; static uuid_name_lookup_table_t uuid_name_lookup_table[] = { {"00001000-0000-1000-8000-00805F9B34FB", "ServiceDiscoveryServer", NULL}, {"00001001-0000-1000-8000-00805F9B34FB", "BrowseGroupDescriptor", NULL}, {"00001002-0000-1000-8000-00805F9B34FB", "PublicBrowseGroup", NULL}, {"00001101-0000-1000-8000-00805F9B34FB", "SerialPort", "Serial"}, {"00001102-0000-1000-8000-00805F9B34FB", "LANAccessUsingPPP", NULL}, {"00001103-0000-1000-8000-00805F9B34FB", "DialupNetworking", "DUN"}, {"00001104-0000-1000-8000-00805F9B34FB", "IrMCSync", NULL}, {"00001105-0000-1000-8000-00805F9B34FB", "OBEXObjectPush", NULL}, {"00001106-0000-1000-8000-00805F9B34FB", "OBEXFileTransfer", NULL}, {"00001107-0000-1000-8000-00805F9B34FB", "IrMCSyncCommand", NULL}, {"00001108-0000-1000-8000-00805F9B34FB", "Headset", NULL}, {"00001109-0000-1000-8000-00805F9B34FB", "CordlessTelephony", NULL}, {"0000110A-0000-1000-8000-00805F9B34FB", "AudioSource", NULL}, {"0000110B-0000-1000-8000-00805F9B34FB", "AudioSink", NULL}, {"0000110C-0000-1000-8000-00805F9B34FB", "AVRemoteControlTarget", NULL}, {"0000110D-0000-1000-8000-00805F9B34FB", "AdvancedAudioDistribution", "A2DP"}, {"0000110E-0000-1000-8000-00805F9B34FB", "AVRemoteControl", NULL}, {"0000110F-0000-1000-8000-00805F9B34FB", "VideoConferencing", NULL}, {"00001110-0000-1000-8000-00805F9B34FB", "Intercom", NULL}, {"00001111-0000-1000-8000-00805F9B34FB", "Fax", NULL}, {"00001112-0000-1000-8000-00805F9B34FB", "HeadsetAudioGateway", NULL}, {"00001113-0000-1000-8000-00805F9B34FB", "WAP", NULL}, {"00001114-0000-1000-8000-00805F9B34FB", "WAPClient", NULL}, {"00001115-0000-1000-8000-00805F9B34FB", "PANU", NULL}, {"00001116-0000-1000-8000-00805F9B34FB", "NAP", NULL}, {"00001117-0000-1000-8000-00805F9B34FB", "GN", NULL}, {"00001118-0000-1000-8000-00805F9B34FB", "DirectPrinting", NULL}, {"00001119-0000-1000-8000-00805F9B34FB", "ReferencePrinting", NULL}, {"0000111A-0000-1000-8000-00805F9B34FB", "Imaging", NULL}, {"0000111B-0000-1000-8000-00805F9B34FB", "ImagingResponder", NULL}, {"0000111C-0000-1000-8000-00805F9B34FB", "ImagingAutomaticArchive", NULL}, {"0000111D-0000-1000-8000-00805F9B34FB", "ImagingReferenceObjects", NULL}, {"0000111E-0000-1000-8000-00805F9B34FB", "Handsfree", NULL}, {"0000111F-0000-1000-8000-00805F9B34FB", "HandsfreeAudioGateway", NULL}, {"00001120-0000-1000-8000-00805F9B34FB", "DirectPrintingReferenceObjects", NULL}, {"00001121-0000-1000-8000-00805F9B34FB", "ReflectedUI", NULL}, {"00001122-0000-1000-8000-00805F9B34FB", "BasicPringing", NULL}, {"00001123-0000-1000-8000-00805F9B34FB", "PrintingStatus", NULL}, {"00001124-0000-1000-8000-00805F9B34FB", "HumanInterfaceDevice", "HID"}, {"00001125-0000-1000-8000-00805F9B34FB", "HardcopyCableReplacement", NULL}, {"00001126-0000-1000-8000-00805F9B34FB", "HCRPrint", NULL}, {"00001127-0000-1000-8000-00805F9B34FB", "HCRScan", NULL}, {"00001128-0000-1000-8000-00805F9B34FB", "CommonISDNAccess", NULL}, {"00001129-0000-1000-8000-00805F9B34FB", "VideoConferencingGW", NULL}, {"0000112A-0000-1000-8000-00805F9B34FB", "UDIMT", NULL}, {"0000112B-0000-1000-8000-00805F9B34FB", "UDITA", NULL}, {"0000112C-0000-1000-8000-00805F9B34FB", "AudioVideo", NULL}, {"00001200-0000-1000-8000-00805F9B34FB", "PnPInformation", NULL}, {"00001201-0000-1000-8000-00805F9B34FB", "GenericNetworking", NULL}, {"00001202-0000-1000-8000-00805F9B34FB", "GenericFileTransfer", NULL}, {"00001203-0000-1000-8000-00805F9B34FB", "GenericAudio", NULL}, {"00001204-0000-1000-8000-00805F9B34FB", "GenericTelephony", NULL}, {"00001205-0000-1000-8000-00805F9B34FB", "UPnP", NULL}, {"00001206-0000-1000-8000-00805F9B34FB", "UPnPIp", NULL}, {"00001300-0000-1000-8000-00805F9B34FB", "ESdpUPnPIpPan", NULL}, {"00001301-0000-1000-8000-00805F9B34FB", "ESdpUPnPIpLap", NULL}, {"00001302-0000-1000-8000-00805F9B34FB", "EdpUPnpIpL2CAP", NULL}, // Custom: {"0000112F-0000-1000-8000-00805F9B34FB", "PhoneBookAccess", NULL}, {"831C4071-7BC8-4A9C-A01C-15DF25A4ADBC", "ActiveSync", NULL}, }; #define UUID_NAME_LOOKUP_TABLE_SIZE \ (sizeof(uuid_name_lookup_table)/sizeof(uuid_name_lookup_table_t)) const gchar *uuid2name(const gchar *uuid) { if (uuid == NULL || strlen(uuid) == 0) return NULL; for (int i = 0; i < UUID_NAME_LOOKUP_TABLE_SIZE; i++) { if (g_ascii_strcasecmp(uuid_name_lookup_table[i].uuid, uuid) == 0) return uuid_name_lookup_table[i].name; } return uuid; } const gchar *name2uuid(const gchar *name) { if (name == NULL || strlen(name) == 0) return NULL; for (int i = 0; i < UUID_NAME_LOOKUP_TABLE_SIZE; i++) { if ( g_ascii_strcasecmp(uuid_name_lookup_table[i].name, name) == 0 || (uuid_name_lookup_table[i].alt_name && g_ascii_strcasecmp(uuid_name_lookup_table[i].alt_name, name) == 0) ) return uuid_name_lookup_table[i].uuid; } return name; } int xtoi(const gchar *str) { int i = 0; sscanf(str, "0x%x", &i); return i; } Adapter *find_adapter(const gchar *name, GError **error) { gchar *adapter_path = NULL; Adapter *adapter = NULL; Manager *manager = g_object_new(MANAGER_TYPE, NULL); // If name is null or empty - return default adapter if (name == NULL || strlen(name) == 0) { adapter_path = manager_default_adapter(manager, error); if (adapter_path) { adapter = g_object_new(ADAPTER_TYPE, "DBusObjectPath", adapter_path, NULL); } } else { // Try to find by id adapter_path = manager_find_adapter(manager, name, error); // Found if (adapter_path) { adapter = g_object_new(ADAPTER_TYPE, "DBusObjectPath", adapter_path, NULL); } else { // Try to find by name const GPtrArray *adapters_list = manager_get_adapters(manager); g_assert(adapters_list != NULL); for (int i = 0; i < adapters_list->len; i++) { adapter_path = g_ptr_array_index(adapters_list, i); adapter = g_object_new(ADAPTER_TYPE, "DBusObjectPath", adapter_path, NULL); adapter_path = NULL; if (g_strcmp0(name, adapter_get_name(adapter)) == 0) { if (error) { g_error_free(*error); *error = NULL; } break; } g_object_unref(adapter); adapter = NULL; } } } g_object_unref(manager); if (adapter_path) g_free(adapter_path); return adapter; } Device *find_device(Adapter *adapter, const gchar *name, GError **error) { g_assert(adapter != NULL && ADAPTER_IS(adapter)); g_assert(name != NULL && strlen(name) > 0); gchar *device_path = NULL; Device *device = NULL; // Try to find by MAC device_path = adapter_find_device(adapter, name, error); // Found if (device_path) { device = g_object_new(DEVICE_TYPE, "DBusObjectPath", device_path, NULL); } else { // Try to find by name const GPtrArray *devices_list = adapter_get_devices(adapter); g_assert(devices_list != NULL); for (int i = 0; i < devices_list->len; i++) { device_path = g_ptr_array_index(devices_list, i); device = g_object_new(DEVICE_TYPE, "DBusObjectPath", device_path, NULL); device_path = NULL; if (g_strcmp0(name, device_get_name(device)) == 0 || g_strcmp0(name, device_get_alias(device)) == 0) { if (error) { g_error_free(*error); *error = NULL; } break; } g_object_unref(device); device = NULL; } } if (device_path) g_free(device_path); return device; } gboolean intf_supported(const gchar *dbus_service_name, const gchar *dbus_object_path, const gchar *intf_name) { g_assert(dbus_service_name != NULL && strlen(dbus_service_name) > 0); g_assert(dbus_object_path != NULL && strlen(dbus_object_path) > 0); g_assert(intf_name != NULL && strlen(intf_name) > 0); gboolean supported = FALSE; DBusGConnection *conn = NULL; if (g_strcmp0(dbus_service_name, BLUEZ_DBUS_NAME) == 0) { conn = system_conn; #ifdef OBEX_SUPPORT } else if (g_strcmp0(dbus_service_name, OBEXS_DBUS_NAME) == 0 || g_strcmp0(dbus_service_name, OBEXC_DBUS_NAME) == 0) { conn = session_conn; #endif } else { return FALSE; } g_assert(conn != NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); /* Getting introspection XML */ DBusGProxy *introspection_g_proxy = dbus_g_proxy_new_for_name(conn, dbus_service_name, dbus_object_path, "org.freedesktop.DBus.Introspectable"); gchar *introspection_xml = NULL; GError *error = NULL; if (!dbus_g_proxy_call(introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &introspection_xml, G_TYPE_INVALID)) { #if 0 g_critical("%s", error->message); #else g_error_free(error); error = NULL; introspection_xml = g_strdup("null"); #endif } g_assert(error == NULL); if (g_regex_match_simple(check_intf_regex_str, introspection_xml, 0, 0)) { supported = TRUE; } g_free(check_intf_regex_str); g_free(introspection_xml); g_object_unref(introspection_g_proxy); return supported; } gboolean is_file(const gchar *filename, GError **error) { g_assert(filename != NULL && strlen(filename) > 0); struct stat buf; if (stat(filename, &buf) != 0) { if (error) { *error = g_error_new(g_quark_from_string("bluez-tools"), 1, "%s: %s", g_strdup(filename), strerror(errno)); } return FALSE; } if (!S_ISREG(buf.st_mode)) { if (error) { *error = g_error_new(g_quark_from_string("bluez-tools"), 2, "%s: Invalid file", g_strdup(filename)); } return FALSE; } return TRUE; } gboolean is_dir(const gchar *dirname, GError **error) { g_assert(dirname != NULL && strlen(dirname) > 0); struct stat buf; if (stat(dirname, &buf) != 0) { if (error) { *error = g_error_new(g_quark_from_string("bluez-tools"), 1, "%s: %s", g_strdup(dirname), strerror(errno)); } return FALSE; } if (!S_ISDIR(buf.st_mode)) { if (error) { *error = g_error_new(g_quark_from_string("bluez-tools"), 2, "%s: Invalid directory", g_strdup(dirname)); } return FALSE; } return TRUE; } gchar *get_absolute_path(const gchar *path) { if (g_path_is_absolute(path)) { return g_strdup(path); } gchar *current_dir = g_get_current_dir(); gchar *abs_path = g_build_filename(current_dir, path, NULL); g_free(current_dir); return abs_path; } bluez-tools-0.1.38+git662e/src/lib/obexd-api.h0000644000175000017500000000271011434451663021077 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __OBEXD_API_H #define __OBEXD_API_H #ifdef HAVE_CONFIG_H #include #endif /* Global includes */ #include #include #ifdef OBEX_SUPPORT #define OBEXS_DBUS_NAME "org.openobex" #define OBEXC_DBUS_NAME "org.openobex.client" /* OBEXD DBus API */ #include "obexd/obexagent.h" #include "obexd/obexclient.h" #include "obexd/obexclient_file_transfer.h" #include "obexd/obexclient_session.h" #include "obexd/obexclient_transfer.h" #include "obexd/obexmanager.h" #include "obexd/obexsession.h" #include "obexd/obextransfer.h" #endif #endif /* __OBEXD_API_H */ bluez-tools-0.1.38+git662e/src/lib/bluez/0000755000175000017500000000000011472245124020172 5ustar iwamatsuiwamatsubluez-tools-0.1.38+git662e/src/lib/bluez/agent.c0000644000175000017500000001360011430124405021424 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "../dbus-common.h" #include "../helpers.h" #include "device.h" #include "agent.h" #define AGENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), AGENT_TYPE, AgentPrivate)) struct _AgentPrivate { /* Unused */ DBusGProxy *proxy; }; G_DEFINE_TYPE(Agent, agent, G_TYPE_OBJECT); enum { AGENT_RELEASED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; static void agent_dispose(GObject *gobject) { Agent *self = AGENT(gobject); dbus_g_connection_unregister_g_object(system_conn, gobject); /* Proxy free */ //g_object_unref(self->priv->proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(agent_parent_class)->dispose(gobject); } static void agent_class_init(AgentClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = agent_dispose; g_type_class_add_private(klass, sizeof(AgentPrivate)); /* Signals registation */ signals[AGENT_RELEASED] = g_signal_new("AgentReleased", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } static void agent_init(Agent *self) { self->priv = AGENT_GET_PRIVATE(self); g_assert(system_conn != NULL); dbus_g_connection_register_g_object(system_conn, AGENT_DBUS_PATH, G_OBJECT(self)); g_print("Agent registered\n"); } /* Methods */ gboolean agent_release(Agent *self, GError **error) { g_print("Agent released\n"); g_signal_emit(self, signals[AGENT_RELEASED], 0); return TRUE; } gboolean agent_request_pin_code(Agent *self, const gchar *device, gchar **ret, GError **error) { Device *device_obj = g_object_new(DEVICE_TYPE, "DBusObjectPath", device, NULL); g_print("Device: %s (%s)\n", device_get_alias(device_obj), device_get_address(device_obj)); g_object_unref(device_obj); *ret = g_new0(gchar, 17); g_print("Enter PIN code: "); errno = 0; if (scanf("%16s", *ret) == EOF && errno) { g_warning("%s\n", strerror(errno)); } return TRUE; } gboolean agent_request_passkey(Agent *self, const gchar *device, guint *ret, GError **error) { Device *device_obj = g_object_new(DEVICE_TYPE, "DBusObjectPath", device, NULL); g_print("Device: %s (%s)\n", device_get_alias(device_obj), device_get_address(device_obj)); g_object_unref(device_obj); g_print("Enter passkey: "); errno = 0; if (scanf("%u", ret) == EOF && errno) { g_warning("%s\n", strerror(errno)); } return TRUE; } gboolean agent_display_passkey(Agent *self, const gchar *device, guint passkey, guint8 entered, GError **error) { Device *device_obj = g_object_new(DEVICE_TYPE, "DBusObjectPath", device, NULL); g_print("Device: %s (%s)\n", device_get_alias(device_obj), device_get_address(device_obj)); g_object_unref(device_obj); g_print("Passkey: %u, entered: %u\n", passkey, entered); return TRUE; } gboolean agent_request_confirmation(Agent *self, const gchar *device, guint passkey, GError **error) { Device *device_obj = g_object_new(DEVICE_TYPE, "DBusObjectPath", device, NULL); g_print("Device: %s (%s)\n", device_get_alias(device_obj), device_get_address(device_obj)); g_object_unref(device_obj); gchar yn[4] = {0,}; g_print("Confirm passkey: %u (yes/no)? ", passkey); errno = 0; if (scanf("%3s", yn) == EOF && errno) { g_warning("%s\n", strerror(errno)); } if (g_strcmp0(yn, "y") == 0 || g_strcmp0(yn, "yes") == 0) { return TRUE; } else { // TODO: Fix error code if (error) *error = g_error_new(g_quark_from_static_string("org.bluez.Error.Rejected"), 0, "Passkey doesn't match"); return FALSE; } return TRUE; } gboolean agent_authorize(Agent *self, const gchar *device, const gchar *uuid, GError **error) { Device *device_obj = g_object_new(DEVICE_TYPE, "DBusObjectPath", device, NULL); g_print("Device: %s (%s)\n", device_get_alias(device_obj), device_get_address(device_obj)); g_object_unref(device_obj); gchar yn[4] = {0,}; g_print("Authorize a connection to: %s (yes/no)? ", uuid2name(uuid)); errno = 0; if (scanf("%3s", yn) == EOF && errno) { g_warning("%s\n", strerror(errno)); } if (g_strcmp0(yn, "y") == 0 || g_strcmp0(yn, "yes") == 0) { return TRUE; } else { // TODO: Fix error code if (error) *error = g_error_new(g_quark_from_static_string("org.bluez.Error.Rejected"), 0, "Connection rejected by user"); return FALSE; } return TRUE; } gboolean agent_confirm_mode_change(Agent *self, const gchar *mode, GError **error) { gchar yn[4] = {0,}; g_print("Confirm mode change: %s (yes/no)? ", mode); errno = 0; if (scanf("%3s", yn) == EOF && errno) { g_warning("%s\n", strerror(errno)); } if (g_strcmp0(yn, "y") == 0 || g_strcmp0(yn, "yes") == 0) { return TRUE; } else { // TODO: Fix error code if (error) *error = g_error_new(g_quark_from_static_string("org.bluez.Error.Rejected"), 0, "Confirmation rejected by user"); return FALSE; } return TRUE; } gboolean agent_cancel(Agent *self, GError **error) { g_print("Request cancelled\n"); return TRUE; } bluez-tools-0.1.38+git662e/src/lib/bluez/manager.h0000644000175000017500000000421511454315712021760 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __MANAGER_H #define __MANAGER_H #include #define MANAGER_DBUS_PATH "/" #define MANAGER_DBUS_INTERFACE "org.bluez.Manager" /* * Type macros */ #define MANAGER_TYPE (manager_get_type()) #define MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MANAGER_TYPE, Manager)) #define MANAGER_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MANAGER_TYPE)) #define MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MANAGER_TYPE, ManagerClass)) #define MANAGER_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MANAGER_TYPE)) #define MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MANAGER_TYPE, ManagerClass)) typedef struct _Manager Manager; typedef struct _ManagerClass ManagerClass; typedef struct _ManagerPrivate ManagerPrivate; struct _Manager { GObject parent_instance; /*< private >*/ ManagerPrivate *priv; }; struct _ManagerClass { GObjectClass parent_class; }; /* used by MANAGER_TYPE */ GType manager_get_type(void) G_GNUC_CONST; /* * Method definitions */ gchar *manager_default_adapter(Manager *self, GError **error); gchar *manager_find_adapter(Manager *self, const gchar *pattern, GError **error); GHashTable *manager_get_properties(Manager *self, GError **error); const GPtrArray *manager_get_adapters(Manager *self); #endif /* __MANAGER_H */ bluez-tools-0.1.38+git662e/src/lib/bluez/network.h0000644000175000017500000000437211454315712022043 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __NETWORK_H #define __NETWORK_H #include #define NETWORK_DBUS_INTERFACE "org.bluez.Network" /* * Type macros */ #define NETWORK_TYPE (network_get_type()) #define NETWORK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), NETWORK_TYPE, Network)) #define NETWORK_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NETWORK_TYPE)) #define NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), NETWORK_TYPE, NetworkClass)) #define NETWORK_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NETWORK_TYPE)) #define NETWORK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), NETWORK_TYPE, NetworkClass)) typedef struct _Network Network; typedef struct _NetworkClass NetworkClass; typedef struct _NetworkPrivate NetworkPrivate; struct _Network { GObject parent_instance; /*< private >*/ NetworkPrivate *priv; }; struct _NetworkClass { GObjectClass parent_class; }; /* used by NETWORK_TYPE */ GType network_get_type(void) G_GNUC_CONST; /* * Method definitions */ gchar *network_connect(Network *self, const gchar *uuid, GError **error); void network_disconnect(Network *self, GError **error); GHashTable *network_get_properties(Network *self, GError **error); const gchar *network_get_dbus_object_path(Network *self); const gboolean network_get_connected(Network *self); const gchar *network_get_interface(Network *self); const gchar *network_get_uuid(Network *self); #endif /* __NETWORK_H */ bluez-tools-0.1.38+git662e/src/lib/bluez/input.h0000644000175000017500000000406211454315712021505 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __INPUT_H #define __INPUT_H #include #define INPUT_DBUS_INTERFACE "org.bluez.Input" /* * Type macros */ #define INPUT_TYPE (input_get_type()) #define INPUT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INPUT_TYPE, Input)) #define INPUT_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INPUT_TYPE)) #define INPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INPUT_TYPE, InputClass)) #define INPUT_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INPUT_TYPE)) #define INPUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INPUT_TYPE, InputClass)) typedef struct _Input Input; typedef struct _InputClass InputClass; typedef struct _InputPrivate InputPrivate; struct _Input { GObject parent_instance; /*< private >*/ InputPrivate *priv; }; struct _InputClass { GObjectClass parent_class; }; /* used by INPUT_TYPE */ GType input_get_type(void) G_GNUC_CONST; /* * Method definitions */ void input_connect(Input *self, GError **error); void input_disconnect(Input *self, GError **error); GHashTable *input_get_properties(Input *self, GError **error); const gchar *input_get_dbus_object_path(Input *self); const gboolean input_get_connected(Input *self); #endif /* __INPUT_H */ bluez-tools-0.1.38+git662e/src/lib/bluez/serial.h0000644000175000017500000000402411454315712021623 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __SERIAL_H #define __SERIAL_H #include #define SERIAL_DBUS_INTERFACE "org.bluez.Serial" /* * Type macros */ #define SERIAL_TYPE (serial_get_type()) #define SERIAL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SERIAL_TYPE, Serial)) #define SERIAL_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), SERIAL_TYPE)) #define SERIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SERIAL_TYPE, SerialClass)) #define SERIAL_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SERIAL_TYPE)) #define SERIAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), SERIAL_TYPE, SerialClass)) typedef struct _Serial Serial; typedef struct _SerialClass SerialClass; typedef struct _SerialPrivate SerialPrivate; struct _Serial { GObject parent_instance; /*< private >*/ SerialPrivate *priv; }; struct _SerialClass { GObjectClass parent_class; }; /* used by SERIAL_TYPE */ GType serial_get_type(void) G_GNUC_CONST; /* * Method definitions */ gchar *serial_connect(Serial *self, const gchar *pattern, GError **error); void serial_disconnect(Serial *self, const gchar *device, GError **error); const gchar *serial_get_dbus_object_path(Serial *self); #endif /* __SERIAL_H */ bluez-tools-0.1.38+git662e/src/lib/bluez/device.h0000644000175000017500000000601611454315711021605 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __DEVICE_H #define __DEVICE_H #include #define DEVICE_DBUS_INTERFACE "org.bluez.Device" /* * Type macros */ #define DEVICE_TYPE (device_get_type()) #define DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), DEVICE_TYPE, Device)) #define DEVICE_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), DEVICE_TYPE)) #define DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), DEVICE_TYPE, DeviceClass)) #define DEVICE_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), DEVICE_TYPE)) #define DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), DEVICE_TYPE, DeviceClass)) typedef struct _Device Device; typedef struct _DeviceClass DeviceClass; typedef struct _DevicePrivate DevicePrivate; struct _Device { GObject parent_instance; /*< private >*/ DevicePrivate *priv; }; struct _DeviceClass { GObjectClass parent_class; }; /* used by DEVICE_TYPE */ GType device_get_type(void) G_GNUC_CONST; /* * Method definitions */ void device_cancel_discovery(Device *self, GError **error); void device_disconnect(Device *self, GError **error); GHashTable *device_discover_services(Device *self, const gchar *pattern, GError **error); GHashTable *device_get_properties(Device *self, GError **error); void device_set_property(Device *self, const gchar *name, const GValue *value, GError **error); const gchar *device_get_dbus_object_path(Device *self); const gchar *device_get_adapter(Device *self); const gchar *device_get_address(Device *self); const gchar *device_get_alias(Device *self); void device_set_alias(Device *self, const gchar *value); const gboolean device_get_blocked(Device *self); void device_set_blocked(Device *self, const gboolean value); const guint32 device_get_class(Device *self); const gboolean device_get_connected(Device *self); const gchar *device_get_icon(Device *self); const gboolean device_get_legacy_pairing(Device *self); const gchar *device_get_name(Device *self); const gboolean device_get_paired(Device *self); const GPtrArray *device_get_services(Device *self); const gboolean device_get_trusted(Device *self); void device_set_trusted(Device *self, const gboolean value); const gchar **device_get_uuids(Device *self); #endif /* __DEVICE_H */ bluez-tools-0.1.38+git662e/src/lib/bluez/agent.h0000644000175000017500000000757111427010077021450 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __AGENT_H #define __AGENT_H #include #include #include "../marshallers.h" #define AGENT_DBUS_PATH "/Agent" /* * Type macros */ #define AGENT_TYPE (agent_get_type()) #define AGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AGENT_TYPE, Agent)) #define AGENT_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGENT_TYPE)) #define AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), AGENT_TYPE, AgentClass)) #define AGENT_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), AGENT_TYPE)) #define AGENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), AGENT_TYPE, AgentClass)) typedef struct _Agent Agent; typedef struct _AgentClass AgentClass; typedef struct _AgentPrivate AgentPrivate; struct _Agent { GObject parent_instance; /*< private >*/ AgentPrivate *priv; }; struct _AgentClass { GObjectClass parent_class; }; /* used by AGENT_TYPE */ GType agent_get_type(void) G_GNUC_CONST; /* * Method definitions */ gboolean agent_release(Agent *self, GError **error); gboolean agent_request_pin_code(Agent *self, const gchar *device, gchar **ret, GError **error); gboolean agent_request_passkey(Agent *self, const gchar *device, guint *ret, GError **error); gboolean agent_display_passkey(Agent *self, const gchar *device, guint passkey, guint8 entered, GError **error); gboolean agent_request_confirmation(Agent *self, const gchar *device, guint passkey, GError **error); gboolean agent_authorize(Agent *self, const gchar *device, const gchar *uuid, GError **error); gboolean agent_confirm_mode_change(Agent *self, const gchar *mode, GError **error); gboolean agent_cancel(Agent *self, GError **error); /* Glue code */ static const DBusGMethodInfo dbus_glib_agent_methods[] = { { (GCallback) agent_release, g_cclosure_bt_marshal_BOOLEAN__POINTER, 0}, { (GCallback) agent_request_pin_code, g_cclosure_bt_marshal_BOOLEAN__BOXED_POINTER_POINTER, 27}, { (GCallback) agent_request_passkey, g_cclosure_bt_marshal_BOOLEAN__BOXED_POINTER_POINTER, 85}, { (GCallback) agent_display_passkey, g_cclosure_bt_marshal_BOOLEAN__BOXED_UINT_UCHAR_POINTER, 143}, { (GCallback) agent_request_confirmation, g_cclosure_bt_marshal_BOOLEAN__BOXED_UINT_POINTER, 212}, { (GCallback) agent_authorize, g_cclosure_bt_marshal_BOOLEAN__BOXED_STRING_POINTER, 274}, { (GCallback) agent_confirm_mode_change, g_cclosure_bt_marshal_BOOLEAN__STRING_POINTER, 323}, { (GCallback) agent_cancel, g_cclosure_bt_marshal_BOOLEAN__POINTER, 369}, }; static const DBusGObjectInfo dbus_glib_agent_object_info = { 0, dbus_glib_agent_methods, 8, "org.bluez.Agent\0Release\0S\0\0org.bluez.Agent\0RequestPinCode\0S\0device\0I\0o\0arg1\0O\0F\0N\0s\0\0org.bluez.Agent\0RequestPasskey\0S\0device\0I\0o\0arg1\0O\0F\0N\0u\0\0org.bluez.Agent\0DisplayPasskey\0S\0device\0I\0o\0passkey\0I\0u\0entered\0I\0y\0\0org.bluez.Agent\0RequestConfirmation\0S\0device\0I\0o\0passkey\0I\0u\0\0org.bluez.Agent\0Authorize\0S\0device\0I\0o\0uuid\0I\0s\0\0org.bluez.Agent\0ConfirmModeChange\0S\0mode\0I\0s\0\0org.bluez.Agent\0Cancel\0S\0\0\0", "\0", "\0" }; #endif /* __AGENT_H */ bluez-tools-0.1.38+git662e/src/lib/bluez/adapter.c0000644000175000017500000006417311454315711021771 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "adapter.h" #define ADAPTER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), ADAPTER_TYPE, AdapterPrivate)) struct _AdapterPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; /* Properties */ gchar *address; guint32 class; GPtrArray *devices; gboolean discoverable; guint32 discoverable_timeout; gboolean discovering; gchar *name; gboolean pairable; guint32 pairable_timeout; gboolean powered; gchar **uuids; /* Async calls */ DBusGProxyCall *create_paired_device_call; }; G_DEFINE_TYPE(Adapter, adapter, G_TYPE_OBJECT); enum { PROP_0, PROP_DBUS_OBJECT_PATH, /* readwrite, construct only */ PROP_ADDRESS, /* readonly */ PROP_CLASS, /* readonly */ PROP_DEVICES, /* readonly */ PROP_DISCOVERABLE, /* readwrite */ PROP_DISCOVERABLE_TIMEOUT, /* readwrite */ PROP_DISCOVERING, /* readonly */ PROP_NAME, /* readwrite */ PROP_PAIRABLE, /* readwrite */ PROP_PAIRABLE_TIMEOUT, /* readwrite */ PROP_POWERED, /* readwrite */ PROP_UUIDS /* readonly */ }; static void _adapter_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _adapter_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); enum { DEVICE_CREATED, DEVICE_DISAPPEARED, DEVICE_FOUND, DEVICE_REMOVED, PROPERTY_CHANGED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; static void device_created_handler(DBusGProxy *dbus_g_proxy, const gchar *device, gpointer data); static void device_disappeared_handler(DBusGProxy *dbus_g_proxy, const gchar *address, gpointer data); static void device_found_handler(DBusGProxy *dbus_g_proxy, const gchar *address, GHashTable *values, gpointer data); static void device_removed_handler(DBusGProxy *dbus_g_proxy, const gchar *device, gpointer data); static void property_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *name, const GValue *value, gpointer data); static void adapter_dispose(GObject *gobject) { Adapter *self = ADAPTER(gobject); /* DBus signals disconnection */ dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "DeviceCreated", G_CALLBACK(device_created_handler), self); dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "DeviceDisappeared", G_CALLBACK(device_disappeared_handler), self); dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "DeviceFound", G_CALLBACK(device_found_handler), self); dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "DeviceRemoved", G_CALLBACK(device_removed_handler), self); dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_CALLBACK(property_changed_handler), self); /* Properties free */ g_free(self->priv->address); g_ptr_array_unref(self->priv->devices); g_free(self->priv->name); g_strfreev(self->priv->uuids); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(adapter_parent_class)->dispose(gobject); } static void adapter_class_init(AdapterClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = adapter_dispose; g_type_class_add_private(klass, sizeof(AdapterPrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _adapter_get_property; gobject_class->set_property = _adapter_set_property; /* object DBusObjectPath [readwrite, construct only] */ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "Adapter D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec); /* string Address [readonly] */ pspec = g_param_spec_string("Address", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_ADDRESS, pspec); /* uint32 Class [readonly] */ pspec = g_param_spec_uint("Class", NULL, NULL, 0, 0xFFFFFFFF, 0, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_CLASS, pspec); /* array{object} Devices [readonly] */ pspec = g_param_spec_boxed("Devices", NULL, NULL, G_TYPE_PTR_ARRAY, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_DEVICES, pspec); /* boolean Discoverable [readwrite] */ pspec = g_param_spec_boolean("Discoverable", NULL, NULL, FALSE, G_PARAM_READWRITE); g_object_class_install_property(gobject_class, PROP_DISCOVERABLE, pspec); /* uint32 DiscoverableTimeout [readwrite] */ pspec = g_param_spec_uint("DiscoverableTimeout", NULL, NULL, 0, 0xFFFFFFFF, 0, G_PARAM_READWRITE); g_object_class_install_property(gobject_class, PROP_DISCOVERABLE_TIMEOUT, pspec); /* boolean Discovering [readonly] */ pspec = g_param_spec_boolean("Discovering", NULL, NULL, FALSE, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_DISCOVERING, pspec); /* string Name [readwrite] */ pspec = g_param_spec_string("Name", NULL, NULL, NULL, G_PARAM_READWRITE); g_object_class_install_property(gobject_class, PROP_NAME, pspec); /* boolean Pairable [readwrite] */ pspec = g_param_spec_boolean("Pairable", NULL, NULL, FALSE, G_PARAM_READWRITE); g_object_class_install_property(gobject_class, PROP_PAIRABLE, pspec); /* uint32 PairableTimeout [readwrite] */ pspec = g_param_spec_uint("PairableTimeout", NULL, NULL, 0, 0xFFFFFFFF, 0, G_PARAM_READWRITE); g_object_class_install_property(gobject_class, PROP_PAIRABLE_TIMEOUT, pspec); /* boolean Powered [readwrite] */ pspec = g_param_spec_boolean("Powered", NULL, NULL, FALSE, G_PARAM_READWRITE); g_object_class_install_property(gobject_class, PROP_POWERED, pspec); /* array{string} UUIDs [readonly] */ pspec = g_param_spec_boxed("UUIDs", NULL, NULL, G_TYPE_STRV, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_UUIDS, pspec); /* Signals registation */ signals[DEVICE_CREATED] = g_signal_new("DeviceCreated", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); signals[DEVICE_DISAPPEARED] = g_signal_new("DeviceDisappeared", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); signals[DEVICE_FOUND] = g_signal_new("DeviceFound", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_bt_marshal_VOID__STRING_BOXED, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_HASH_TABLE); signals[DEVICE_REMOVED] = g_signal_new("DeviceRemoved", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); signals[PROPERTY_CHANGED] = g_signal_new("PropertyChanged", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_bt_marshal_VOID__STRING_BOXED, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VALUE); } static void adapter_init(Adapter *self) { self->priv = ADAPTER_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; /* Async calls init */ self->priv->create_paired_device_call = NULL; g_assert(system_conn != NULL); } static void adapter_post_init(Adapter *self, const gchar *dbus_object_path) { g_assert(dbus_object_path != NULL); g_assert(strlen(dbus_object_path) > 0); g_assert(self->priv->dbus_g_proxy == NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", ADAPTER_DBUS_INTERFACE, dbus_object_path); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, ADAPTER_DBUS_INTERFACE); /* DBus signals connection */ /* DeviceCreated(object device) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "DeviceCreated", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "DeviceCreated", G_CALLBACK(device_created_handler), self, NULL); /* DeviceDisappeared(string address) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "DeviceDisappeared", G_TYPE_STRING, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "DeviceDisappeared", G_CALLBACK(device_disappeared_handler), self, NULL); /* DeviceFound(string address, dict values) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "DeviceFound", G_TYPE_STRING, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "DeviceFound", G_CALLBACK(device_found_handler), self, NULL); /* DeviceRemoved(object device) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "DeviceRemoved", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "DeviceRemoved", G_CALLBACK(device_removed_handler), self, NULL); /* PropertyChanged(string name, variant value) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_CALLBACK(property_changed_handler), self, NULL); /* Properties init */ GHashTable *properties = adapter_get_properties(self, &error); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); g_assert(properties != NULL); /* string Address [readonly] */ if (g_hash_table_lookup(properties, "Address")) { self->priv->address = g_value_dup_string(g_hash_table_lookup(properties, "Address")); } else { self->priv->address = g_strdup("undefined"); } /* uint32 Class [readonly] */ if (g_hash_table_lookup(properties, "Class")) { self->priv->class = g_value_get_uint(g_hash_table_lookup(properties, "Class")); } else { self->priv->class = 0; } /* array{object} Devices [readonly] */ if (g_hash_table_lookup(properties, "Devices")) { self->priv->devices = g_value_dup_boxed(g_hash_table_lookup(properties, "Devices")); } else { self->priv->devices = g_ptr_array_new(); } /* boolean Discoverable [readwrite] */ if (g_hash_table_lookup(properties, "Discoverable")) { self->priv->discoverable = g_value_get_boolean(g_hash_table_lookup(properties, "Discoverable")); } else { self->priv->discoverable = FALSE; } /* uint32 DiscoverableTimeout [readwrite] */ if (g_hash_table_lookup(properties, "DiscoverableTimeout")) { self->priv->discoverable_timeout = g_value_get_uint(g_hash_table_lookup(properties, "DiscoverableTimeout")); } else { self->priv->discoverable_timeout = 0; } /* boolean Discovering [readonly] */ if (g_hash_table_lookup(properties, "Discovering")) { self->priv->discovering = g_value_get_boolean(g_hash_table_lookup(properties, "Discovering")); } else { self->priv->discovering = FALSE; } /* string Name [readwrite] */ if (g_hash_table_lookup(properties, "Name")) { self->priv->name = g_value_dup_string(g_hash_table_lookup(properties, "Name")); } else { self->priv->name = g_strdup("undefined"); } /* boolean Pairable [readwrite] */ if (g_hash_table_lookup(properties, "Pairable")) { self->priv->pairable = g_value_get_boolean(g_hash_table_lookup(properties, "Pairable")); } else { self->priv->pairable = FALSE; } /* uint32 PairableTimeout [readwrite] */ if (g_hash_table_lookup(properties, "PairableTimeout")) { self->priv->pairable_timeout = g_value_get_uint(g_hash_table_lookup(properties, "PairableTimeout")); } else { self->priv->pairable_timeout = 0; } /* boolean Powered [readwrite] */ if (g_hash_table_lookup(properties, "Powered")) { self->priv->powered = g_value_get_boolean(g_hash_table_lookup(properties, "Powered")); } else { self->priv->powered = FALSE; } /* array{string} UUIDs [readonly] */ if (g_hash_table_lookup(properties, "UUIDs")) { self->priv->uuids = (gchar **) g_value_dup_boxed(g_hash_table_lookup(properties, "UUIDs")); } else { self->priv->uuids = g_new0(char *, 1); self->priv->uuids[0] = NULL; } g_hash_table_unref(properties); } static void _adapter_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { Adapter *self = ADAPTER(object); switch (property_id) { case PROP_DBUS_OBJECT_PATH: g_value_set_string(value, adapter_get_dbus_object_path(self)); break; case PROP_ADDRESS: g_value_set_string(value, adapter_get_address(self)); break; case PROP_CLASS: g_value_set_uint(value, adapter_get_class(self)); break; case PROP_DEVICES: g_value_set_boxed(value, adapter_get_devices(self)); break; case PROP_DISCOVERABLE: g_value_set_boolean(value, adapter_get_discoverable(self)); break; case PROP_DISCOVERABLE_TIMEOUT: g_value_set_uint(value, adapter_get_discoverable_timeout(self)); break; case PROP_DISCOVERING: g_value_set_boolean(value, adapter_get_discovering(self)); break; case PROP_NAME: g_value_set_string(value, adapter_get_name(self)); break; case PROP_PAIRABLE: g_value_set_boolean(value, adapter_get_pairable(self)); break; case PROP_PAIRABLE_TIMEOUT: g_value_set_uint(value, adapter_get_pairable_timeout(self)); break; case PROP_POWERED: g_value_set_boolean(value, adapter_get_powered(self)); break; case PROP_UUIDS: g_value_set_boxed(value, adapter_get_uuids(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _adapter_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { Adapter *self = ADAPTER(object); GError *error = NULL; switch (property_id) { case PROP_DBUS_OBJECT_PATH: adapter_post_init(self, g_value_get_string(value)); break; case PROP_DISCOVERABLE: adapter_set_property(self, "Discoverable", value, &error); break; case PROP_DISCOVERABLE_TIMEOUT: adapter_set_property(self, "DiscoverableTimeout", value, &error); break; case PROP_NAME: adapter_set_property(self, "Name", value, &error); break; case PROP_PAIRABLE: adapter_set_property(self, "Pairable", value, &error); break; case PROP_PAIRABLE_TIMEOUT: adapter_set_property(self, "PairableTimeout", value, &error); break; case PROP_POWERED: adapter_set_property(self, "Powered", value, &error); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } static void adapter_async_notify_callback(DBusGProxy *proxy, DBusGProxyCall *call, gpointer data) { gpointer *p = data; void (*AsyncNotifyFunc)(gpointer data) = p[0]; (*AsyncNotifyFunc)(p[1]); g_free(p); } /* Methods */ /* void CancelDeviceCreation(string address) */ void adapter_cancel_device_creation(Adapter *self, const gchar *address, GError **error) { g_assert(ADAPTER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "CancelDeviceCreation", error, G_TYPE_STRING, address, G_TYPE_INVALID, G_TYPE_INVALID); } /* object CreateDevice(string address) */ gchar *adapter_create_device(Adapter *self, const gchar *address, GError **error) { g_assert(ADAPTER_IS(self)); gchar *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "CreateDevice", error, G_TYPE_STRING, address, G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, &ret, G_TYPE_INVALID); return ret; } /* object CreatePairedDevice(string address, object agent, string capability) [async] */ void adapter_create_paired_device_begin(Adapter *self, void (*AsyncNotifyFunc)(gpointer data), gpointer data, const gchar *address, const gchar *agent, const gchar *capability) { g_assert(ADAPTER_IS(self)); g_assert(self->priv->create_paired_device_call == NULL); gpointer *p = g_new0(gpointer, 2); p[0] = AsyncNotifyFunc; p[1] = data; self->priv->create_paired_device_call = dbus_g_proxy_begin_call(self->priv->dbus_g_proxy, "CreatePairedDevice", (DBusGProxyCallNotify) adapter_async_notify_callback, p, NULL, G_TYPE_STRING, address, DBUS_TYPE_G_OBJECT_PATH, agent, G_TYPE_STRING, capability, G_TYPE_INVALID); } gchar *adapter_create_paired_device_end(Adapter *self, GError **error) { g_assert(ADAPTER_IS(self)); g_assert(self->priv->create_paired_device_call != NULL); gchar *ret = NULL; dbus_g_proxy_end_call(self->priv->dbus_g_proxy, self->priv->create_paired_device_call, error, DBUS_TYPE_G_OBJECT_PATH, &ret, G_TYPE_INVALID); self->priv->create_paired_device_call = NULL; return ret; } /* object FindDevice(string address) */ gchar *adapter_find_device(Adapter *self, const gchar *address, GError **error) { g_assert(ADAPTER_IS(self)); gchar *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "FindDevice", error, G_TYPE_STRING, address, G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, &ret, G_TYPE_INVALID); return ret; } /* dict GetProperties() */ GHashTable *adapter_get_properties(Adapter *self, GError **error) { g_assert(ADAPTER_IS(self)); GHashTable *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "GetProperties", error, G_TYPE_INVALID, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, &ret, G_TYPE_INVALID); return ret; } /* void RegisterAgent(object agent, string capability) */ void adapter_register_agent(Adapter *self, const gchar *agent, const gchar *capability, GError **error) { g_assert(ADAPTER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "RegisterAgent", error, DBUS_TYPE_G_OBJECT_PATH, agent, G_TYPE_STRING, capability, G_TYPE_INVALID, G_TYPE_INVALID); } /* void RemoveDevice(object device) */ void adapter_remove_device(Adapter *self, const gchar *device, GError **error) { g_assert(ADAPTER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "RemoveDevice", error, DBUS_TYPE_G_OBJECT_PATH, device, G_TYPE_INVALID, G_TYPE_INVALID); } /* void SetProperty(string name, variant value) */ void adapter_set_property(Adapter *self, const gchar *name, const GValue *value, GError **error) { g_assert(ADAPTER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "SetProperty", error, G_TYPE_STRING, name, G_TYPE_VALUE, value, G_TYPE_INVALID, G_TYPE_INVALID); } /* void StartDiscovery() */ void adapter_start_discovery(Adapter *self, GError **error) { g_assert(ADAPTER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "StartDiscovery", error, G_TYPE_INVALID, G_TYPE_INVALID); } /* void StopDiscovery() */ void adapter_stop_discovery(Adapter *self, GError **error) { g_assert(ADAPTER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "StopDiscovery", error, G_TYPE_INVALID, G_TYPE_INVALID); } /* void UnregisterAgent(object agent) */ void adapter_unregister_agent(Adapter *self, const gchar *agent, GError **error) { g_assert(ADAPTER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "UnregisterAgent", error, DBUS_TYPE_G_OBJECT_PATH, agent, G_TYPE_INVALID, G_TYPE_INVALID); } /* Properties access methods */ const gchar *adapter_get_dbus_object_path(Adapter *self) { g_assert(ADAPTER_IS(self)); return dbus_g_proxy_get_path(self->priv->dbus_g_proxy); } const gchar *adapter_get_address(Adapter *self) { g_assert(ADAPTER_IS(self)); return self->priv->address; } const guint32 adapter_get_class(Adapter *self) { g_assert(ADAPTER_IS(self)); return self->priv->class; } const GPtrArray *adapter_get_devices(Adapter *self) { g_assert(ADAPTER_IS(self)); return self->priv->devices; } const gboolean adapter_get_discoverable(Adapter *self) { g_assert(ADAPTER_IS(self)); return self->priv->discoverable; } void adapter_set_discoverable(Adapter *self, const gboolean value) { g_assert(ADAPTER_IS(self)); GError *error = NULL; GValue t = {0}; g_value_init(&t, G_TYPE_BOOLEAN); g_value_set_boolean(&t, value); adapter_set_property(self, "Discoverable", &t, &error); g_value_unset(&t); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } const guint32 adapter_get_discoverable_timeout(Adapter *self) { g_assert(ADAPTER_IS(self)); return self->priv->discoverable_timeout; } void adapter_set_discoverable_timeout(Adapter *self, const guint32 value) { g_assert(ADAPTER_IS(self)); GError *error = NULL; GValue t = {0}; g_value_init(&t, G_TYPE_UINT); g_value_set_uint(&t, value); adapter_set_property(self, "DiscoverableTimeout", &t, &error); g_value_unset(&t); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } const gboolean adapter_get_discovering(Adapter *self) { g_assert(ADAPTER_IS(self)); return self->priv->discovering; } const gchar *adapter_get_name(Adapter *self) { g_assert(ADAPTER_IS(self)); return self->priv->name; } void adapter_set_name(Adapter *self, const gchar *value) { g_assert(ADAPTER_IS(self)); GError *error = NULL; GValue t = {0}; g_value_init(&t, G_TYPE_STRING); g_value_set_string(&t, value); adapter_set_property(self, "Name", &t, &error); g_value_unset(&t); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } const gboolean adapter_get_pairable(Adapter *self) { g_assert(ADAPTER_IS(self)); return self->priv->pairable; } void adapter_set_pairable(Adapter *self, const gboolean value) { g_assert(ADAPTER_IS(self)); GError *error = NULL; GValue t = {0}; g_value_init(&t, G_TYPE_BOOLEAN); g_value_set_boolean(&t, value); adapter_set_property(self, "Pairable", &t, &error); g_value_unset(&t); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } const guint32 adapter_get_pairable_timeout(Adapter *self) { g_assert(ADAPTER_IS(self)); return self->priv->pairable_timeout; } void adapter_set_pairable_timeout(Adapter *self, const guint32 value) { g_assert(ADAPTER_IS(self)); GError *error = NULL; GValue t = {0}; g_value_init(&t, G_TYPE_UINT); g_value_set_uint(&t, value); adapter_set_property(self, "PairableTimeout", &t, &error); g_value_unset(&t); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } const gboolean adapter_get_powered(Adapter *self) { g_assert(ADAPTER_IS(self)); return self->priv->powered; } void adapter_set_powered(Adapter *self, const gboolean value) { g_assert(ADAPTER_IS(self)); GError *error = NULL; GValue t = {0}; g_value_init(&t, G_TYPE_BOOLEAN); g_value_set_boolean(&t, value); adapter_set_property(self, "Powered", &t, &error); g_value_unset(&t); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } const gchar **adapter_get_uuids(Adapter *self) { g_assert(ADAPTER_IS(self)); return self->priv->uuids; } /* Signals handlers */ static void device_created_handler(DBusGProxy *dbus_g_proxy, const gchar *device, gpointer data) { Adapter *self = ADAPTER(data); g_signal_emit(self, signals[DEVICE_CREATED], 0, device); } static void device_disappeared_handler(DBusGProxy *dbus_g_proxy, const gchar *address, gpointer data) { Adapter *self = ADAPTER(data); g_signal_emit(self, signals[DEVICE_DISAPPEARED], 0, address); } static void device_found_handler(DBusGProxy *dbus_g_proxy, const gchar *address, GHashTable *values, gpointer data) { Adapter *self = ADAPTER(data); g_signal_emit(self, signals[DEVICE_FOUND], 0, address, values); } static void device_removed_handler(DBusGProxy *dbus_g_proxy, const gchar *device, gpointer data) { Adapter *self = ADAPTER(data); g_signal_emit(self, signals[DEVICE_REMOVED], 0, device); } static void property_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *name, const GValue *value, gpointer data) { Adapter *self = ADAPTER(data); if (g_strcmp0(name, "Address") == 0) { g_free(self->priv->address); self->priv->address = g_value_dup_string(value); } else if (g_strcmp0(name, "Class") == 0) { self->priv->class = g_value_get_uint(value); } else if (g_strcmp0(name, "Devices") == 0) { g_ptr_array_unref(self->priv->devices); self->priv->devices = g_value_dup_boxed(value); } else if (g_strcmp0(name, "Discoverable") == 0) { self->priv->discoverable = g_value_get_boolean(value); } else if (g_strcmp0(name, "DiscoverableTimeout") == 0) { self->priv->discoverable_timeout = g_value_get_uint(value); } else if (g_strcmp0(name, "Discovering") == 0) { self->priv->discovering = g_value_get_boolean(value); } else if (g_strcmp0(name, "Name") == 0) { g_free(self->priv->name); self->priv->name = g_value_dup_string(value); } else if (g_strcmp0(name, "Pairable") == 0) { self->priv->pairable = g_value_get_boolean(value); } else if (g_strcmp0(name, "PairableTimeout") == 0) { self->priv->pairable_timeout = g_value_get_uint(value); } else if (g_strcmp0(name, "Powered") == 0) { self->priv->powered = g_value_get_boolean(value); } else if (g_strcmp0(name, "UUIDs") == 0) { g_strfreev(self->priv->uuids); self->priv->uuids = (gchar **) g_value_dup_boxed(value); } g_signal_emit(self, signals[PROPERTY_CHANGED], 0, name, value); } bluez-tools-0.1.38+git662e/src/lib/bluez/network.c0000644000175000017500000002307511454315712022037 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "network.h" #define NETWORK_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), NETWORK_TYPE, NetworkPrivate)) struct _NetworkPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; /* Properties */ gboolean connected; gchar *interface; gchar *uuid; }; G_DEFINE_TYPE(Network, network, G_TYPE_OBJECT); enum { PROP_0, PROP_DBUS_OBJECT_PATH, /* readwrite, construct only */ PROP_CONNECTED, /* readonly */ PROP_INTERFACE, /* readonly */ PROP_UUID /* readonly */ }; static void _network_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _network_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); enum { PROPERTY_CHANGED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; static void property_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *name, const GValue *value, gpointer data); static void network_dispose(GObject *gobject) { Network *self = NETWORK(gobject); /* DBus signals disconnection */ dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_CALLBACK(property_changed_handler), self); /* Properties free */ g_free(self->priv->interface); g_free(self->priv->uuid); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(network_parent_class)->dispose(gobject); } static void network_class_init(NetworkClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = network_dispose; g_type_class_add_private(klass, sizeof(NetworkPrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _network_get_property; gobject_class->set_property = _network_set_property; /* object DBusObjectPath [readwrite, construct only] */ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "Adapter D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec); /* boolean Connected [readonly] */ pspec = g_param_spec_boolean("Connected", NULL, NULL, FALSE, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_CONNECTED, pspec); /* string Interface [readonly] */ pspec = g_param_spec_string("Interface", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_INTERFACE, pspec); /* string UUID [readonly] */ pspec = g_param_spec_string("UUID", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_UUID, pspec); /* Signals registation */ signals[PROPERTY_CHANGED] = g_signal_new("PropertyChanged", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_bt_marshal_VOID__STRING_BOXED, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VALUE); } static void network_init(Network *self) { self->priv = NETWORK_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(system_conn != NULL); } static void network_post_init(Network *self, const gchar *dbus_object_path) { g_assert(dbus_object_path != NULL); g_assert(strlen(dbus_object_path) > 0); g_assert(self->priv->dbus_g_proxy == NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", NETWORK_DBUS_INTERFACE, dbus_object_path); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, NETWORK_DBUS_INTERFACE); /* DBus signals connection */ /* PropertyChanged(string name, variant value) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_CALLBACK(property_changed_handler), self, NULL); /* Properties init */ GHashTable *properties = network_get_properties(self, &error); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); g_assert(properties != NULL); /* boolean Connected [readonly] */ if (g_hash_table_lookup(properties, "Connected")) { self->priv->connected = g_value_get_boolean(g_hash_table_lookup(properties, "Connected")); } else { self->priv->connected = FALSE; } /* string Interface [readonly] */ if (g_hash_table_lookup(properties, "Interface")) { self->priv->interface = g_value_dup_string(g_hash_table_lookup(properties, "Interface")); } else { self->priv->interface = g_strdup("undefined"); } /* string UUID [readonly] */ if (g_hash_table_lookup(properties, "UUID")) { self->priv->uuid = g_value_dup_string(g_hash_table_lookup(properties, "UUID")); } else { self->priv->uuid = g_strdup("undefined"); } g_hash_table_unref(properties); } static void _network_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { Network *self = NETWORK(object); switch (property_id) { case PROP_DBUS_OBJECT_PATH: g_value_set_string(value, network_get_dbus_object_path(self)); break; case PROP_CONNECTED: g_value_set_boolean(value, network_get_connected(self)); break; case PROP_INTERFACE: g_value_set_string(value, network_get_interface(self)); break; case PROP_UUID: g_value_set_string(value, network_get_uuid(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _network_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { Network *self = NETWORK(object); GError *error = NULL; switch (property_id) { case PROP_DBUS_OBJECT_PATH: network_post_init(self, g_value_get_string(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } /* Methods */ /* string Connect(string uuid) */ gchar *network_connect(Network *self, const gchar *uuid, GError **error) { g_assert(NETWORK_IS(self)); gchar *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "Connect", error, G_TYPE_STRING, uuid, G_TYPE_INVALID, G_TYPE_STRING, &ret, G_TYPE_INVALID); return ret; } /* void Disconnect() */ void network_disconnect(Network *self, GError **error) { g_assert(NETWORK_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "Disconnect", error, G_TYPE_INVALID, G_TYPE_INVALID); } /* dict GetProperties() */ GHashTable *network_get_properties(Network *self, GError **error) { g_assert(NETWORK_IS(self)); GHashTable *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "GetProperties", error, G_TYPE_INVALID, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, &ret, G_TYPE_INVALID); return ret; } /* Properties access methods */ const gchar *network_get_dbus_object_path(Network *self) { g_assert(NETWORK_IS(self)); return dbus_g_proxy_get_path(self->priv->dbus_g_proxy); } const gboolean network_get_connected(Network *self) { g_assert(NETWORK_IS(self)); return self->priv->connected; } const gchar *network_get_interface(Network *self) { g_assert(NETWORK_IS(self)); return self->priv->interface; } const gchar *network_get_uuid(Network *self) { g_assert(NETWORK_IS(self)); return self->priv->uuid; } /* Signals handlers */ static void property_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *name, const GValue *value, gpointer data) { Network *self = NETWORK(data); if (g_strcmp0(name, "Connected") == 0) { self->priv->connected = g_value_get_boolean(value); } else if (g_strcmp0(name, "Interface") == 0) { g_free(self->priv->interface); self->priv->interface = g_value_dup_string(value); } else if (g_strcmp0(name, "UUID") == 0) { g_free(self->priv->uuid); self->priv->uuid = g_value_dup_string(value); } g_signal_emit(self, signals[PROPERTY_CHANGED], 0, name, value); } bluez-tools-0.1.38+git662e/src/lib/bluez/serial.c0000644000175000017500000001271611454315712021625 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "serial.h" #define SERIAL_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), SERIAL_TYPE, SerialPrivate)) struct _SerialPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; }; G_DEFINE_TYPE(Serial, serial, G_TYPE_OBJECT); enum { PROP_0, PROP_DBUS_OBJECT_PATH /* readwrite, construct only */ }; static void _serial_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _serial_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); static void serial_dispose(GObject *gobject) { Serial *self = SERIAL(gobject); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(serial_parent_class)->dispose(gobject); } static void serial_class_init(SerialClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = serial_dispose; g_type_class_add_private(klass, sizeof(SerialPrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _serial_get_property; gobject_class->set_property = _serial_set_property; /* object DBusObjectPath [readwrite, construct only] */ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "Adapter D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec); } static void serial_init(Serial *self) { self->priv = SERIAL_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(system_conn != NULL); } static void serial_post_init(Serial *self, const gchar *dbus_object_path) { g_assert(dbus_object_path != NULL); g_assert(strlen(dbus_object_path) > 0); g_assert(self->priv->dbus_g_proxy == NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", SERIAL_DBUS_INTERFACE, dbus_object_path); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, SERIAL_DBUS_INTERFACE); } static void _serial_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { Serial *self = SERIAL(object); switch (property_id) { case PROP_DBUS_OBJECT_PATH: g_value_set_string(value, serial_get_dbus_object_path(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _serial_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { Serial *self = SERIAL(object); GError *error = NULL; switch (property_id) { case PROP_DBUS_OBJECT_PATH: serial_post_init(self, g_value_get_string(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } /* Methods */ /* string Connect(string pattern) */ gchar *serial_connect(Serial *self, const gchar *pattern, GError **error) { g_assert(SERIAL_IS(self)); gchar *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "Connect", error, G_TYPE_STRING, pattern, G_TYPE_INVALID, G_TYPE_STRING, &ret, G_TYPE_INVALID); return ret; } /* void Disconnect(string device) */ void serial_disconnect(Serial *self, const gchar *device, GError **error) { g_assert(SERIAL_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "Disconnect", error, G_TYPE_STRING, device, G_TYPE_INVALID, G_TYPE_INVALID); } /* Properties access methods */ const gchar *serial_get_dbus_object_path(Serial *self) { g_assert(SERIAL_IS(self)); return dbus_g_proxy_get_path(self->priv->dbus_g_proxy); } bluez-tools-0.1.38+git662e/src/lib/bluez/input.c0000644000175000017500000001743511454315712021510 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "input.h" #define INPUT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INPUT_TYPE, InputPrivate)) struct _InputPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; /* Properties */ gboolean connected; }; G_DEFINE_TYPE(Input, input, G_TYPE_OBJECT); enum { PROP_0, PROP_DBUS_OBJECT_PATH, /* readwrite, construct only */ PROP_CONNECTED /* readonly */ }; static void _input_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _input_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); enum { PROPERTY_CHANGED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; static void property_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *name, const GValue *value, gpointer data); static void input_dispose(GObject *gobject) { Input *self = INPUT(gobject); /* DBus signals disconnection */ dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_CALLBACK(property_changed_handler), self); /* Properties free */ /* none */ /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(input_parent_class)->dispose(gobject); } static void input_class_init(InputClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = input_dispose; g_type_class_add_private(klass, sizeof(InputPrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _input_get_property; gobject_class->set_property = _input_set_property; /* object DBusObjectPath [readwrite, construct only] */ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "Adapter D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec); /* boolean Connected [readonly] */ pspec = g_param_spec_boolean("Connected", NULL, NULL, FALSE, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_CONNECTED, pspec); /* Signals registation */ signals[PROPERTY_CHANGED] = g_signal_new("PropertyChanged", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_bt_marshal_VOID__STRING_BOXED, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VALUE); } static void input_init(Input *self) { self->priv = INPUT_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(system_conn != NULL); } static void input_post_init(Input *self, const gchar *dbus_object_path) { g_assert(dbus_object_path != NULL); g_assert(strlen(dbus_object_path) > 0); g_assert(self->priv->dbus_g_proxy == NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", INPUT_DBUS_INTERFACE, dbus_object_path); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, INPUT_DBUS_INTERFACE); /* DBus signals connection */ /* PropertyChanged(string name, variant value) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_CALLBACK(property_changed_handler), self, NULL); /* Properties init */ GHashTable *properties = input_get_properties(self, &error); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); g_assert(properties != NULL); /* boolean Connected [readonly] */ if (g_hash_table_lookup(properties, "Connected")) { self->priv->connected = g_value_get_boolean(g_hash_table_lookup(properties, "Connected")); } else { self->priv->connected = FALSE; } g_hash_table_unref(properties); } static void _input_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { Input *self = INPUT(object); switch (property_id) { case PROP_DBUS_OBJECT_PATH: g_value_set_string(value, input_get_dbus_object_path(self)); break; case PROP_CONNECTED: g_value_set_boolean(value, input_get_connected(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _input_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { Input *self = INPUT(object); GError *error = NULL; switch (property_id) { case PROP_DBUS_OBJECT_PATH: input_post_init(self, g_value_get_string(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } /* Methods */ /* void Connect() */ void input_connect(Input *self, GError **error) { g_assert(INPUT_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "Connect", error, G_TYPE_INVALID, G_TYPE_INVALID); } /* void Disconnect() */ void input_disconnect(Input *self, GError **error) { g_assert(INPUT_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "Disconnect", error, G_TYPE_INVALID, G_TYPE_INVALID); } /* dict GetProperties() */ GHashTable *input_get_properties(Input *self, GError **error) { g_assert(INPUT_IS(self)); GHashTable *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "GetProperties", error, G_TYPE_INVALID, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, &ret, G_TYPE_INVALID); return ret; } /* Properties access methods */ const gchar *input_get_dbus_object_path(Input *self) { g_assert(INPUT_IS(self)); return dbus_g_proxy_get_path(self->priv->dbus_g_proxy); } const gboolean input_get_connected(Input *self) { g_assert(INPUT_IS(self)); return self->priv->connected; } /* Signals handlers */ static void property_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *name, const GValue *value, gpointer data) { Input *self = INPUT(data); if (g_strcmp0(name, "Connected") == 0) { self->priv->connected = g_value_get_boolean(value); } g_signal_emit(self, signals[PROPERTY_CHANGED], 0, name, value); } bluez-tools-0.1.38+git662e/src/lib/bluez/network_server.c0000644000175000017500000001342511454315712023423 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "network_server.h" #define NETWORK_SERVER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), NETWORK_SERVER_TYPE, NetworkServerPrivate)) struct _NetworkServerPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; }; G_DEFINE_TYPE(NetworkServer, network_server, G_TYPE_OBJECT); enum { PROP_0, PROP_DBUS_OBJECT_PATH /* readwrite, construct only */ }; static void _network_server_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _network_server_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); static void network_server_dispose(GObject *gobject) { NetworkServer *self = NETWORK_SERVER(gobject); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(network_server_parent_class)->dispose(gobject); } static void network_server_class_init(NetworkServerClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = network_server_dispose; g_type_class_add_private(klass, sizeof(NetworkServerPrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _network_server_get_property; gobject_class->set_property = _network_server_set_property; /* object DBusObjectPath [readwrite, construct only] */ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "Adapter D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec); } static void network_server_init(NetworkServer *self) { self->priv = NETWORK_SERVER_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(system_conn != NULL); } static void network_server_post_init(NetworkServer *self, const gchar *dbus_object_path) { g_assert(dbus_object_path != NULL); g_assert(strlen(dbus_object_path) > 0); g_assert(self->priv->dbus_g_proxy == NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", NETWORK_SERVER_DBUS_INTERFACE, dbus_object_path); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, NETWORK_SERVER_DBUS_INTERFACE); } static void _network_server_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { NetworkServer *self = NETWORK_SERVER(object); switch (property_id) { case PROP_DBUS_OBJECT_PATH: g_value_set_string(value, network_server_get_dbus_object_path(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _network_server_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { NetworkServer *self = NETWORK_SERVER(object); GError *error = NULL; switch (property_id) { case PROP_DBUS_OBJECT_PATH: network_server_post_init(self, g_value_get_string(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } /* Methods */ /* void Register(string uuid, string bridge) */ void network_server_register(NetworkServer *self, const gchar *uuid, const gchar *bridge, GError **error) { g_assert(NETWORK_SERVER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "Register", error, G_TYPE_STRING, uuid, G_TYPE_STRING, bridge, G_TYPE_INVALID, G_TYPE_INVALID); } /* void Unregister(string uuid) */ void network_server_unregister(NetworkServer *self, const gchar *uuid, GError **error) { g_assert(NETWORK_SERVER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "Unregister", error, G_TYPE_STRING, uuid, G_TYPE_INVALID, G_TYPE_INVALID); } /* Properties access methods */ const gchar *network_server_get_dbus_object_path(NetworkServer *self) { g_assert(NETWORK_SERVER_IS(self)); return dbus_g_proxy_get_path(self->priv->dbus_g_proxy); } bluez-tools-0.1.38+git662e/src/lib/bluez/manager.c0000644000175000017500000002431011454315712021751 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "manager.h" #define MANAGER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), MANAGER_TYPE, ManagerPrivate)) struct _ManagerPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; /* Properties */ GPtrArray *adapters; }; G_DEFINE_TYPE(Manager, manager, G_TYPE_OBJECT); enum { PROP_0, PROP_ADAPTERS /* readonly */ }; static void _manager_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _manager_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); enum { ADAPTER_ADDED, ADAPTER_REMOVED, DEFAULT_ADAPTER_CHANGED, PROPERTY_CHANGED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; static void adapter_added_handler(DBusGProxy *dbus_g_proxy, const gchar *adapter, gpointer data); static void adapter_removed_handler(DBusGProxy *dbus_g_proxy, const gchar *adapter, gpointer data); static void default_adapter_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *adapter, gpointer data); static void property_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *name, const GValue *value, gpointer data); static void manager_dispose(GObject *gobject) { Manager *self = MANAGER(gobject); /* DBus signals disconnection */ dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "AdapterAdded", G_CALLBACK(adapter_added_handler), self); dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "AdapterRemoved", G_CALLBACK(adapter_removed_handler), self); dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "DefaultAdapterChanged", G_CALLBACK(default_adapter_changed_handler), self); dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_CALLBACK(property_changed_handler), self); /* Properties free */ g_ptr_array_unref(self->priv->adapters); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(manager_parent_class)->dispose(gobject); } static void manager_class_init(ManagerClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = manager_dispose; g_type_class_add_private(klass, sizeof(ManagerPrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _manager_get_property; gobject_class->set_property = _manager_set_property; /* array{object} Adapters [readonly] */ pspec = g_param_spec_boxed("Adapters", NULL, NULL, G_TYPE_PTR_ARRAY, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_ADAPTERS, pspec); /* Signals registation */ signals[ADAPTER_ADDED] = g_signal_new("AdapterAdded", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); signals[ADAPTER_REMOVED] = g_signal_new("AdapterRemoved", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); signals[DEFAULT_ADAPTER_CHANGED] = g_signal_new("DefaultAdapterChanged", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); signals[PROPERTY_CHANGED] = g_signal_new("PropertyChanged", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_bt_marshal_VOID__STRING_BOXED, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VALUE); } static void manager_init(Manager *self) { self->priv = MANAGER_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(system_conn != NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", MANAGER_DBUS_PATH, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", MANAGER_DBUS_INTERFACE, MANAGER_DBUS_PATH); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", MANAGER_DBUS_PATH, MANAGER_DBUS_INTERFACE); /* DBus signals connection */ /* AdapterAdded(object adapter) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "AdapterAdded", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "AdapterAdded", G_CALLBACK(adapter_added_handler), self, NULL); /* AdapterRemoved(object adapter) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "AdapterRemoved", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "AdapterRemoved", G_CALLBACK(adapter_removed_handler), self, NULL); /* DefaultAdapterChanged(object adapter) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "DefaultAdapterChanged", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "DefaultAdapterChanged", G_CALLBACK(default_adapter_changed_handler), self, NULL); /* PropertyChanged(string name, variant value) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_CALLBACK(property_changed_handler), self, NULL); /* Properties init */ GHashTable *properties = manager_get_properties(self, &error); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); g_assert(properties != NULL); /* array{object} Adapters [readonly] */ if (g_hash_table_lookup(properties, "Adapters")) { self->priv->adapters = g_value_dup_boxed(g_hash_table_lookup(properties, "Adapters")); } else { self->priv->adapters = g_ptr_array_new(); } g_hash_table_unref(properties); } static void _manager_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { Manager *self = MANAGER(object); switch (property_id) { case PROP_ADAPTERS: g_value_set_boxed(value, manager_get_adapters(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _manager_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { Manager *self = MANAGER(object); GError *error = NULL; switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } /* Methods */ /* object DefaultAdapter() */ gchar *manager_default_adapter(Manager *self, GError **error) { g_assert(MANAGER_IS(self)); gchar *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "DefaultAdapter", error, G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, &ret, G_TYPE_INVALID); return ret; } /* object FindAdapter(string pattern) */ gchar *manager_find_adapter(Manager *self, const gchar *pattern, GError **error) { g_assert(MANAGER_IS(self)); gchar *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "FindAdapter", error, G_TYPE_STRING, pattern, G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, &ret, G_TYPE_INVALID); return ret; } /* dict GetProperties() */ GHashTable *manager_get_properties(Manager *self, GError **error) { g_assert(MANAGER_IS(self)); GHashTable *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "GetProperties", error, G_TYPE_INVALID, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, &ret, G_TYPE_INVALID); return ret; } /* Properties access methods */ const GPtrArray *manager_get_adapters(Manager *self) { g_assert(MANAGER_IS(self)); return self->priv->adapters; } /* Signals handlers */ static void adapter_added_handler(DBusGProxy *dbus_g_proxy, const gchar *adapter, gpointer data) { Manager *self = MANAGER(data); g_signal_emit(self, signals[ADAPTER_ADDED], 0, adapter); } static void adapter_removed_handler(DBusGProxy *dbus_g_proxy, const gchar *adapter, gpointer data) { Manager *self = MANAGER(data); g_signal_emit(self, signals[ADAPTER_REMOVED], 0, adapter); } static void default_adapter_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *adapter, gpointer data) { Manager *self = MANAGER(data); g_signal_emit(self, signals[DEFAULT_ADAPTER_CHANGED], 0, adapter); } static void property_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *name, const GValue *value, gpointer data) { Manager *self = MANAGER(data); if (g_strcmp0(name, "Adapters") == 0) { g_ptr_array_unref(self->priv->adapters); self->priv->adapters = g_value_dup_boxed(value); } g_signal_emit(self, signals[PROPERTY_CHANGED], 0, name, value); } bluez-tools-0.1.38+git662e/src/lib/bluez/audio.c0000644000175000017500000001741711454315711021451 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "audio.h" #define AUDIO_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), AUDIO_TYPE, AudioPrivate)) struct _AudioPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; /* Properties */ gchar *state; }; G_DEFINE_TYPE(Audio, audio, G_TYPE_OBJECT); enum { PROP_0, PROP_DBUS_OBJECT_PATH, /* readwrite, construct only */ PROP_STATE /* readonly */ }; static void _audio_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _audio_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); enum { PROPERTY_CHANGED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; static void property_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *name, const GValue *value, gpointer data); static void audio_dispose(GObject *gobject) { Audio *self = AUDIO(gobject); /* DBus signals disconnection */ dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_CALLBACK(property_changed_handler), self); /* Properties free */ g_free(self->priv->state); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(audio_parent_class)->dispose(gobject); } static void audio_class_init(AudioClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = audio_dispose; g_type_class_add_private(klass, sizeof(AudioPrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _audio_get_property; gobject_class->set_property = _audio_set_property; /* object DBusObjectPath [readwrite, construct only] */ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "Adapter D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec); /* string State [readonly] */ pspec = g_param_spec_string("State", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_STATE, pspec); /* Signals registation */ signals[PROPERTY_CHANGED] = g_signal_new("PropertyChanged", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_bt_marshal_VOID__STRING_BOXED, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VALUE); } static void audio_init(Audio *self) { self->priv = AUDIO_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(system_conn != NULL); } static void audio_post_init(Audio *self, const gchar *dbus_object_path) { g_assert(dbus_object_path != NULL); g_assert(strlen(dbus_object_path) > 0); g_assert(self->priv->dbus_g_proxy == NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", AUDIO_DBUS_INTERFACE, dbus_object_path); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, AUDIO_DBUS_INTERFACE); /* DBus signals connection */ /* PropertyChanged(string name, variant value) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_CALLBACK(property_changed_handler), self, NULL); /* Properties init */ GHashTable *properties = audio_get_properties(self, &error); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); g_assert(properties != NULL); /* string State [readonly] */ if (g_hash_table_lookup(properties, "State")) { self->priv->state = g_value_dup_string(g_hash_table_lookup(properties, "State")); } else { self->priv->state = g_strdup("undefined"); } g_hash_table_unref(properties); } static void _audio_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { Audio *self = AUDIO(object); switch (property_id) { case PROP_DBUS_OBJECT_PATH: g_value_set_string(value, audio_get_dbus_object_path(self)); break; case PROP_STATE: g_value_set_string(value, audio_get_state(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _audio_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { Audio *self = AUDIO(object); GError *error = NULL; switch (property_id) { case PROP_DBUS_OBJECT_PATH: audio_post_init(self, g_value_get_string(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } /* Methods */ /* void Connect() */ void audio_connect(Audio *self, GError **error) { g_assert(AUDIO_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "Connect", error, G_TYPE_INVALID, G_TYPE_INVALID); } /* void Disconnect() */ void audio_disconnect(Audio *self, GError **error) { g_assert(AUDIO_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "Disconnect", error, G_TYPE_INVALID, G_TYPE_INVALID); } /* dict GetProperties() */ GHashTable *audio_get_properties(Audio *self, GError **error) { g_assert(AUDIO_IS(self)); GHashTable *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "GetProperties", error, G_TYPE_INVALID, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, &ret, G_TYPE_INVALID); return ret; } /* Properties access methods */ const gchar *audio_get_dbus_object_path(Audio *self) { g_assert(AUDIO_IS(self)); return dbus_g_proxy_get_path(self->priv->dbus_g_proxy); } const gchar *audio_get_state(Audio *self) { g_assert(AUDIO_IS(self)); return self->priv->state; } /* Signals handlers */ static void property_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *name, const GValue *value, gpointer data) { Audio *self = AUDIO(data); if (g_strcmp0(name, "State") == 0) { g_free(self->priv->state); self->priv->state = g_value_dup_string(value); } g_signal_emit(self, signals[PROPERTY_CHANGED], 0, name, value); } bluez-tools-0.1.38+git662e/src/lib/bluez/network_server.h0000644000175000017500000000447311454315712023433 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __NETWORK_SERVER_H #define __NETWORK_SERVER_H #include #define NETWORK_SERVER_DBUS_INTERFACE "org.bluez.NetworkServer" /* * Type macros */ #define NETWORK_SERVER_TYPE (network_server_get_type()) #define NETWORK_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), NETWORK_SERVER_TYPE, NetworkServer)) #define NETWORK_SERVER_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NETWORK_SERVER_TYPE)) #define NETWORK_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), NETWORK_SERVER_TYPE, NetworkServerClass)) #define NETWORK_SERVER_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NETWORK_SERVER_TYPE)) #define NETWORK_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), NETWORK_SERVER_TYPE, NetworkServerClass)) typedef struct _NetworkServer NetworkServer; typedef struct _NetworkServerClass NetworkServerClass; typedef struct _NetworkServerPrivate NetworkServerPrivate; struct _NetworkServer { GObject parent_instance; /*< private >*/ NetworkServerPrivate *priv; }; struct _NetworkServerClass { GObjectClass parent_class; }; /* used by NETWORK_SERVER_TYPE */ GType network_server_get_type(void) G_GNUC_CONST; /* * Method definitions */ void network_server_register(NetworkServer *self, const gchar *uuid, const gchar *bridge, GError **error); void network_server_unregister(NetworkServer *self, const gchar *uuid, GError **error); const gchar *network_server_get_dbus_object_path(NetworkServer *self); #endif /* __NETWORK_SERVER_H */ bluez-tools-0.1.38+git662e/src/lib/bluez/device.c0000644000175000017500000004774211454315712021614 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "device.h" #define DEVICE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), DEVICE_TYPE, DevicePrivate)) struct _DevicePrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; /* Properties */ gchar *adapter; gchar *address; gchar *alias; gboolean blocked; guint32 class; gboolean connected; gchar *icon; gboolean legacy_pairing; gchar *name; gboolean paired; GPtrArray *services; gboolean trusted; gchar **uuids; }; G_DEFINE_TYPE(Device, device, G_TYPE_OBJECT); enum { PROP_0, PROP_DBUS_OBJECT_PATH, /* readwrite, construct only */ PROP_ADAPTER, /* readonly */ PROP_ADDRESS, /* readonly */ PROP_ALIAS, /* readwrite */ PROP_BLOCKED, /* readwrite */ PROP_CLASS, /* readonly */ PROP_CONNECTED, /* readonly */ PROP_ICON, /* readonly */ PROP_LEGACY_PAIRING, /* readonly */ PROP_NAME, /* readonly */ PROP_PAIRED, /* readonly */ PROP_SERVICES, /* readonly */ PROP_TRUSTED, /* readwrite */ PROP_UUIDS /* readonly */ }; static void _device_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _device_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); enum { DISCONNECT_REQUESTED, PROPERTY_CHANGED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; static void disconnect_requested_handler(DBusGProxy *dbus_g_proxy, gpointer data); static void property_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *name, const GValue *value, gpointer data); static void device_dispose(GObject *gobject) { Device *self = DEVICE(gobject); /* DBus signals disconnection */ dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "DisconnectRequested", G_CALLBACK(disconnect_requested_handler), self); dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_CALLBACK(property_changed_handler), self); /* Properties free */ g_free(self->priv->adapter); g_free(self->priv->address); g_free(self->priv->alias); g_free(self->priv->icon); g_free(self->priv->name); g_ptr_array_unref(self->priv->services); g_strfreev(self->priv->uuids); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(device_parent_class)->dispose(gobject); } static void device_class_init(DeviceClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = device_dispose; g_type_class_add_private(klass, sizeof(DevicePrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _device_get_property; gobject_class->set_property = _device_set_property; /* object DBusObjectPath [readwrite, construct only] */ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "Adapter D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec); /* object Adapter [readonly] */ pspec = g_param_spec_string("Adapter", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_ADAPTER, pspec); /* string Address [readonly] */ pspec = g_param_spec_string("Address", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_ADDRESS, pspec); /* string Alias [readwrite] */ pspec = g_param_spec_string("Alias", NULL, NULL, NULL, G_PARAM_READWRITE); g_object_class_install_property(gobject_class, PROP_ALIAS, pspec); /* boolean Blocked [readwrite] */ pspec = g_param_spec_boolean("Blocked", NULL, NULL, FALSE, G_PARAM_READWRITE); g_object_class_install_property(gobject_class, PROP_BLOCKED, pspec); /* uint32 Class [readonly] */ pspec = g_param_spec_uint("Class", NULL, NULL, 0, 0xFFFFFFFF, 0, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_CLASS, pspec); /* boolean Connected [readonly] */ pspec = g_param_spec_boolean("Connected", NULL, NULL, FALSE, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_CONNECTED, pspec); /* string Icon [readonly] */ pspec = g_param_spec_string("Icon", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_ICON, pspec); /* boolean LegacyPairing [readonly] */ pspec = g_param_spec_boolean("LegacyPairing", NULL, NULL, FALSE, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_LEGACY_PAIRING, pspec); /* string Name [readonly] */ pspec = g_param_spec_string("Name", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_NAME, pspec); /* boolean Paired [readonly] */ pspec = g_param_spec_boolean("Paired", NULL, NULL, FALSE, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_PAIRED, pspec); /* array{object} Services [readonly] */ pspec = g_param_spec_boxed("Services", NULL, NULL, G_TYPE_PTR_ARRAY, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_SERVICES, pspec); /* boolean Trusted [readwrite] */ pspec = g_param_spec_boolean("Trusted", NULL, NULL, FALSE, G_PARAM_READWRITE); g_object_class_install_property(gobject_class, PROP_TRUSTED, pspec); /* array{string} UUIDs [readonly] */ pspec = g_param_spec_boxed("UUIDs", NULL, NULL, G_TYPE_STRV, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_UUIDS, pspec); /* Signals registation */ signals[DISCONNECT_REQUESTED] = g_signal_new("DisconnectRequested", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[PROPERTY_CHANGED] = g_signal_new("PropertyChanged", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_bt_marshal_VOID__STRING_BOXED, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VALUE); } static void device_init(Device *self) { self->priv = DEVICE_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(system_conn != NULL); } static void device_post_init(Device *self, const gchar *dbus_object_path) { g_assert(dbus_object_path != NULL); g_assert(strlen(dbus_object_path) > 0); g_assert(self->priv->dbus_g_proxy == NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", DEVICE_DBUS_INTERFACE, dbus_object_path); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(system_conn, "org.bluez", dbus_object_path, DEVICE_DBUS_INTERFACE); /* DBus signals connection */ /* DisconnectRequested() */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "DisconnectRequested", G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "DisconnectRequested", G_CALLBACK(disconnect_requested_handler), self, NULL); /* PropertyChanged(string name, variant value) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "PropertyChanged", G_CALLBACK(property_changed_handler), self, NULL); /* Properties init */ GHashTable *properties = device_get_properties(self, &error); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); g_assert(properties != NULL); /* object Adapter [readonly] */ if (g_hash_table_lookup(properties, "Adapter")) { self->priv->adapter = (gchar *) g_value_dup_boxed(g_hash_table_lookup(properties, "Adapter")); } else { self->priv->adapter = g_strdup("undefined"); } /* string Address [readonly] */ if (g_hash_table_lookup(properties, "Address")) { self->priv->address = g_value_dup_string(g_hash_table_lookup(properties, "Address")); } else { self->priv->address = g_strdup("undefined"); } /* string Alias [readwrite] */ if (g_hash_table_lookup(properties, "Alias")) { self->priv->alias = g_value_dup_string(g_hash_table_lookup(properties, "Alias")); } else { self->priv->alias = g_strdup("undefined"); } /* boolean Blocked [readwrite] */ if (g_hash_table_lookup(properties, "Blocked")) { self->priv->blocked = g_value_get_boolean(g_hash_table_lookup(properties, "Blocked")); } else { self->priv->blocked = FALSE; } /* uint32 Class [readonly] */ if (g_hash_table_lookup(properties, "Class")) { self->priv->class = g_value_get_uint(g_hash_table_lookup(properties, "Class")); } else { self->priv->class = 0; } /* boolean Connected [readonly] */ if (g_hash_table_lookup(properties, "Connected")) { self->priv->connected = g_value_get_boolean(g_hash_table_lookup(properties, "Connected")); } else { self->priv->connected = FALSE; } /* string Icon [readonly] */ if (g_hash_table_lookup(properties, "Icon")) { self->priv->icon = g_value_dup_string(g_hash_table_lookup(properties, "Icon")); } else { self->priv->icon = g_strdup("undefined"); } /* boolean LegacyPairing [readonly] */ if (g_hash_table_lookup(properties, "LegacyPairing")) { self->priv->legacy_pairing = g_value_get_boolean(g_hash_table_lookup(properties, "LegacyPairing")); } else { self->priv->legacy_pairing = FALSE; } /* string Name [readonly] */ if (g_hash_table_lookup(properties, "Name")) { self->priv->name = g_value_dup_string(g_hash_table_lookup(properties, "Name")); } else { self->priv->name = g_strdup("undefined"); } /* boolean Paired [readonly] */ if (g_hash_table_lookup(properties, "Paired")) { self->priv->paired = g_value_get_boolean(g_hash_table_lookup(properties, "Paired")); } else { self->priv->paired = FALSE; } /* array{object} Services [readonly] */ if (g_hash_table_lookup(properties, "Services")) { self->priv->services = g_value_dup_boxed(g_hash_table_lookup(properties, "Services")); } else { self->priv->services = g_ptr_array_new(); } /* boolean Trusted [readwrite] */ if (g_hash_table_lookup(properties, "Trusted")) { self->priv->trusted = g_value_get_boolean(g_hash_table_lookup(properties, "Trusted")); } else { self->priv->trusted = FALSE; } /* array{string} UUIDs [readonly] */ if (g_hash_table_lookup(properties, "UUIDs")) { self->priv->uuids = (gchar **) g_value_dup_boxed(g_hash_table_lookup(properties, "UUIDs")); } else { self->priv->uuids = g_new0(char *, 1); self->priv->uuids[0] = NULL; } g_hash_table_unref(properties); } static void _device_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { Device *self = DEVICE(object); switch (property_id) { case PROP_DBUS_OBJECT_PATH: g_value_set_string(value, device_get_dbus_object_path(self)); break; case PROP_ADAPTER: g_value_set_string(value, device_get_adapter(self)); break; case PROP_ADDRESS: g_value_set_string(value, device_get_address(self)); break; case PROP_ALIAS: g_value_set_string(value, device_get_alias(self)); break; case PROP_BLOCKED: g_value_set_boolean(value, device_get_blocked(self)); break; case PROP_CLASS: g_value_set_uint(value, device_get_class(self)); break; case PROP_CONNECTED: g_value_set_boolean(value, device_get_connected(self)); break; case PROP_ICON: g_value_set_string(value, device_get_icon(self)); break; case PROP_LEGACY_PAIRING: g_value_set_boolean(value, device_get_legacy_pairing(self)); break; case PROP_NAME: g_value_set_string(value, device_get_name(self)); break; case PROP_PAIRED: g_value_set_boolean(value, device_get_paired(self)); break; case PROP_SERVICES: g_value_set_boxed(value, device_get_services(self)); break; case PROP_TRUSTED: g_value_set_boolean(value, device_get_trusted(self)); break; case PROP_UUIDS: g_value_set_boxed(value, device_get_uuids(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _device_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { Device *self = DEVICE(object); GError *error = NULL; switch (property_id) { case PROP_DBUS_OBJECT_PATH: device_post_init(self, g_value_get_string(value)); break; case PROP_ALIAS: device_set_property(self, "Alias", value, &error); break; case PROP_BLOCKED: device_set_property(self, "Blocked", value, &error); break; case PROP_TRUSTED: device_set_property(self, "Trusted", value, &error); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } /* Methods */ /* void CancelDiscovery() */ void device_cancel_discovery(Device *self, GError **error) { g_assert(DEVICE_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "CancelDiscovery", error, G_TYPE_INVALID, G_TYPE_INVALID); } /* void Disconnect() */ void device_disconnect(Device *self, GError **error) { g_assert(DEVICE_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "Disconnect", error, G_TYPE_INVALID, G_TYPE_INVALID); } /* dict{u,s} DiscoverServices(string pattern) */ GHashTable *device_discover_services(Device *self, const gchar *pattern, GError **error) { g_assert(DEVICE_IS(self)); GHashTable *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "DiscoverServices", error, G_TYPE_STRING, pattern, G_TYPE_INVALID, DBUS_TYPE_G_UINT_STRING_HASHTABLE, &ret, G_TYPE_INVALID); return ret; } /* dict GetProperties() */ GHashTable *device_get_properties(Device *self, GError **error) { g_assert(DEVICE_IS(self)); GHashTable *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "GetProperties", error, G_TYPE_INVALID, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, &ret, G_TYPE_INVALID); return ret; } /* void SetProperty(string name, variant value) */ void device_set_property(Device *self, const gchar *name, const GValue *value, GError **error) { g_assert(DEVICE_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "SetProperty", error, G_TYPE_STRING, name, G_TYPE_VALUE, value, G_TYPE_INVALID, G_TYPE_INVALID); } /* Properties access methods */ const gchar *device_get_dbus_object_path(Device *self) { g_assert(DEVICE_IS(self)); return dbus_g_proxy_get_path(self->priv->dbus_g_proxy); } const gchar *device_get_adapter(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->adapter; } const gchar *device_get_address(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->address; } const gchar *device_get_alias(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->alias; } void device_set_alias(Device *self, const gchar *value) { g_assert(DEVICE_IS(self)); GError *error = NULL; GValue t = {0}; g_value_init(&t, G_TYPE_STRING); g_value_set_string(&t, value); device_set_property(self, "Alias", &t, &error); g_value_unset(&t); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } const gboolean device_get_blocked(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->blocked; } void device_set_blocked(Device *self, const gboolean value) { g_assert(DEVICE_IS(self)); GError *error = NULL; GValue t = {0}; g_value_init(&t, G_TYPE_BOOLEAN); g_value_set_boolean(&t, value); device_set_property(self, "Blocked", &t, &error); g_value_unset(&t); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } const guint32 device_get_class(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->class; } const gboolean device_get_connected(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->connected; } const gchar *device_get_icon(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->icon; } const gboolean device_get_legacy_pairing(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->legacy_pairing; } const gchar *device_get_name(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->name; } const gboolean device_get_paired(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->paired; } const GPtrArray *device_get_services(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->services; } const gboolean device_get_trusted(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->trusted; } void device_set_trusted(Device *self, const gboolean value) { g_assert(DEVICE_IS(self)); GError *error = NULL; GValue t = {0}; g_value_init(&t, G_TYPE_BOOLEAN); g_value_set_boolean(&t, value); device_set_property(self, "Trusted", &t, &error); g_value_unset(&t); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } const gchar **device_get_uuids(Device *self) { g_assert(DEVICE_IS(self)); return self->priv->uuids; } /* Signals handlers */ static void disconnect_requested_handler(DBusGProxy *dbus_g_proxy, gpointer data) { Device *self = DEVICE(data); g_signal_emit(self, signals[DISCONNECT_REQUESTED], 0); } static void property_changed_handler(DBusGProxy *dbus_g_proxy, const gchar *name, const GValue *value, gpointer data) { Device *self = DEVICE(data); if (g_strcmp0(name, "Adapter") == 0) { g_free(self->priv->adapter); self->priv->adapter = (gchar *) g_value_dup_boxed(value); } else if (g_strcmp0(name, "Address") == 0) { g_free(self->priv->address); self->priv->address = g_value_dup_string(value); } else if (g_strcmp0(name, "Alias") == 0) { g_free(self->priv->alias); self->priv->alias = g_value_dup_string(value); } else if (g_strcmp0(name, "Blocked") == 0) { self->priv->blocked = g_value_get_boolean(value); } else if (g_strcmp0(name, "Class") == 0) { self->priv->class = g_value_get_uint(value); } else if (g_strcmp0(name, "Connected") == 0) { self->priv->connected = g_value_get_boolean(value); } else if (g_strcmp0(name, "Icon") == 0) { g_free(self->priv->icon); self->priv->icon = g_value_dup_string(value); } else if (g_strcmp0(name, "LegacyPairing") == 0) { self->priv->legacy_pairing = g_value_get_boolean(value); } else if (g_strcmp0(name, "Name") == 0) { g_free(self->priv->name); self->priv->name = g_value_dup_string(value); } else if (g_strcmp0(name, "Paired") == 0) { self->priv->paired = g_value_get_boolean(value); } else if (g_strcmp0(name, "Services") == 0) { g_ptr_array_unref(self->priv->services); self->priv->services = g_value_dup_boxed(value); } else if (g_strcmp0(name, "Trusted") == 0) { self->priv->trusted = g_value_get_boolean(value); } else if (g_strcmp0(name, "UUIDs") == 0) { g_strfreev(self->priv->uuids); self->priv->uuids = (gchar **) g_value_dup_boxed(value); } g_signal_emit(self, signals[PROPERTY_CHANGED], 0, name, value); } bluez-tools-0.1.38+git662e/src/lib/bluez/adapter.h0000644000175000017500000000762311454315711021773 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __ADAPTER_H #define __ADAPTER_H #include #define ADAPTER_DBUS_INTERFACE "org.bluez.Adapter" /* * Type macros */ #define ADAPTER_TYPE (adapter_get_type()) #define ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADAPTER_TYPE, Adapter)) #define ADAPTER_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADAPTER_TYPE)) #define ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADAPTER_TYPE, AdapterClass)) #define ADAPTER_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADAPTER_TYPE)) #define ADAPTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADAPTER_TYPE, AdapterClass)) typedef struct _Adapter Adapter; typedef struct _AdapterClass AdapterClass; typedef struct _AdapterPrivate AdapterPrivate; struct _Adapter { GObject parent_instance; /*< private >*/ AdapterPrivate *priv; }; struct _AdapterClass { GObjectClass parent_class; }; /* used by ADAPTER_TYPE */ GType adapter_get_type(void) G_GNUC_CONST; /* * Method definitions */ void adapter_cancel_device_creation(Adapter *self, const gchar *address, GError **error); gchar *adapter_create_device(Adapter *self, const gchar *address, GError **error); void adapter_create_paired_device_begin(Adapter *self, void (*AsyncNotifyFunc)(gpointer data), gpointer data, const gchar *address, const gchar *agent, const gchar *capability); gchar *adapter_create_paired_device_end(Adapter *self, GError **error); gchar *adapter_find_device(Adapter *self, const gchar *address, GError **error); GHashTable *adapter_get_properties(Adapter *self, GError **error); void adapter_register_agent(Adapter *self, const gchar *agent, const gchar *capability, GError **error); void adapter_remove_device(Adapter *self, const gchar *device, GError **error); void adapter_set_property(Adapter *self, const gchar *name, const GValue *value, GError **error); void adapter_start_discovery(Adapter *self, GError **error); void adapter_stop_discovery(Adapter *self, GError **error); void adapter_unregister_agent(Adapter *self, const gchar *agent, GError **error); const gchar *adapter_get_dbus_object_path(Adapter *self); const gchar *adapter_get_address(Adapter *self); const guint32 adapter_get_class(Adapter *self); const GPtrArray *adapter_get_devices(Adapter *self); const gboolean adapter_get_discoverable(Adapter *self); void adapter_set_discoverable(Adapter *self, const gboolean value); const guint32 adapter_get_discoverable_timeout(Adapter *self); void adapter_set_discoverable_timeout(Adapter *self, const guint32 value); const gboolean adapter_get_discovering(Adapter *self); const gchar *adapter_get_name(Adapter *self); void adapter_set_name(Adapter *self, const gchar *value); const gboolean adapter_get_pairable(Adapter *self); void adapter_set_pairable(Adapter *self, const gboolean value); const guint32 adapter_get_pairable_timeout(Adapter *self); void adapter_set_pairable_timeout(Adapter *self, const guint32 value); const gboolean adapter_get_powered(Adapter *self); void adapter_set_powered(Adapter *self, const gboolean value); const gchar **adapter_get_uuids(Adapter *self); #endif /* __ADAPTER_H */ bluez-tools-0.1.38+git662e/src/lib/bluez/audio.h0000644000175000017500000000405411454315711021447 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __AUDIO_H #define __AUDIO_H #include #define AUDIO_DBUS_INTERFACE "org.bluez.Audio" /* * Type macros */ #define AUDIO_TYPE (audio_get_type()) #define AUDIO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AUDIO_TYPE, Audio)) #define AUDIO_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), AUDIO_TYPE)) #define AUDIO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), AUDIO_TYPE, AudioClass)) #define AUDIO_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), AUDIO_TYPE)) #define AUDIO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), AUDIO_TYPE, AudioClass)) typedef struct _Audio Audio; typedef struct _AudioClass AudioClass; typedef struct _AudioPrivate AudioPrivate; struct _Audio { GObject parent_instance; /*< private >*/ AudioPrivate *priv; }; struct _AudioClass { GObjectClass parent_class; }; /* used by AUDIO_TYPE */ GType audio_get_type(void) G_GNUC_CONST; /* * Method definitions */ void audio_connect(Audio *self, GError **error); void audio_disconnect(Audio *self, GError **error); GHashTable *audio_get_properties(Audio *self, GError **error); const gchar *audio_get_dbus_object_path(Audio *self); const gchar *audio_get_state(Audio *self); #endif /* __AUDIO_H */ bluez-tools-0.1.38+git662e/src/lib/sdp.c0000644000175000017500000002316211415504647020014 0ustar iwamatsuiwamatsu/* * * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2001-2002 Ricky Yuen * Copyright (C) 2003-2007 Marcel Holtmann * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "sdp.h" /* UUID name lookup table */ typedef struct { int uuid; char* name; } sdp_uuid_nam_lookup_table_t; static sdp_uuid_nam_lookup_table_t sdp_uuid_nam_lookup_table[] = { { SDP_UUID_SDP, "SDP" }, { SDP_UUID_UDP, "UDP" }, { SDP_UUID_RFCOMM, "RFCOMM" }, { SDP_UUID_TCP, "TCP" }, { SDP_UUID_TCS_BIN, "TCS-BIN" }, { SDP_UUID_TCS_AT, "TCS-AT" }, { SDP_UUID_OBEX, "OBEX" }, { SDP_UUID_IP, "IP" }, { SDP_UUID_FTP, "FTP" }, { SDP_UUID_HTTP, "HTTP" }, { SDP_UUID_WSP, "WSP" }, { SDP_UUID_L2CAP, "L2CAP" }, { SDP_UUID_BNEP, "BNEP" }, /* PAN */ { SDP_UUID_HIDP, "HIDP" }, /* HID */ { SDP_UUID_AVCTP, "AVCTP" }, /* AVCTP */ { SDP_UUID_AVDTP, "AVDTP" }, /* AVDTP */ { SDP_UUID_CMTP, "CMTP" }, /* CIP */ { SDP_UUID_UDI_C_PLANE, "UDI_C-Plane" }, /* UDI */ { SDP_UUID_SERVICE_DISCOVERY_SERVER, "SDServer" }, { SDP_UUID_BROWSE_GROUP_DESCRIPTOR, "BrwsGrpDesc" }, { SDP_UUID_PUBLIC_BROWSE_GROUP, "PubBrwsGrp" }, { SDP_UUID_SERIAL_PORT, "SP" }, { SDP_UUID_LAN_ACCESS_PPP, "LAN" }, { SDP_UUID_DIALUP_NETWORKING, "DUN" }, { SDP_UUID_IR_MC_SYNC, "IRMCSync" }, { SDP_UUID_OBEX_OBJECT_PUSH, "OBEXObjPush" }, { SDP_UUID_OBEX_FILE_TRANSFER, "OBEXObjTrnsf" }, { SDP_UUID_IR_MC_SYNC_COMMAND, "IRMCSyncCmd" }, { SDP_UUID_HEADSET, "Headset" }, { SDP_UUID_CORDLESS_TELEPHONY, "CordlessTel" }, { SDP_UUID_AUDIO_SOURCE, "AudioSource" }, /* A2DP */ { SDP_UUID_AUDIO_SINK, "AudioSink" }, /* A2DP */ { SDP_UUID_AV_REMOTE_TARGET, "AVRemTarget" }, /* AVRCP */ { SDP_UUID_ADVANCED_AUDIO, "AdvAudio" }, /* A2DP */ { SDP_UUID_AV_REMOTE, "AVRemote" }, /* AVRCP */ { SDP_UUID_VIDEO_CONFERENCING, "VideoConf" }, /* VCP */ { SDP_UUID_INTERCOM, "Intercom" }, { SDP_UUID_FAX, "Fax" }, { SDP_UUID_HEADSET_AUDIO_GATEWAY, "Headset AG" }, { SDP_UUID_WAP, "WAP" }, { SDP_UUID_WAP_CLIENT, "WAP Client" }, { SDP_UUID_PANU, "PANU" }, /* PAN */ { SDP_UUID_NAP, "NAP" }, /* PAN */ { SDP_UUID_GN, "GN" }, /* PAN */ { SDP_UUID_DIRECT_PRINTING, "DirectPrint" }, /* BPP */ { SDP_UUID_REFERENCE_PRINTING, "RefPrint" }, /* BPP */ { SDP_UUID_IMAGING, "Imaging" }, /* BIP */ { SDP_UUID_IMAGING_RESPONDER, "ImagingResp" }, /* BIP */ { SDP_UUID_HANDSFREE, "Handsfree" }, { SDP_UUID_HANDSFREE_AUDIO_GATEWAY, "Handsfree AG" }, { SDP_UUID_DIRECT_PRINTING_REF_OBJS, "RefObjsPrint" }, /* BPP */ { SDP_UUID_REFLECTED_UI, "ReflectedUI" }, /* BPP */ { SDP_UUID_BASIC_PRINTING, "BasicPrint" }, /* BPP */ { SDP_UUID_PRINTING_STATUS, "PrintStatus" }, /* BPP */ { SDP_UUID_HUMAN_INTERFACE_DEVICE, "HID" }, /* HID */ { SDP_UUID_HARDCOPY_CABLE_REPLACE, "HCRP" }, /* HCRP */ { SDP_UUID_HCR_PRINT, "HCRPrint" }, /* HCRP */ { SDP_UUID_HCR_SCAN, "HCRScan" }, /* HCRP */ { SDP_UUID_COMMON_ISDN_ACCESS, "CIP" }, /* CIP */ { SDP_UUID_VIDEO_CONFERENCING_GW, "VideoConf GW" }, /* VCP */ { SDP_UUID_UDI_MT, "UDI MT" }, /* UDI */ { SDP_UUID_UDI_TA, "UDI TA" }, /* UDI */ { SDP_UUID_AUDIO_VIDEO, "AudioVideo" }, /* VCP */ { SDP_UUID_SIM_ACCESS, "SAP" }, /* SAP */ { SDP_UUID_PHONEBOOK_ACCESS_PCE, "PBAP PCE" }, /* PBAP */ { SDP_UUID_PHONEBOOK_ACCESS_PSE, "PBAP PSE" }, /* PBAP */ { SDP_UUID_PHONEBOOK_ACCESS, "PBAP" }, /* PBAP */ { SDP_UUID_PNP_INFORMATION, "PNPInfo" }, { SDP_UUID_GENERIC_NETWORKING, "Networking" }, { SDP_UUID_GENERIC_FILE_TRANSFER, "FileTrnsf" }, { SDP_UUID_GENERIC_AUDIO, "Audio" }, { SDP_UUID_GENERIC_TELEPHONY, "Telephony" }, { SDP_UUID_UPNP_SERVICE, "UPNP" }, /* ESDP */ { SDP_UUID_UPNP_IP_SERVICE, "UPNP IP" }, /* ESDP */ { SDP_UUID_ESDP_UPNP_IP_PAN, "UPNP PAN" }, /* ESDP */ { SDP_UUID_ESDP_UPNP_IP_LAP, "UPNP LAP" }, /* ESDP */ { SDP_UUID_ESDP_UPNP_L2CAP, "UPNP L2CAP" }, /* ESDP */ { SDP_UUID_VIDEO_SOURCE, "VideoSource" }, /* VDP */ { SDP_UUID_VIDEO_SINK, "VideoSink" }, /* VDP */ { SDP_UUID_VIDEO_DISTRIBUTION, "VideoDist" }, /* VDP */ { SDP_UUID_APPLE_AGENT, "AppleAgent" }, }; #define SDP_UUID_NAM_LOOKUP_TABLE_SIZE \ (sizeof(sdp_uuid_nam_lookup_table)/sizeof(sdp_uuid_nam_lookup_table_t)) /* AttrID name lookup table */ typedef struct { int attr_id; char* name; } sdp_attr_id_nam_lookup_table_t; static sdp_attr_id_nam_lookup_table_t sdp_attr_id_nam_lookup_table[] = { { SDP_ATTR_ID_SERVICE_RECORD_HANDLE, "SrvRecHndl" }, { SDP_ATTR_ID_SERVICE_CLASS_ID_LIST, "SrvClassIDList" }, { SDP_ATTR_ID_SERVICE_RECORD_STATE, "SrvRecState" }, { SDP_ATTR_ID_SERVICE_SERVICE_ID, "SrvID" }, { SDP_ATTR_ID_PROTOCOL_DESCRIPTOR_LIST, "ProtocolDescList" }, { SDP_ATTR_ID_BROWSE_GROUP_LIST, "BrwGrpList" }, { SDP_ATTR_ID_LANGUAGE_BASE_ATTRIBUTE_ID_LIST, "LangBaseAttrIDList" }, { SDP_ATTR_ID_SERVICE_INFO_TIME_TO_LIVE, "SrvInfoTimeToLive" }, { SDP_ATTR_ID_SERVICE_AVAILABILITY, "SrvAvail" }, { SDP_ATTR_ID_BLUETOOTH_PROFILE_DESCRIPTOR_LIST, "BTProfileDescList" }, { SDP_ATTR_ID_DOCUMENTATION_URL, "DocURL" }, { SDP_ATTR_ID_CLIENT_EXECUTABLE_URL, "ClientExeURL" }, { SDP_ATTR_ID_ICON_10, "Icon10" }, { SDP_ATTR_ID_ICON_URL, "IconURL" }, { SDP_ATTR_ID_SERVICE_NAME, "SrvName" }, { SDP_ATTR_ID_SERVICE_DESCRIPTION, "SrvDesc" }, { SDP_ATTR_ID_PROVIDER_NAME, "ProviderName" }, { SDP_ATTR_ID_VERSION_NUMBER_LIST, "VersionNumList" }, { SDP_ATTR_ID_GROUP_ID, "GrpID" }, { SDP_ATTR_ID_SERVICE_DATABASE_STATE, "SrvDBState" }, { SDP_ATTR_ID_SERVICE_VERSION, "SrvVersion" }, { SDP_ATTR_ID_SECURITY_DESCRIPTION, "SecurityDescription"}, /* PAN */ { SDP_ATTR_ID_SUPPORTED_DATA_STORES_LIST, "SuppDataStoresList" }, /* Synchronization */ { SDP_ATTR_ID_SUPPORTED_FORMATS_LIST, "SuppFormatsList" }, /* OBEX Object Push */ { SDP_ATTR_ID_NET_ACCESS_TYPE, "NetAccessType" }, /* PAN */ { SDP_ATTR_ID_MAX_NET_ACCESS_RATE, "MaxNetAccessRate" }, /* PAN */ { SDP_ATTR_ID_IPV4_SUBNET, "IPv4Subnet" }, /* PAN */ { SDP_ATTR_ID_IPV6_SUBNET, "IPv6Subnet" }, /* PAN */ { SDP_ATTR_ID_SUPPORTED_CAPABILITIES, "SuppCapabilities" }, /* Imaging */ { SDP_ATTR_ID_SUPPORTED_FEATURES, "SuppFeatures" }, /* Imaging and Hansfree */ { SDP_ATTR_ID_SUPPORTED_FUNCTIONS, "SuppFunctions" }, /* Imaging */ { SDP_ATTR_ID_TOTAL_IMAGING_DATA_CAPACITY, "SuppTotalCapacity" }, /* Imaging */ { SDP_ATTR_ID_SUPPORTED_REPOSITORIES, "SuppRepositories" }, /* PBAP */ }; #define SDP_ATTR_ID_NAM_LOOKUP_TABLE_SIZE \ (sizeof(sdp_attr_id_nam_lookup_table)/sizeof(sdp_attr_id_nam_lookup_table_t)) const char* sdp_get_uuid_name(int uuid) { for (int i = 0; i < SDP_UUID_NAM_LOOKUP_TABLE_SIZE; i++) { if (sdp_uuid_nam_lookup_table[i].uuid == uuid) return sdp_uuid_nam_lookup_table[i].name; } return NULL; } const char* sdp_get_attr_id_name(int attr_id) { for (int i = 0; i < SDP_ATTR_ID_NAM_LOOKUP_TABLE_SIZE; i++) if (sdp_attr_id_nam_lookup_table[i].attr_id == attr_id) return sdp_attr_id_nam_lookup_table[i].name; return NULL; } bluez-tools-0.1.38+git662e/src/lib/dbus-common.h0000644000175000017500000000311711430123043021434 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __DBUS_COMMON_H #define __DBUS_COMMON_H #include #include #define DBUS_TYPE_G_STRING_VARIANT_HASHTABLE (dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) #define DBUS_TYPE_G_UINT_STRING_HASHTABLE (dbus_g_type_get_map("GHashTable", G_TYPE_UINT, G_TYPE_STRING)) #define DBUS_TYPE_G_HASH_TABLE_ARRAY (dbus_g_type_get_collection("GPtrArray", DBUS_TYPE_G_STRING_VARIANT_HASHTABLE)) extern DBusGConnection *session_conn; extern DBusGConnection *system_conn; void dbus_init(); gboolean dbus_session_connect(GError **error); void dbus_session_disconnect(); gboolean dbus_system_connect(GError **error); void dbus_system_disconnect(); void dbus_disconnect(); #endif /* __DBUS_COMMON_H */ bluez-tools-0.1.38+git662e/src/lib/sdp.h0000644000175000017500000002316211430123543020006 0ustar iwamatsuiwamatsu/* * * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2001-2002 Ricky Yuen * Copyright (C) 2003-2007 Marcel Holtmann * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __SDP_H #define __SDP_H /* Bluetooth assigned UUIDs for protocols */ #define SDP_UUID_SDP 0x0001 #define SDP_UUID_UDP 0x0002 #define SDP_UUID_RFCOMM 0x0003 #define SDP_UUID_TCP 0x0004 #define SDP_UUID_TCS_BIN 0x0005 #define SDP_UUID_TCS_AT 0x0006 #define SDP_UUID_OBEX 0x0008 #define SDP_UUID_IP 0x0009 #define SDP_UUID_FTP 0x000A #define SDP_UUID_HTTP 0x000C #define SDP_UUID_WSP 0x000E #define SDP_UUID_BNEP 0x000F /* PAN */ #define SDP_UUID_HIDP 0x0011 /* HID */ #define SDP_UUID_HARDCOPY_CONTROL_CHANNEL 0x0012 /* HCRP */ #define SDP_UUID_HARDCOPY_DATA_CHANNEL 0x0014 /* HCRP */ #define SDP_UUID_HARDCOPY_NOTIFICATION 0x0016 /* HCRP */ #define SDP_UUID_AVCTP 0x0017 /* AVCTP */ #define SDP_UUID_AVDTP 0x0019 /* AVDTP */ #define SDP_UUID_CMTP 0x001B /* CIP */ #define SDP_UUID_UDI_C_PLANE 0x001D /* UDI */ #define SDP_UUID_L2CAP 0x0100 /* Bluetooth assigned UUIDs for Service Classes */ #define SDP_UUID_SERVICE_DISCOVERY_SERVER 0x1000 #define SDP_UUID_BROWSE_GROUP_DESCRIPTOR 0x1001 #define SDP_UUID_PUBLIC_BROWSE_GROUP 0x1002 #define SDP_UUID_SERIAL_PORT 0x1101 #define SDP_UUID_LAN_ACCESS_PPP 0x1102 #define SDP_UUID_DIALUP_NETWORKING 0x1103 #define SDP_UUID_IR_MC_SYNC 0x1104 #define SDP_UUID_OBEX_OBJECT_PUSH 0x1105 #define SDP_UUID_OBEX_FILE_TRANSFER 0x1106 #define SDP_UUID_IR_MC_SYNC_COMMAND 0x1107 #define SDP_UUID_HEADSET 0x1108 #define SDP_UUID_CORDLESS_TELEPHONY 0x1109 #define SDP_UUID_AUDIO_SOURCE 0x110a /* A2DP */ #define SDP_UUID_AUDIO_SINK 0x110b /* A2DP */ #define SDP_UUID_AV_REMOTE_TARGET 0x110c /* AVRCP */ #define SDP_UUID_ADVANCED_AUDIO 0x110d /* A2DP */ #define SDP_UUID_AV_REMOTE 0x110e /* AVRCP */ #define SDP_UUID_VIDEO_CONFERENCING 0x110f /* VCP */ #define SDP_UUID_INTERCOM 0x1110 #define SDP_UUID_FAX 0x1111 #define SDP_UUID_HEADSET_AUDIO_GATEWAY 0x1112 #define SDP_UUID_WAP 0x1113 #define SDP_UUID_WAP_CLIENT 0x1114 #define SDP_UUID_PANU 0x1115 /* PAN */ #define SDP_UUID_NAP 0x1116 /* PAN */ #define SDP_UUID_GN 0x1117 /* PAN */ #define SDP_UUID_DIRECT_PRINTING 0x1118 /* BPP */ #define SDP_UUID_REFERENCE_PRINTING 0x1119 /* BPP */ #define SDP_UUID_IMAGING 0x111a /* BIP */ #define SDP_UUID_IMAGING_RESPONDER 0x111b /* BIP */ #define SDP_UUID_IMAGING_AUTOMATIC_ARCHIVE 0x111c /* BIP */ #define SDP_UUID_IMAGING_REFERENCED_OBJECTS 0x111d /* BIP */ #define SDP_UUID_HANDSFREE 0x111e #define SDP_UUID_HANDSFREE_AUDIO_GATEWAY 0x111f #define SDP_UUID_DIRECT_PRINTING_REF_OBJS 0x1120 /* BPP */ #define SDP_UUID_DIRECT_PRINTING_REFERENCE_OBJECTS 0x1120 /* BPP */ #define SDP_UUID_REFLECTED_UI 0x1121 /* BPP */ #define SDP_UUID_BASIC_PRINTING 0x1122 /* BPP */ #define SDP_UUID_PRINTING_STATUS 0x1123 /* BPP */ #define SDP_UUID_HUMAN_INTERFACE_DEVICE 0x1124 /* HID */ #define SDP_UUID_HARDCOPY_CABLE_REPLACE 0x1125 /* HCRP */ #define SDP_UUID_HCR_PRINT 0x1126 /* HCRP */ #define SDP_UUID_HCR_SCAN 0x1127 /* HCRP */ #define SDP_UUID_COMMON_ISDN_ACCESS 0x1128 /* CIP */ #define SDP_UUID_VIDEO_CONFERENCING_GW 0x1129 /* VCP */ #define SDP_UUID_UDI_MT 0x112a /* UDI */ #define SDP_UUID_UDI_TA 0x112b /* UDI */ #define SDP_UUID_AUDIO_VIDEO 0x112c /* VCP */ #define SDP_UUID_SIM_ACCESS 0x112d /* SAP */ #define SDP_UUID_PHONEBOOK_ACCESS_PCE 0x112e /* PBAP */ #define SDP_UUID_PHONEBOOK_ACCESS_PSE 0x112f /* PBAP */ #define SDP_UUID_PHONEBOOK_ACCESS 0x1130 /* PBAP */ #define SDP_UUID_PNP_INFORMATION 0x1200 #define SDP_UUID_GENERIC_NETWORKING 0x1201 #define SDP_UUID_GENERIC_FILE_TRANSFER 0x1202 #define SDP_UUID_GENERIC_AUDIO 0x1203 #define SDP_UUID_GENERIC_TELEPHONY 0x1204 #define SDP_UUID_UPNP_SERVICE 0x1205 /* ESDP */ #define SDP_UUID_UPNP_IP_SERVICE 0x1206 /* ESDP */ #define SDP_UUID_ESDP_UPNP_IP_PAN 0x1300 /* ESDP */ #define SDP_UUID_ESDP_UPNP_IP_LAP 0x1301 /* ESDP */ #define SDP_UUID_ESDP_UPNP_L2CAP 0x1302 /* ESDP */ #define SDP_UUID_VIDEO_SOURCE 0x1303 /* VDP */ #define SDP_UUID_VIDEO_SINK 0x1304 /* VDP */ #define SDP_UUID_VIDEO_DISTRIBUTION 0x1305 /* VDP */ #define SDP_UUID_APPLE_AGENT 0x2112 /* Bluetooth assigned numbers for Attribute IDs */ #define SDP_ATTR_ID_SERVICE_RECORD_HANDLE 0x0000 #define SDP_ATTR_ID_SERVICE_CLASS_ID_LIST 0x0001 #define SDP_ATTR_ID_SERVICE_RECORD_STATE 0x0002 #define SDP_ATTR_ID_SERVICE_SERVICE_ID 0x0003 #define SDP_ATTR_ID_PROTOCOL_DESCRIPTOR_LIST 0x0004 #define SDP_ATTR_ID_BROWSE_GROUP_LIST 0x0005 #define SDP_ATTR_ID_LANGUAGE_BASE_ATTRIBUTE_ID_LIST 0x0006 #define SDP_ATTR_ID_SERVICE_INFO_TIME_TO_LIVE 0x0007 #define SDP_ATTR_ID_SERVICE_AVAILABILITY 0x0008 #define SDP_ATTR_ID_BLUETOOTH_PROFILE_DESCRIPTOR_LIST 0x0009 #define SDP_ATTR_ID_DOCUMENTATION_URL 0x000A #define SDP_ATTR_ID_CLIENT_EXECUTABLE_URL 0x000B #define SDP_ATTR_ID_ICON_10 0x000C #define SDP_ATTR_ID_ICON_URL 0x000D #define SDP_ATTR_ID_SERVICE_NAME 0x0100 #define SDP_ATTR_ID_SERVICE_DESCRIPTION 0x0101 #define SDP_ATTR_ID_PROVIDER_NAME 0x0102 #define SDP_ATTR_ID_VERSION_NUMBER_LIST 0x0200 #define SDP_ATTR_ID_GROUP_ID 0x0200 #define SDP_ATTR_ID_SERVICE_DATABASE_STATE 0x0201 #define SDP_ATTR_ID_SERVICE_VERSION 0x0300 #define SDP_ATTR_ID_EXTERNAL_NETWORK 0x0301 /* Cordless Telephony */ #define SDP_ATTR_ID_SUPPORTED_DATA_STORES_LIST 0x0301 /* Synchronization */ #define SDP_ATTR_ID_REMOTE_AUDIO_VOLUME_CONTROL 0x0302 /* GAP */ #define SDP_ATTR_ID_SUPPORTED_FORMATS_LIST 0x0303 /* OBEX Object Push */ #define SDP_ATTR_ID_FAX_CLASS_1_SUPPORT 0x0302 /* Fax */ #define SDP_ATTR_ID_FAX_CLASS_2_0_SUPPORT 0x0303 #define SDP_ATTR_ID_FAX_CLASS_2_SUPPORT 0x0304 #define SDP_ATTR_ID_AUDIO_FEEDBACK_SUPPORT 0x0305 #define SDP_ATTR_ID_SECURITY_DESCRIPTION 0x030a /* PAN */ #define SDP_ATTR_ID_NET_ACCESS_TYPE 0x030b /* PAN */ #define SDP_ATTR_ID_MAX_NET_ACCESS_RATE 0x030c /* PAN */ #define SDP_ATTR_ID_IPV4_SUBNET 0x030d /* PAN */ #define SDP_ATTR_ID_IPV6_SUBNET 0x030e /* PAN */ #define SDP_ATTR_ID_SUPPORTED_CAPABILITIES 0x0310 /* Imaging */ #define SDP_ATTR_ID_SUPPORTED_FEATURES 0x0311 /* Imaging and Hansfree */ #define SDP_ATTR_ID_SUPPORTED_FUNCTIONS 0x0312 /* Imaging */ #define SDP_ATTR_ID_TOTAL_IMAGING_DATA_CAPACITY 0x0313 /* Imaging */ #define SDP_ATTR_ID_SUPPORTED_REPOSITORIES 0x0314 /* PBAP */ const char* sdp_get_uuid_name(int uuid); const char* sdp_get_attr_id_name(int attr_id); #endif /* __SDP_H */ bluez-tools-0.1.38+git662e/src/lib/obexd/0000755000175000017500000000000011472245124020152 5ustar iwamatsuiwamatsubluez-tools-0.1.38+git662e/src/lib/obexd/obexclient_session.c0000644000175000017500000002133111430124373024211 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "obexclient_session.h" #define OBEXCLIENT_SESSION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), OBEXCLIENT_SESSION_TYPE, OBEXClientSessionPrivate)) struct _OBEXClientSessionPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; /* Properties */ guchar channel; gchar *destination; gchar *source; }; G_DEFINE_TYPE(OBEXClientSession, obexclient_session, G_TYPE_OBJECT); enum { PROP_0, PROP_DBUS_OBJECT_PATH, /* readwrite, construct only */ PROP_CHANNEL, /* readonly */ PROP_DESTINATION, /* readonly */ PROP_SOURCE /* readonly */ }; static void _obexclient_session_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _obexclient_session_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); static void obexclient_session_dispose(GObject *gobject) { OBEXClientSession *self = OBEXCLIENT_SESSION(gobject); /* Properties free */ g_free(self->priv->destination); g_free(self->priv->source); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(obexclient_session_parent_class)->dispose(gobject); } static void obexclient_session_class_init(OBEXClientSessionClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = obexclient_session_dispose; g_type_class_add_private(klass, sizeof(OBEXClientSessionPrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _obexclient_session_get_property; gobject_class->set_property = _obexclient_session_set_property; /* object DBusObjectPath [readwrite, construct only] */ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "Adapter D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec); /* byte Channel [readonly] */ pspec = g_param_spec_uchar("Channel", NULL, NULL, 0, 0xFF, 0, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_CHANNEL, pspec); /* string Destination [readonly] */ pspec = g_param_spec_string("Destination", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_DESTINATION, pspec); /* string Source [readonly] */ pspec = g_param_spec_string("Source", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_SOURCE, pspec); } static void obexclient_session_init(OBEXClientSession *self) { self->priv = OBEXCLIENT_SESSION_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(session_conn != NULL); } static void obexclient_session_post_init(OBEXClientSession *self, const gchar *dbus_object_path) { g_assert(dbus_object_path != NULL); g_assert(strlen(dbus_object_path) > 0); g_assert(self->priv->dbus_g_proxy == NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", OBEXCLIENT_SESSION_DBUS_INTERFACE, dbus_object_path); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, OBEXCLIENT_SESSION_DBUS_INTERFACE); /* Properties init */ GHashTable *properties = obexclient_session_get_properties(self, &error); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); g_assert(properties != NULL); /* byte Channel [readonly] */ if (g_hash_table_lookup(properties, "Channel")) { self->priv->channel = g_value_get_uchar(g_hash_table_lookup(properties, "Channel")); } else { self->priv->channel = 0; } /* string Destination [readonly] */ if (g_hash_table_lookup(properties, "Destination")) { self->priv->destination = g_value_dup_string(g_hash_table_lookup(properties, "Destination")); } else { self->priv->destination = g_strdup("undefined"); } /* string Source [readonly] */ if (g_hash_table_lookup(properties, "Source")) { self->priv->source = g_value_dup_string(g_hash_table_lookup(properties, "Source")); } else { self->priv->source = g_strdup("undefined"); } g_hash_table_unref(properties); } static void _obexclient_session_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { OBEXClientSession *self = OBEXCLIENT_SESSION(object); switch (property_id) { case PROP_DBUS_OBJECT_PATH: g_value_set_string(value, obexclient_session_get_dbus_object_path(self)); break; case PROP_CHANNEL: g_value_set_uchar(value, obexclient_session_get_channel(self)); break; case PROP_DESTINATION: g_value_set_string(value, obexclient_session_get_destination(self)); break; case PROP_SOURCE: g_value_set_string(value, obexclient_session_get_source(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _obexclient_session_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { OBEXClientSession *self = OBEXCLIENT_SESSION(object); GError *error = NULL; switch (property_id) { case PROP_DBUS_OBJECT_PATH: obexclient_session_post_init(self, g_value_get_string(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } /* Methods */ /* void AssignAgent(object agent) */ void obexclient_session_assign_agent(OBEXClientSession *self, const gchar *agent, GError **error) { g_assert(OBEXCLIENT_SESSION_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "AssignAgent", error, DBUS_TYPE_G_OBJECT_PATH, agent, G_TYPE_INVALID, G_TYPE_INVALID); } /* dict GetProperties() */ GHashTable *obexclient_session_get_properties(OBEXClientSession *self, GError **error) { g_assert(OBEXCLIENT_SESSION_IS(self)); GHashTable *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "GetProperties", error, G_TYPE_INVALID, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, &ret, G_TYPE_INVALID); return ret; } /* void ReleaseAgent(object agent) */ void obexclient_session_release_agent(OBEXClientSession *self, const gchar *agent, GError **error) { g_assert(OBEXCLIENT_SESSION_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "ReleaseAgent", error, DBUS_TYPE_G_OBJECT_PATH, agent, G_TYPE_INVALID, G_TYPE_INVALID); } /* Properties access methods */ const gchar *obexclient_session_get_dbus_object_path(OBEXClientSession *self) { g_assert(OBEXCLIENT_SESSION_IS(self)); return dbus_g_proxy_get_path(self->priv->dbus_g_proxy); } const guchar obexclient_session_get_channel(OBEXClientSession *self) { g_assert(OBEXCLIENT_SESSION_IS(self)); return self->priv->channel; } const gchar *obexclient_session_get_destination(OBEXClientSession *self) { g_assert(OBEXCLIENT_SESSION_IS(self)); return self->priv->destination; } const gchar *obexclient_session_get_source(OBEXClientSession *self) { g_assert(OBEXCLIENT_SESSION_IS(self)); return self->priv->source; } bluez-tools-0.1.38+git662e/src/lib/obexd/obexclient_transfer.c0000644000175000017500000002045011430124373024353 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "obexclient_transfer.h" #define OBEXCLIENT_TRANSFER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), OBEXCLIENT_TRANSFER_TYPE, OBEXClientTransferPrivate)) struct _OBEXClientTransferPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; /* Properties */ gchar *filename; gchar *name; guint64 size; }; G_DEFINE_TYPE(OBEXClientTransfer, obexclient_transfer, G_TYPE_OBJECT); enum { PROP_0, PROP_DBUS_OBJECT_PATH, /* readwrite, construct only */ PROP_FILENAME, /* readonly */ PROP_NAME, /* readonly */ PROP_SIZE /* readonly */ }; static void _obexclient_transfer_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _obexclient_transfer_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); static void obexclient_transfer_dispose(GObject *gobject) { OBEXClientTransfer *self = OBEXCLIENT_TRANSFER(gobject); /* Properties free */ g_free(self->priv->filename); g_free(self->priv->name); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(obexclient_transfer_parent_class)->dispose(gobject); } static void obexclient_transfer_class_init(OBEXClientTransferClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = obexclient_transfer_dispose; g_type_class_add_private(klass, sizeof(OBEXClientTransferPrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _obexclient_transfer_get_property; gobject_class->set_property = _obexclient_transfer_set_property; /* object DBusObjectPath [readwrite, construct only] */ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "Adapter D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec); /* string Filename [readonly] */ pspec = g_param_spec_string("Filename", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_FILENAME, pspec); /* string Name [readonly] */ pspec = g_param_spec_string("Name", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_NAME, pspec); /* uint64 Size [readonly] */ pspec = g_param_spec_uint64("Size", NULL, NULL, 0, 0xFFFFFFFFFFFFFFFF, 0, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_SIZE, pspec); } static void obexclient_transfer_init(OBEXClientTransfer *self) { self->priv = OBEXCLIENT_TRANSFER_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(session_conn != NULL); } static void obexclient_transfer_post_init(OBEXClientTransfer *self, const gchar *dbus_object_path) { g_assert(dbus_object_path != NULL); g_assert(strlen(dbus_object_path) > 0); g_assert(self->priv->dbus_g_proxy == NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", OBEXCLIENT_TRANSFER_DBUS_INTERFACE, dbus_object_path); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, OBEXCLIENT_TRANSFER_DBUS_INTERFACE); /* Properties init */ GHashTable *properties = obexclient_transfer_get_properties(self, &error); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); g_assert(properties != NULL); /* string Filename [readonly] */ if (g_hash_table_lookup(properties, "Filename")) { self->priv->filename = g_value_dup_string(g_hash_table_lookup(properties, "Filename")); } else { self->priv->filename = g_strdup("undefined"); } /* string Name [readonly] */ if (g_hash_table_lookup(properties, "Name")) { self->priv->name = g_value_dup_string(g_hash_table_lookup(properties, "Name")); } else { self->priv->name = g_strdup("undefined"); } /* uint64 Size [readonly] */ if (g_hash_table_lookup(properties, "Size")) { self->priv->size = g_value_get_uint64(g_hash_table_lookup(properties, "Size")); } else { self->priv->size = 0; } g_hash_table_unref(properties); } static void _obexclient_transfer_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { OBEXClientTransfer *self = OBEXCLIENT_TRANSFER(object); switch (property_id) { case PROP_DBUS_OBJECT_PATH: g_value_set_string(value, obexclient_transfer_get_dbus_object_path(self)); break; case PROP_FILENAME: g_value_set_string(value, obexclient_transfer_get_filename(self)); break; case PROP_NAME: g_value_set_string(value, obexclient_transfer_get_name(self)); break; case PROP_SIZE: g_value_set_uint64(value, obexclient_transfer_get_size(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _obexclient_transfer_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { OBEXClientTransfer *self = OBEXCLIENT_TRANSFER(object); GError *error = NULL; switch (property_id) { case PROP_DBUS_OBJECT_PATH: obexclient_transfer_post_init(self, g_value_get_string(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } /* Methods */ /* void Cancel() */ void obexclient_transfer_cancel(OBEXClientTransfer *self, GError **error) { g_assert(OBEXCLIENT_TRANSFER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "Cancel", error, G_TYPE_INVALID, G_TYPE_INVALID); } /* dict GetProperties() */ GHashTable *obexclient_transfer_get_properties(OBEXClientTransfer *self, GError **error) { g_assert(OBEXCLIENT_TRANSFER_IS(self)); GHashTable *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "GetProperties", error, G_TYPE_INVALID, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, &ret, G_TYPE_INVALID); return ret; } /* Properties access methods */ const gchar *obexclient_transfer_get_dbus_object_path(OBEXClientTransfer *self) { g_assert(OBEXCLIENT_TRANSFER_IS(self)); return dbus_g_proxy_get_path(self->priv->dbus_g_proxy); } const gchar *obexclient_transfer_get_filename(OBEXClientTransfer *self) { g_assert(OBEXCLIENT_TRANSFER_IS(self)); return self->priv->filename; } const gchar *obexclient_transfer_get_name(OBEXClientTransfer *self) { g_assert(OBEXCLIENT_TRANSFER_IS(self)); return self->priv->name; } const guint64 obexclient_transfer_get_size(OBEXClientTransfer *self) { g_assert(OBEXCLIENT_TRANSFER_IS(self)); return self->priv->size; } bluez-tools-0.1.38+git662e/src/lib/obexd/obexclient.h0000644000175000017500000000517411430124373022462 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __OBEXCLIENT_H #define __OBEXCLIENT_H #include #define OBEXCLIENT_DBUS_PATH "/" #define OBEXCLIENT_DBUS_INTERFACE "org.openobex.Client" /* * Type macros */ #define OBEXCLIENT_TYPE (obexclient_get_type()) #define OBEXCLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OBEXCLIENT_TYPE, OBEXClient)) #define OBEXCLIENT_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), OBEXCLIENT_TYPE)) #define OBEXCLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), OBEXCLIENT_TYPE, OBEXClientClass)) #define OBEXCLIENT_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), OBEXCLIENT_TYPE)) #define OBEXCLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), OBEXCLIENT_TYPE, OBEXClientClass)) typedef struct _OBEXClient OBEXClient; typedef struct _OBEXClientClass OBEXClientClass; typedef struct _OBEXClientPrivate OBEXClientPrivate; struct _OBEXClient { GObject parent_instance; /*< private >*/ OBEXClientPrivate *priv; }; struct _OBEXClientClass { GObjectClass parent_class; }; /* used by OBEXCLIENT_TYPE */ GType obexclient_get_type(void) G_GNUC_CONST; /* * Method definitions */ gchar *obexclient_create_session(OBEXClient *self, const GHashTable *device, GError **error); void obexclient_exchange_business_cards(OBEXClient *self, const GHashTable *device, const gchar *clientfile, const gchar *file, GError **error); gchar *obexclient_get_capabilities(OBEXClient *self, const GHashTable *device, GError **error); void obexclient_pull_business_card(OBEXClient *self, const GHashTable *device, const gchar *file, GError **error); void obexclient_remove_session(OBEXClient *self, const gchar *session, GError **error); void obexclient_send_files(OBEXClient *self, const GHashTable *device, const gchar **files, const gchar *agent, GError **error); #endif /* __OBEXCLIENT_H */ bluez-tools-0.1.38+git662e/src/lib/obexd/obextransfer.h0000644000175000017500000000420111430124373023016 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __OBEXTRANSFER_H #define __OBEXTRANSFER_H #include #define OBEXTRANSFER_DBUS_INTERFACE "org.openobex.Transfer" /* * Type macros */ #define OBEXTRANSFER_TYPE (obextransfer_get_type()) #define OBEXTRANSFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OBEXTRANSFER_TYPE, OBEXTransfer)) #define OBEXTRANSFER_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), OBEXTRANSFER_TYPE)) #define OBEXTRANSFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), OBEXTRANSFER_TYPE, OBEXTransferClass)) #define OBEXTRANSFER_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), OBEXTRANSFER_TYPE)) #define OBEXTRANSFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), OBEXTRANSFER_TYPE, OBEXTransferClass)) typedef struct _OBEXTransfer OBEXTransfer; typedef struct _OBEXTransferClass OBEXTransferClass; typedef struct _OBEXTransferPrivate OBEXTransferPrivate; struct _OBEXTransfer { GObject parent_instance; /*< private >*/ OBEXTransferPrivate *priv; }; struct _OBEXTransferClass { GObjectClass parent_class; }; /* used by OBEXTRANSFER_TYPE */ GType obextransfer_get_type(void) G_GNUC_CONST; /* * Method definitions */ void obextransfer_cancel(OBEXTransfer *self, GError **error); const gchar *obextransfer_get_dbus_object_path(OBEXTransfer *self); #endif /* __OBEXTRANSFER_H */ bluez-tools-0.1.38+git662e/src/lib/obexd/obexclient.c0000644000175000017500000001262411430124373022453 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "obexclient.h" #define OBEXCLIENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), OBEXCLIENT_TYPE, OBEXClientPrivate)) struct _OBEXClientPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; }; G_DEFINE_TYPE(OBEXClient, obexclient, G_TYPE_OBJECT); static void obexclient_dispose(GObject *gobject) { OBEXClient *self = OBEXCLIENT(gobject); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(obexclient_parent_class)->dispose(gobject); } static void obexclient_class_init(OBEXClientClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = obexclient_dispose; g_type_class_add_private(klass, sizeof(OBEXClientPrivate)); } static void obexclient_init(OBEXClient *self) { self->priv = OBEXCLIENT_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(session_conn != NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", OBEXCLIENT_DBUS_PATH, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", OBEXCLIENT_DBUS_INTERFACE, OBEXCLIENT_DBUS_PATH); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", OBEXCLIENT_DBUS_PATH, OBEXCLIENT_DBUS_INTERFACE); } /* Methods */ /* object CreateSession(dict device) */ gchar *obexclient_create_session(OBEXClient *self, const GHashTable *device, GError **error) { g_assert(OBEXCLIENT_IS(self)); gchar *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "CreateSession", error, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, device, G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, &ret, G_TYPE_INVALID); return ret; } /* void ExchangeBusinessCards(dict device, string clientfile, string file) */ void obexclient_exchange_business_cards(OBEXClient *self, const GHashTable *device, const gchar *clientfile, const gchar *file, GError **error) { g_assert(OBEXCLIENT_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "ExchangeBusinessCards", error, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, device, G_TYPE_STRING, clientfile, G_TYPE_STRING, file, G_TYPE_INVALID, G_TYPE_INVALID); } /* string GetCapabilities(dict device) */ gchar *obexclient_get_capabilities(OBEXClient *self, const GHashTable *device, GError **error) { g_assert(OBEXCLIENT_IS(self)); gchar *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "GetCapabilities", error, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, device, G_TYPE_INVALID, G_TYPE_STRING, &ret, G_TYPE_INVALID); return ret; } /* void PullBusinessCard(dict device, string file) */ void obexclient_pull_business_card(OBEXClient *self, const GHashTable *device, const gchar *file, GError **error) { g_assert(OBEXCLIENT_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "PullBusinessCard", error, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, device, G_TYPE_STRING, file, G_TYPE_INVALID, G_TYPE_INVALID); } /* void RemoveSession(object session) */ void obexclient_remove_session(OBEXClient *self, const gchar *session, GError **error) { g_assert(OBEXCLIENT_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "RemoveSession", error, DBUS_TYPE_G_OBJECT_PATH, session, G_TYPE_INVALID, G_TYPE_INVALID); } /* void SendFiles(dict device, array{string} files, object agent) */ void obexclient_send_files(OBEXClient *self, const GHashTable *device, const gchar **files, const gchar *agent, GError **error) { g_assert(OBEXCLIENT_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "SendFiles", error, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, device, G_TYPE_STRV, files, DBUS_TYPE_G_OBJECT_PATH, agent, G_TYPE_INVALID, G_TYPE_INVALID); } bluez-tools-0.1.38+git662e/src/lib/obexd/obexsession.c0000644000175000017500000001455711430124373022667 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "obexsession.h" #define OBEXSESSION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), OBEXSESSION_TYPE, OBEXSessionPrivate)) struct _OBEXSessionPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; /* Properties */ gchar *address; }; G_DEFINE_TYPE(OBEXSession, obexsession, G_TYPE_OBJECT); enum { PROP_0, PROP_DBUS_OBJECT_PATH, /* readwrite, construct only */ PROP_ADDRESS /* readonly */ }; static void _obexsession_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _obexsession_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); static void obexsession_dispose(GObject *gobject) { OBEXSession *self = OBEXSESSION(gobject); /* Properties free */ g_free(self->priv->address); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(obexsession_parent_class)->dispose(gobject); } static void obexsession_class_init(OBEXSessionClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = obexsession_dispose; g_type_class_add_private(klass, sizeof(OBEXSessionPrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _obexsession_get_property; gobject_class->set_property = _obexsession_set_property; /* object DBusObjectPath [readwrite, construct only] */ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "Adapter D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec); /* string Address [readonly] */ pspec = g_param_spec_string("Address", NULL, NULL, NULL, G_PARAM_READABLE); g_object_class_install_property(gobject_class, PROP_ADDRESS, pspec); } static void obexsession_init(OBEXSession *self) { self->priv = OBEXSESSION_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(session_conn != NULL); } static void obexsession_post_init(OBEXSession *self, const gchar *dbus_object_path) { g_assert(dbus_object_path != NULL); g_assert(strlen(dbus_object_path) > 0); g_assert(self->priv->dbus_g_proxy == NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", dbus_object_path, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", OBEXSESSION_DBUS_INTERFACE, dbus_object_path); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", dbus_object_path, OBEXSESSION_DBUS_INTERFACE); /* Properties init */ GHashTable *properties = obexsession_get_properties(self, &error); if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); g_assert(properties != NULL); /* string Address [readonly] */ if (g_hash_table_lookup(properties, "Address")) { self->priv->address = g_value_dup_string(g_hash_table_lookup(properties, "Address")); } else { self->priv->address = g_strdup("undefined"); } g_hash_table_unref(properties); } static void _obexsession_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { OBEXSession *self = OBEXSESSION(object); switch (property_id) { case PROP_DBUS_OBJECT_PATH: g_value_set_string(value, obexsession_get_dbus_object_path(self)); break; case PROP_ADDRESS: g_value_set_string(value, obexsession_get_address(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _obexsession_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { OBEXSession *self = OBEXSESSION(object); GError *error = NULL; switch (property_id) { case PROP_DBUS_OBJECT_PATH: obexsession_post_init(self, g_value_get_string(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } /* Methods */ /* dict GetProperties() */ GHashTable *obexsession_get_properties(OBEXSession *self, GError **error) { g_assert(OBEXSESSION_IS(self)); GHashTable *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "GetProperties", error, G_TYPE_INVALID, DBUS_TYPE_G_STRING_VARIANT_HASHTABLE, &ret, G_TYPE_INVALID); return ret; } /* Properties access methods */ const gchar *obexsession_get_dbus_object_path(OBEXSession *self) { g_assert(OBEXSESSION_IS(self)); return dbus_g_proxy_get_path(self->priv->dbus_g_proxy); } const gchar *obexsession_get_address(OBEXSession *self) { g_assert(OBEXSESSION_IS(self)); return self->priv->address; } bluez-tools-0.1.38+git662e/src/lib/obexd/obexagent.c0000644000175000017500000002123611434454154022301 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "../dbus-common.h" #include "../helpers.h" #include "obexclient_transfer.h" #include "obexagent.h" #define OBEXAGENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), OBEXAGENT_TYPE, OBEXAgentPrivate)) struct _OBEXAgentPrivate { /* Unused */ DBusGProxy *proxy; /* Properties */ gchar *root_folder; }; G_DEFINE_TYPE(OBEXAgent, obexagent, G_TYPE_OBJECT); enum { PROP_0, PROP_ROOT_FOLDER, /* readwrite, construct only */ }; static void _obexagent_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _obexagent_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); enum { OBEXAGENT_RELEASED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; static void obexagent_dispose(GObject *gobject) { OBEXAgent *self = OBEXAGENT(gobject); dbus_g_connection_unregister_g_object(session_conn, gobject); /* Proxy free */ //g_object_unref(self->priv->proxy); /* Properties free */ g_free(self->priv->root_folder); /* Chain up to the parent class */ G_OBJECT_CLASS(obexagent_parent_class)->dispose(gobject); } static void obexagent_class_init(OBEXAgentClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = obexagent_dispose; g_type_class_add_private(klass, sizeof(OBEXAgentPrivate)); /* Signals registation */ signals[OBEXAGENT_RELEASED] = g_signal_new("AgentReleased", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _obexagent_get_property; gobject_class->set_property = _obexagent_set_property; /* string RootFolder [readwrite, construct only] */ pspec = g_param_spec_string("RootFolder", "root_folder", "Root folder location", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_ROOT_FOLDER, pspec); } static void obexagent_init(OBEXAgent *self) { self->priv = OBEXAGENT_GET_PRIVATE(self); g_assert(session_conn != NULL); /* Properties init */ self->priv->root_folder = NULL; dbus_g_connection_register_g_object(session_conn, OBEXAGENT_DBUS_PATH, G_OBJECT(self)); g_print("OBEXAgent registered\n"); } static void _obexagent_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { OBEXAgent *self = OBEXAGENT(object); switch (property_id) { case PROP_ROOT_FOLDER: g_value_set_string(value, self->priv->root_folder); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _obexagent_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { OBEXAgent *self = OBEXAGENT(object); switch (property_id) { case PROP_ROOT_FOLDER: self->priv->root_folder = g_value_dup_string(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } /* Methods */ /* Server API */ gboolean obexagent_authorize(OBEXAgent *self, const gchar *transfer, const gchar *bt_address, const gchar *name, const gchar *type, gint length, gint time, gchar **ret, GError **error) { g_assert(self->priv->root_folder != NULL && strlen(self->priv->root_folder) > 0); *ret = NULL; g_print("[ObjectPush Request]\n"); g_print(" Address: %s\n", bt_address); g_print(" Name: %s\n", name); if (type && strlen(type)) { g_print(" Type: %s\n", type); } g_print(" Length: %d bytes\n", length); /*if (time) { g_print(" Time: %d\n", time); }*/ gchar yn[4] = {0,}; g_print("Accept (yes/no)? "); errno = 0; if (scanf("%3s", yn) == EOF && errno) { g_warning("%s\n", strerror(errno)); } if (g_strcmp0(yn, "y") == 0 || g_strcmp0(yn, "yes") == 0) { if (!g_path_is_absolute(self->priv->root_folder)) { gchar *abs_path = get_absolute_path(self->priv->root_folder); *ret = g_build_filename(abs_path, name, NULL); g_free(abs_path); } else { *ret = g_build_filename(self->priv->root_folder, name, NULL); } return TRUE; } else { // TODO: Fix error code if (error) *error = g_error_new(g_quark_from_static_string("org.openobex.Error.Rejected"), 0, "File transfer rejected"); return FALSE; } } gboolean obexagent_cancel(OBEXAgent *self, GError **error) { g_print("Request cancelled\n"); return TRUE; } /* Client API */ static gboolean update_progress = FALSE; gboolean obexagent_release(OBEXAgent *self, GError **error) { if (update_progress) { g_print("\n"); update_progress = FALSE; } g_print("OBEXAgent released\n"); g_signal_emit(self, signals[OBEXAGENT_RELEASED], 0); return TRUE; } gboolean obexagent_request(OBEXAgent *self, const gchar *transfer, gchar **ret, GError **error) { *ret = NULL; if (intf_supported(OBEXC_DBUS_NAME, transfer, OBEXCLIENT_TRANSFER_DBUS_INTERFACE)) { OBEXClientTransfer *transfer_t = g_object_new(OBEXCLIENT_TRANSFER_TYPE, "DBusObjectPath", transfer, NULL); g_print("[Transfer Request]\n"); g_print(" Name: %s\n", obexclient_transfer_get_name(transfer_t)); g_print(" Size: %llu bytes\n", obexclient_transfer_get_size(transfer_t)); g_print(" Filename: %s\n", obexclient_transfer_get_filename(transfer_t)); g_object_unref(transfer_t); gchar yn[4] = {0,}; g_print("Accept (yes/no)? "); errno = 0; if (scanf("%3s", yn) == EOF && errno) { g_warning("%s\n", strerror(errno)); } if (g_strcmp0(yn, "y") == 0 || g_strcmp0(yn, "yes") == 0) { return TRUE; } else { // TODO: Fix error code if (error) *error = g_error_new(g_quark_from_static_string("org.openobex.Error.Rejected"), 0, "File transfer rejected"); return FALSE; } } else { g_print("Error: Unknown transfer request\n"); // TODO: Fix error code if (error) *error = g_error_new(g_quark_from_static_string("org.openobex.Error.Rejected"), 0, "File transfer rejected"); return FALSE; } return TRUE; } gboolean obexagent_progress(OBEXAgent *self, const gchar *transfer, guint64 transferred, GError **error) { if (intf_supported(OBEXC_DBUS_NAME, transfer, OBEXCLIENT_TRANSFER_DBUS_INTERFACE)) { OBEXClientTransfer *transfer_t = g_object_new(OBEXCLIENT_TRANSFER_TYPE, "DBusObjectPath", transfer, NULL); guint64 total = obexclient_transfer_get_size(transfer_t); guint pp = (transferred / (gfloat) total)*100; if (!update_progress) { g_print("[Transfer#%s] Progress: %3u%%", obexclient_transfer_get_name(transfer_t), pp); update_progress = TRUE; } else { g_print("\b\b\b\b%3u%%", pp); } if (pp == 100) { g_print("\n"); update_progress = FALSE; } g_object_unref(transfer_t); } return TRUE; } gboolean obexagent_complete(OBEXAgent *self, const gchar *transfer, GError **error) { if (update_progress) { g_print("\n"); update_progress = FALSE; } if (intf_supported(OBEXC_DBUS_NAME, transfer, OBEXCLIENT_TRANSFER_DBUS_INTERFACE)) { OBEXClientTransfer *transfer_t = g_object_new(OBEXCLIENT_TRANSFER_TYPE, "DBusObjectPath", transfer, NULL); g_print("[Transfer#%s] Completed\n", obexclient_transfer_get_name(transfer_t)); g_object_unref(transfer_t); } return TRUE; } gboolean obexagent_error(OBEXAgent *self, const gchar *transfer, const gchar *message, GError **error) { if (update_progress) { g_print("\n"); update_progress = FALSE; } g_print("[Transfer] Error: %s\n", message); /* * Transfer interface does not exists * Code commented * if (intf_supported(OBEXC_DBUS_NAME, transfer, OBEXCLIENT_TRANSFER_DBUS_INTERFACE)) { OBEXClientTransfer *transfer_t = g_object_new(OBEXCLIENT_TRANSFER_TYPE, "DBusObjectPath", transfer, NULL); g_print("[Transfer#%s] Error: %s\n", obexclient_transfer_get_name(transfer_t), message); g_object_unref(transfer_t); } */ return TRUE; } bluez-tools-0.1.38+git662e/src/lib/obexd/obexclient_session.h0000644000175000017500000000535111430124373024222 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __OBEXCLIENT_SESSION_H #define __OBEXCLIENT_SESSION_H #include #define OBEXCLIENT_SESSION_DBUS_INTERFACE "org.openobex.Session" /* * Type macros */ #define OBEXCLIENT_SESSION_TYPE (obexclient_session_get_type()) #define OBEXCLIENT_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OBEXCLIENT_SESSION_TYPE, OBEXClientSession)) #define OBEXCLIENT_SESSION_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), OBEXCLIENT_SESSION_TYPE)) #define OBEXCLIENT_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), OBEXCLIENT_SESSION_TYPE, OBEXClientSessionClass)) #define OBEXCLIENT_SESSION_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), OBEXCLIENT_SESSION_TYPE)) #define OBEXCLIENT_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), OBEXCLIENT_SESSION_TYPE, OBEXClientSessionClass)) typedef struct _OBEXClientSession OBEXClientSession; typedef struct _OBEXClientSessionClass OBEXClientSessionClass; typedef struct _OBEXClientSessionPrivate OBEXClientSessionPrivate; struct _OBEXClientSession { GObject parent_instance; /*< private >*/ OBEXClientSessionPrivate *priv; }; struct _OBEXClientSessionClass { GObjectClass parent_class; }; /* used by OBEXCLIENT_SESSION_TYPE */ GType obexclient_session_get_type(void) G_GNUC_CONST; /* * Method definitions */ void obexclient_session_assign_agent(OBEXClientSession *self, const gchar *agent, GError **error); GHashTable *obexclient_session_get_properties(OBEXClientSession *self, GError **error); void obexclient_session_release_agent(OBEXClientSession *self, const gchar *agent, GError **error); const gchar *obexclient_session_get_dbus_object_path(OBEXClientSession *self); const guchar obexclient_session_get_channel(OBEXClientSession *self); const gchar *obexclient_session_get_destination(OBEXClientSession *self); const gchar *obexclient_session_get_source(OBEXClientSession *self); #endif /* __OBEXCLIENT_SESSION_H */ bluez-tools-0.1.38+git662e/src/lib/obexd/obexmanager.h0000644000175000017500000000426311430124373022614 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __OBEXMANAGER_H #define __OBEXMANAGER_H #include #define OBEXMANAGER_DBUS_PATH "/" #define OBEXMANAGER_DBUS_INTERFACE "org.openobex.Manager" /* * Type macros */ #define OBEXMANAGER_TYPE (obexmanager_get_type()) #define OBEXMANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OBEXMANAGER_TYPE, OBEXManager)) #define OBEXMANAGER_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), OBEXMANAGER_TYPE)) #define OBEXMANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), OBEXMANAGER_TYPE, OBEXManagerClass)) #define OBEXMANAGER_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), OBEXMANAGER_TYPE)) #define OBEXMANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), OBEXMANAGER_TYPE, OBEXManagerClass)) typedef struct _OBEXManager OBEXManager; typedef struct _OBEXManagerClass OBEXManagerClass; typedef struct _OBEXManagerPrivate OBEXManagerPrivate; struct _OBEXManager { GObject parent_instance; /*< private >*/ OBEXManagerPrivate *priv; }; struct _OBEXManagerClass { GObjectClass parent_class; }; /* used by OBEXMANAGER_TYPE */ GType obexmanager_get_type(void) G_GNUC_CONST; /* * Method definitions */ void obexmanager_register_agent(OBEXManager *self, const gchar *agent, GError **error); void obexmanager_unregister_agent(OBEXManager *self, const gchar *agent, GError **error); #endif /* __OBEXMANAGER_H */ bluez-tools-0.1.38+git662e/src/lib/obexd/obexsession.h0000644000175000017500000000424611430124373022666 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __OBEXSESSION_H #define __OBEXSESSION_H #include #define OBEXSESSION_DBUS_INTERFACE "org.openobex.Session" /* * Type macros */ #define OBEXSESSION_TYPE (obexsession_get_type()) #define OBEXSESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OBEXSESSION_TYPE, OBEXSession)) #define OBEXSESSION_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), OBEXSESSION_TYPE)) #define OBEXSESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), OBEXSESSION_TYPE, OBEXSessionClass)) #define OBEXSESSION_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), OBEXSESSION_TYPE)) #define OBEXSESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), OBEXSESSION_TYPE, OBEXSessionClass)) typedef struct _OBEXSession OBEXSession; typedef struct _OBEXSessionClass OBEXSessionClass; typedef struct _OBEXSessionPrivate OBEXSessionPrivate; struct _OBEXSession { GObject parent_instance; /*< private >*/ OBEXSessionPrivate *priv; }; struct _OBEXSessionClass { GObjectClass parent_class; }; /* used by OBEXSESSION_TYPE */ GType obexsession_get_type(void) G_GNUC_CONST; /* * Method definitions */ GHashTable *obexsession_get_properties(OBEXSession *self, GError **error); const gchar *obexsession_get_dbus_object_path(OBEXSession *self); const gchar *obexsession_get_address(OBEXSession *self); #endif /* __OBEXSESSION_H */ bluez-tools-0.1.38+git662e/src/lib/obexd/obexagent.h0000644000175000017500000000772211427475265022322 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __OBEXAGENT_H #define __OBEXAGENT_H #include #include #include "../marshallers.h" #define OBEXAGENT_DBUS_PATH "/ObexAgent" /* * Type macros */ #define OBEXAGENT_TYPE (obexagent_get_type()) #define OBEXAGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OBEXAGENT_TYPE, OBEXAgent)) #define OBEXAGENT_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), OBEXAGENT_TYPE)) #define OBEXAGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), OBEXAGENT_TYPE, OBEXAgentClass)) #define OBEXAGENT_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), OBEXAGENT_TYPE)) #define OBEXAGENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), OBEXAGENT_TYPE, OBEXAgentClass)) typedef struct _OBEXAgent OBEXAgent; typedef struct _OBEXAgentClass OBEXAgentClass; typedef struct _OBEXAgentPrivate OBEXAgentPrivate; struct _OBEXAgent { GObject parent_instance; /*< private >*/ OBEXAgentPrivate *priv; }; struct _OBEXAgentClass { GObjectClass parent_class; }; /* used by OBEXAGENT_TYPE */ GType obexagent_get_type(void) G_GNUC_CONST; /* * Method definitions */ /* Server API */ gboolean obexagent_authorize(OBEXAgent *self, const gchar *transfer, const gchar *bt_address, const gchar *name, const gchar *type, gint length, gint time, gchar **ret, GError **error); gboolean obexagent_cancel(OBEXAgent *self, GError **error); /* Client API */ gboolean obexagent_release(OBEXAgent *self, GError **error); gboolean obexagent_request(OBEXAgent *self, const gchar *transfer, gchar **ret, GError **error); gboolean obexagent_progress(OBEXAgent *self, const gchar *transfer, guint64 transferred, GError **error); gboolean obexagent_complete(OBEXAgent *self, const gchar *transfer, GError **error); gboolean obexagent_error(OBEXAgent *self, const gchar *transfer, const gchar *message, GError **error); /* Glue code */ static const DBusGMethodInfo dbus_glib_obexagent_methods[] = { { (GCallback) obexagent_authorize, g_cclosure_bt_marshal_BOOLEAN__BOXED_STRING_STRING_STRING_INT_INT_POINTER_POINTER, 0}, { (GCallback) obexagent_cancel, g_cclosure_bt_marshal_BOOLEAN__POINTER, 111}, { (GCallback) obexagent_release, g_cclosure_bt_marshal_BOOLEAN__POINTER, 140}, { (GCallback) obexagent_request, g_cclosure_bt_marshal_BOOLEAN__BOXED_POINTER_POINTER, 170}, { (GCallback) obexagent_progress, g_cclosure_bt_marshal_BOOLEAN__BOXED_UINT64_POINTER, 226}, { (GCallback) obexagent_complete, g_cclosure_bt_marshal_BOOLEAN__BOXED_POINTER, 286}, { (GCallback) obexagent_error, g_cclosure_bt_marshal_BOOLEAN__BOXED_STRING_POINTER, 330}, }; static const DBusGObjectInfo dbus_glib_obexagent_object_info = { 0, dbus_glib_obexagent_methods, 7, "org.openobex.Agent\0Authorize\0S\0transfer\0I\0o\0bt_address\0I\0s\0name\0I\0s\0type\0I\0s\0length\0I\0i\0time\0I\0i\0arg6\0O\0F\0N\0s\0\0org.openobex.Agent\0Cancel\0S\0\0org.openobex.Agent\0Release\0S\0\0org.openobex.Agent\0Request\0S\0transfer\0I\0o\0arg1\0O\0F\0N\0s\0\0org.openobex.Agent\0Progress\0S\0transfer\0I\0o\0transferred\0I\0t\0\0org.openobex.Agent\0Complete\0S\0transfer\0I\0o\0\0org.openobex.Agent\0Error\0S\0transfer\0I\0o\0message\0I\0s\0\0\0", "\0", "\0" }; #endif /* __OBEXAGENT_H */ bluez-tools-0.1.38+git662e/src/lib/obexd/obextransfer.c0000644000175000017500000001471511430124373023024 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "obextransfer.h" #define OBEXTRANSFER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), OBEXTRANSFER_TYPE, OBEXTransferPrivate)) struct _OBEXTransferPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; }; G_DEFINE_TYPE(OBEXTransfer, obextransfer, G_TYPE_OBJECT); enum { PROP_0, PROP_DBUS_OBJECT_PATH /* readwrite, construct only */ }; static void _obextransfer_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _obextransfer_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); enum { PROGRESS, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; static void progress_handler(DBusGProxy *dbus_g_proxy, const gint32 total, const gint32 transfered, gpointer data); static void obextransfer_dispose(GObject *gobject) { OBEXTransfer *self = OBEXTRANSFER(gobject); /* DBus signals disconnection */ dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "Progress", G_CALLBACK(progress_handler), self); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(obextransfer_parent_class)->dispose(gobject); } static void obextransfer_class_init(OBEXTransferClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = obextransfer_dispose; g_type_class_add_private(klass, sizeof(OBEXTransferPrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _obextransfer_get_property; gobject_class->set_property = _obextransfer_set_property; /* object DBusObjectPath [readwrite, construct only] */ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "Adapter D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec); /* Signals registation */ signals[PROGRESS] = g_signal_new("Progress", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_bt_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); } static void obextransfer_init(OBEXTransfer *self) { self->priv = OBEXTRANSFER_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(session_conn != NULL); } static void obextransfer_post_init(OBEXTransfer *self, const gchar *dbus_object_path) { g_assert(dbus_object_path != NULL); g_assert(strlen(dbus_object_path) > 0); g_assert(self->priv->dbus_g_proxy == NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", dbus_object_path, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", OBEXTRANSFER_DBUS_INTERFACE, dbus_object_path); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", dbus_object_path, OBEXTRANSFER_DBUS_INTERFACE); /* DBus signals connection */ /* Progress(int32 total, int32 transfered) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "Progress", G_TYPE_INT, G_TYPE_INT, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "Progress", G_CALLBACK(progress_handler), self, NULL); } static void _obextransfer_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { OBEXTransfer *self = OBEXTRANSFER(object); switch (property_id) { case PROP_DBUS_OBJECT_PATH: g_value_set_string(value, obextransfer_get_dbus_object_path(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _obextransfer_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { OBEXTransfer *self = OBEXTRANSFER(object); GError *error = NULL; switch (property_id) { case PROP_DBUS_OBJECT_PATH: obextransfer_post_init(self, g_value_get_string(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } /* Methods */ /* void Cancel() */ void obextransfer_cancel(OBEXTransfer *self, GError **error) { g_assert(OBEXTRANSFER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "Cancel", error, G_TYPE_INVALID, G_TYPE_INVALID); } /* Properties access methods */ const gchar *obextransfer_get_dbus_object_path(OBEXTransfer *self) { g_assert(OBEXTRANSFER_IS(self)); return dbus_g_proxy_get_path(self->priv->dbus_g_proxy); } /* Signals handlers */ static void progress_handler(DBusGProxy *dbus_g_proxy, const gint32 total, const gint32 transfered, gpointer data) { OBEXTransfer *self = OBEXTRANSFER(data); g_signal_emit(self, signals[PROGRESS], 0, total, transfered); } bluez-tools-0.1.38+git662e/src/lib/obexd/obexclient_file_transfer.c0000644000175000017500000002056511430124373025361 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "obexclient_file_transfer.h" #define OBEXCLIENT_FILE_TRANSFER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), OBEXCLIENT_FILE_TRANSFER_TYPE, OBEXClientFileTransferPrivate)) struct _OBEXClientFileTransferPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; }; G_DEFINE_TYPE(OBEXClientFileTransfer, obexclient_file_transfer, G_TYPE_OBJECT); enum { PROP_0, PROP_DBUS_OBJECT_PATH /* readwrite, construct only */ }; static void _obexclient_file_transfer_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void _obexclient_file_transfer_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); static void obexclient_file_transfer_dispose(GObject *gobject) { OBEXClientFileTransfer *self = OBEXCLIENT_FILE_TRANSFER(gobject); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(obexclient_file_transfer_parent_class)->dispose(gobject); } static void obexclient_file_transfer_class_init(OBEXClientFileTransferClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = obexclient_file_transfer_dispose; g_type_class_add_private(klass, sizeof(OBEXClientFileTransferPrivate)); /* Properties registration */ GParamSpec *pspec; gobject_class->get_property = _obexclient_file_transfer_get_property; gobject_class->set_property = _obexclient_file_transfer_set_property; /* object DBusObjectPath [readwrite, construct only] */ pspec = g_param_spec_string("DBusObjectPath", "dbus_object_path", "Adapter D-Bus object path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property(gobject_class, PROP_DBUS_OBJECT_PATH, pspec); } static void obexclient_file_transfer_init(OBEXClientFileTransfer *self) { self->priv = OBEXCLIENT_FILE_TRANSFER_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(session_conn != NULL); } static void obexclient_file_transfer_post_init(OBEXClientFileTransfer *self, const gchar *dbus_object_path) { g_assert(dbus_object_path != NULL); g_assert(strlen(dbus_object_path) > 0); g_assert(self->priv->dbus_g_proxy == NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", OBEXCLIENT_FILE_TRANSFER_DBUS_INTERFACE, dbus_object_path); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, OBEXCLIENT_FILE_TRANSFER_DBUS_INTERFACE); } static void _obexclient_file_transfer_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { OBEXClientFileTransfer *self = OBEXCLIENT_FILE_TRANSFER(object); switch (property_id) { case PROP_DBUS_OBJECT_PATH: g_value_set_string(value, obexclient_file_transfer_get_dbus_object_path(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void _obexclient_file_transfer_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { OBEXClientFileTransfer *self = OBEXCLIENT_FILE_TRANSFER(object); GError *error = NULL; switch (property_id) { case PROP_DBUS_OBJECT_PATH: obexclient_file_transfer_post_init(self, g_value_get_string(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } if (error != NULL) { g_critical("%s", error->message); } g_assert(error == NULL); } /* Methods */ /* void ChangeFolder(string folder) */ void obexclient_file_transfer_change_folder(OBEXClientFileTransfer *self, const gchar *folder, GError **error) { g_assert(OBEXCLIENT_FILE_TRANSFER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "ChangeFolder", error, G_TYPE_STRING, folder, G_TYPE_INVALID, G_TYPE_INVALID); } /* void CopyFile(string sourcefile, string targetfile) */ void obexclient_file_transfer_copy_file(OBEXClientFileTransfer *self, const gchar *sourcefile, const gchar *targetfile, GError **error) { g_assert(OBEXCLIENT_FILE_TRANSFER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "CopyFile", error, G_TYPE_STRING, sourcefile, G_TYPE_STRING, targetfile, G_TYPE_INVALID, G_TYPE_INVALID); } /* void CreateFolder(string folder) */ void obexclient_file_transfer_create_folder(OBEXClientFileTransfer *self, const gchar *folder, GError **error) { g_assert(OBEXCLIENT_FILE_TRANSFER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "CreateFolder", error, G_TYPE_STRING, folder, G_TYPE_INVALID, G_TYPE_INVALID); } /* void Delete(string file) */ void obexclient_file_transfer_delete(OBEXClientFileTransfer *self, const gchar *file, GError **error) { g_assert(OBEXCLIENT_FILE_TRANSFER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "Delete", error, G_TYPE_STRING, file, G_TYPE_INVALID, G_TYPE_INVALID); } /* void GetFile(string targetfile, string sourcefile) */ void obexclient_file_transfer_get_file(OBEXClientFileTransfer *self, const gchar *targetfile, const gchar *sourcefile, GError **error) { g_assert(OBEXCLIENT_FILE_TRANSFER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "GetFile", error, G_TYPE_STRING, targetfile, G_TYPE_STRING, sourcefile, G_TYPE_INVALID, G_TYPE_INVALID); } /* array{dict} ListFolder() */ GPtrArray *obexclient_file_transfer_list_folder(OBEXClientFileTransfer *self, GError **error) { g_assert(OBEXCLIENT_FILE_TRANSFER_IS(self)); GPtrArray *ret = NULL; dbus_g_proxy_call(self->priv->dbus_g_proxy, "ListFolder", error, G_TYPE_INVALID, DBUS_TYPE_G_HASH_TABLE_ARRAY, &ret, G_TYPE_INVALID); return ret; } /* void MoveFile(string sourcefile, string targetfile) */ void obexclient_file_transfer_move_file(OBEXClientFileTransfer *self, const gchar *sourcefile, const gchar *targetfile, GError **error) { g_assert(OBEXCLIENT_FILE_TRANSFER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "MoveFile", error, G_TYPE_STRING, sourcefile, G_TYPE_STRING, targetfile, G_TYPE_INVALID, G_TYPE_INVALID); } /* void PutFile(string sourcefile, string targetfile) */ void obexclient_file_transfer_put_file(OBEXClientFileTransfer *self, const gchar *sourcefile, const gchar *targetfile, GError **error) { g_assert(OBEXCLIENT_FILE_TRANSFER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "PutFile", error, G_TYPE_STRING, sourcefile, G_TYPE_STRING, targetfile, G_TYPE_INVALID, G_TYPE_INVALID); } /* Properties access methods */ const gchar *obexclient_file_transfer_get_dbus_object_path(OBEXClientFileTransfer *self) { g_assert(OBEXCLIENT_FILE_TRANSFER_IS(self)); return dbus_g_proxy_get_path(self->priv->dbus_g_proxy); } bluez-tools-0.1.38+git662e/src/lib/obexd/obexclient_file_transfer.h0000644000175000017500000000656511430124373025372 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __OBEXCLIENT_FILE_TRANSFER_H #define __OBEXCLIENT_FILE_TRANSFER_H #include #define OBEXCLIENT_FILE_TRANSFER_DBUS_INTERFACE "org.openobex.FileTransfer" /* * Type macros */ #define OBEXCLIENT_FILE_TRANSFER_TYPE (obexclient_file_transfer_get_type()) #define OBEXCLIENT_FILE_TRANSFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OBEXCLIENT_FILE_TRANSFER_TYPE, OBEXClientFileTransfer)) #define OBEXCLIENT_FILE_TRANSFER_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), OBEXCLIENT_FILE_TRANSFER_TYPE)) #define OBEXCLIENT_FILE_TRANSFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), OBEXCLIENT_FILE_TRANSFER_TYPE, OBEXClientFileTransferClass)) #define OBEXCLIENT_FILE_TRANSFER_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), OBEXCLIENT_FILE_TRANSFER_TYPE)) #define OBEXCLIENT_FILE_TRANSFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), OBEXCLIENT_FILE_TRANSFER_TYPE, OBEXClientFileTransferClass)) typedef struct _OBEXClientFileTransfer OBEXClientFileTransfer; typedef struct _OBEXClientFileTransferClass OBEXClientFileTransferClass; typedef struct _OBEXClientFileTransferPrivate OBEXClientFileTransferPrivate; struct _OBEXClientFileTransfer { GObject parent_instance; /*< private >*/ OBEXClientFileTransferPrivate *priv; }; struct _OBEXClientFileTransferClass { GObjectClass parent_class; }; /* used by OBEXCLIENT_FILE_TRANSFER_TYPE */ GType obexclient_file_transfer_get_type(void) G_GNUC_CONST; /* * Method definitions */ void obexclient_file_transfer_change_folder(OBEXClientFileTransfer *self, const gchar *folder, GError **error); void obexclient_file_transfer_copy_file(OBEXClientFileTransfer *self, const gchar *sourcefile, const gchar *targetfile, GError **error); void obexclient_file_transfer_create_folder(OBEXClientFileTransfer *self, const gchar *folder, GError **error); void obexclient_file_transfer_delete(OBEXClientFileTransfer *self, const gchar *file, GError **error); void obexclient_file_transfer_get_file(OBEXClientFileTransfer *self, const gchar *targetfile, const gchar *sourcefile, GError **error); GPtrArray *obexclient_file_transfer_list_folder(OBEXClientFileTransfer *self, GError **error); void obexclient_file_transfer_move_file(OBEXClientFileTransfer *self, const gchar *sourcefile, const gchar *targetfile, GError **error); void obexclient_file_transfer_put_file(OBEXClientFileTransfer *self, const gchar *sourcefile, const gchar *targetfile, GError **error); const gchar *obexclient_file_transfer_get_dbus_object_path(OBEXClientFileTransfer *self); #endif /* __OBEXCLIENT_FILE_TRANSFER_H */ bluez-tools-0.1.38+git662e/src/lib/obexd/obexmanager.c0000644000175000017500000001752511430124373022614 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "../dbus-common.h" #include "../marshallers.h" #include "obexmanager.h" #define OBEXMANAGER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), OBEXMANAGER_TYPE, OBEXManagerPrivate)) struct _OBEXManagerPrivate { DBusGProxy *dbus_g_proxy; /* Introspection data */ DBusGProxy *introspection_g_proxy; gchar *introspection_xml; }; G_DEFINE_TYPE(OBEXManager, obexmanager, G_TYPE_OBJECT); enum { SESSION_CREATED, SESSION_REMOVED, TRANSFER_COMPLETED, TRANSFER_STARTED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0}; static void session_created_handler(DBusGProxy *dbus_g_proxy, const gchar *session, gpointer data); static void session_removed_handler(DBusGProxy *dbus_g_proxy, const gchar *session, gpointer data); static void transfer_completed_handler(DBusGProxy *dbus_g_proxy, const gchar *transfer, const gboolean success, gpointer data); static void transfer_started_handler(DBusGProxy *dbus_g_proxy, const gchar *transfer, gpointer data); static void obexmanager_dispose(GObject *gobject) { OBEXManager *self = OBEXMANAGER(gobject); /* DBus signals disconnection */ dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "SessionCreated", G_CALLBACK(session_created_handler), self); dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "SessionRemoved", G_CALLBACK(session_removed_handler), self); dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "TransferCompleted", G_CALLBACK(transfer_completed_handler), self); dbus_g_proxy_disconnect_signal(self->priv->dbus_g_proxy, "TransferStarted", G_CALLBACK(transfer_started_handler), self); /* Proxy free */ g_object_unref(self->priv->dbus_g_proxy); /* Introspection data free */ g_free(self->priv->introspection_xml); g_object_unref(self->priv->introspection_g_proxy); /* Chain up to the parent class */ G_OBJECT_CLASS(obexmanager_parent_class)->dispose(gobject); } static void obexmanager_class_init(OBEXManagerClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); gobject_class->dispose = obexmanager_dispose; g_type_class_add_private(klass, sizeof(OBEXManagerPrivate)); /* Signals registation */ signals[SESSION_CREATED] = g_signal_new("SessionCreated", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); signals[SESSION_REMOVED] = g_signal_new("SessionRemoved", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); signals[TRANSFER_COMPLETED] = g_signal_new("TransferCompleted", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_bt_marshal_VOID__STRING_BOOLEAN, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_BOOLEAN); signals[TRANSFER_STARTED] = g_signal_new("TransferStarted", G_TYPE_FROM_CLASS(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); } static void obexmanager_init(OBEXManager *self) { self->priv = OBEXMANAGER_GET_PRIVATE(self); /* DBusGProxy init */ self->priv->dbus_g_proxy = NULL; g_assert(session_conn != NULL); GError *error = NULL; /* Getting introspection XML */ self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", OBEXMANAGER_DBUS_PATH, "org.freedesktop.DBus.Introspectable"); self->priv->introspection_xml = NULL; if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { g_critical("%s", error->message); } g_assert(error == NULL); gchar *check_intf_regex_str = g_strconcat("", NULL); if (!g_regex_match_simple(check_intf_regex_str, self->priv->introspection_xml, 0, 0)) { g_critical("Interface \"%s\" does not exist in \"%s\"", OBEXMANAGER_DBUS_INTERFACE, OBEXMANAGER_DBUS_PATH); g_assert(FALSE); } g_free(check_intf_regex_str); self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", OBEXMANAGER_DBUS_PATH, OBEXMANAGER_DBUS_INTERFACE); /* DBus signals connection */ /* SessionCreated(object session) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "SessionCreated", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "SessionCreated", G_CALLBACK(session_created_handler), self, NULL); /* SessionRemoved(object session) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "SessionRemoved", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "SessionRemoved", G_CALLBACK(session_removed_handler), self, NULL); /* TransferCompleted(object transfer, boolean success) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "TransferCompleted", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_BOOLEAN, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "TransferCompleted", G_CALLBACK(transfer_completed_handler), self, NULL); /* TransferStarted(object transfer) */ dbus_g_proxy_add_signal(self->priv->dbus_g_proxy, "TransferStarted", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); dbus_g_proxy_connect_signal(self->priv->dbus_g_proxy, "TransferStarted", G_CALLBACK(transfer_started_handler), self, NULL); } /* Methods */ /* void RegisterAgent(object agent) */ void obexmanager_register_agent(OBEXManager *self, const gchar *agent, GError **error) { g_assert(OBEXMANAGER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "RegisterAgent", error, DBUS_TYPE_G_OBJECT_PATH, agent, G_TYPE_INVALID, G_TYPE_INVALID); } /* void UnregisterAgent(object agent) */ void obexmanager_unregister_agent(OBEXManager *self, const gchar *agent, GError **error) { g_assert(OBEXMANAGER_IS(self)); dbus_g_proxy_call(self->priv->dbus_g_proxy, "UnregisterAgent", error, DBUS_TYPE_G_OBJECT_PATH, agent, G_TYPE_INVALID, G_TYPE_INVALID); } /* Signals handlers */ static void session_created_handler(DBusGProxy *dbus_g_proxy, const gchar *session, gpointer data) { OBEXManager *self = OBEXMANAGER(data); g_signal_emit(self, signals[SESSION_CREATED], 0, session); } static void session_removed_handler(DBusGProxy *dbus_g_proxy, const gchar *session, gpointer data) { OBEXManager *self = OBEXMANAGER(data); g_signal_emit(self, signals[SESSION_REMOVED], 0, session); } static void transfer_completed_handler(DBusGProxy *dbus_g_proxy, const gchar *transfer, const gboolean success, gpointer data) { OBEXManager *self = OBEXMANAGER(data); g_signal_emit(self, signals[TRANSFER_COMPLETED], 0, transfer, success); } static void transfer_started_handler(DBusGProxy *dbus_g_proxy, const gchar *transfer, gpointer data) { OBEXManager *self = OBEXMANAGER(data); g_signal_emit(self, signals[TRANSFER_STARTED], 0, transfer); } bluez-tools-0.1.38+git662e/src/lib/obexd/obexclient_transfer.h0000644000175000017500000000521711430124373024364 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __OBEXCLIENT_TRANSFER_H #define __OBEXCLIENT_TRANSFER_H #include #define OBEXCLIENT_TRANSFER_DBUS_INTERFACE "org.openobex.Transfer" /* * Type macros */ #define OBEXCLIENT_TRANSFER_TYPE (obexclient_transfer_get_type()) #define OBEXCLIENT_TRANSFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OBEXCLIENT_TRANSFER_TYPE, OBEXClientTransfer)) #define OBEXCLIENT_TRANSFER_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), OBEXCLIENT_TRANSFER_TYPE)) #define OBEXCLIENT_TRANSFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), OBEXCLIENT_TRANSFER_TYPE, OBEXClientTransferClass)) #define OBEXCLIENT_TRANSFER_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), OBEXCLIENT_TRANSFER_TYPE)) #define OBEXCLIENT_TRANSFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), OBEXCLIENT_TRANSFER_TYPE, OBEXClientTransferClass)) typedef struct _OBEXClientTransfer OBEXClientTransfer; typedef struct _OBEXClientTransferClass OBEXClientTransferClass; typedef struct _OBEXClientTransferPrivate OBEXClientTransferPrivate; struct _OBEXClientTransfer { GObject parent_instance; /*< private >*/ OBEXClientTransferPrivate *priv; }; struct _OBEXClientTransferClass { GObjectClass parent_class; }; /* used by OBEXCLIENT_TRANSFER_TYPE */ GType obexclient_transfer_get_type(void) G_GNUC_CONST; /* * Method definitions */ void obexclient_transfer_cancel(OBEXClientTransfer *self, GError **error); GHashTable *obexclient_transfer_get_properties(OBEXClientTransfer *self, GError **error); const gchar *obexclient_transfer_get_dbus_object_path(OBEXClientTransfer *self); const gchar *obexclient_transfer_get_filename(OBEXClientTransfer *self); const gchar *obexclient_transfer_get_name(OBEXClientTransfer *self); const guint64 obexclient_transfer_get_size(OBEXClientTransfer *self); #endif /* __OBEXCLIENT_TRANSFER_H */ bluez-tools-0.1.38+git662e/src/lib/marshallers.h0000644000175000017500000001746411430125625021550 0ustar iwamatsuiwamatsu #ifndef __g_cclosure_bt_marshal_MARSHAL_H__ #define __g_cclosure_bt_marshal_MARSHAL_H__ #include G_BEGIN_DECLS /* VOID:STRING,BOXED (lib/marshallers.list:2) */ extern void g_cclosure_bt_marshal_VOID__STRING_BOXED (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:POINTER (lib/marshallers.list:5) */ extern void g_cclosure_bt_marshal_BOOLEAN__POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:BOXED,POINTER,POINTER (lib/marshallers.list:6) */ extern void g_cclosure_bt_marshal_BOOLEAN__BOXED_POINTER_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:BOXED,UINT,UCHAR,POINTER (lib/marshallers.list:7) */ extern void g_cclosure_bt_marshal_BOOLEAN__BOXED_UINT_UCHAR_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:BOXED,UINT,POINTER (lib/marshallers.list:8) */ extern void g_cclosure_bt_marshal_BOOLEAN__BOXED_UINT_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:BOXED,STRING,POINTER (lib/marshallers.list:9) */ extern void g_cclosure_bt_marshal_BOOLEAN__BOXED_STRING_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:STRING,POINTER (lib/marshallers.list:10) */ extern void g_cclosure_bt_marshal_BOOLEAN__STRING_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:INT,INT (lib/marshallers.list:13) */ extern void g_cclosure_bt_marshal_VOID__INT_INT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:STRING,BOOLEAN (lib/marshallers.list:16) */ extern void g_cclosure_bt_marshal_VOID__STRING_BOOLEAN (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:BOXED,BOOLEAN (lib/marshallers.list:17) */ extern void g_cclosure_bt_marshal_VOID__BOXED_BOOLEAN (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:BOXED,STRING,STRING,STRING,INT,INT,POINTER,POINTER (lib/marshallers.list:20) */ extern void g_cclosure_bt_marshal_BOOLEAN__BOXED_STRING_STRING_STRING_INT_INT_POINTER_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:BOXED,UINT64,POINTER (lib/marshallers.list:23) */ extern void g_cclosure_bt_marshal_BOOLEAN__BOXED_UINT64_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:BOXED,POINTER (lib/marshallers.list:24) */ extern void g_cclosure_bt_marshal_BOOLEAN__BOXED_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); G_END_DECLS #endif /* __g_cclosure_bt_marshal_MARSHAL_H__ */ bluez-tools-0.1.38+git662e/src/lib/helpers.h0000644000175000017500000000400511454101405020654 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __HELPERS_H #define __HELPERS_H #include #include #include "bluez-api.h" #ifdef OBEX_SUPPORT #include "obexd-api.h" #endif /* DBus helpers */ gboolean intf_supported(const gchar *dbus_service_name, const gchar *dbus_object_path, const gchar *intf_name); /* BlueZ helpers */ Adapter *find_adapter(const gchar *name, GError **error); Device *find_device(Adapter *adapter, const gchar *name, GError **error); /* Others helpers */ #define exit_if_error(error) G_STMT_START{ \ if (error) { \ g_printerr("%s: %s\n", (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION && dbus_g_error_get_name(error) != NULL && strlen(dbus_g_error_get_name(error)) ? dbus_g_error_get_name(error) : "Error"), error->message); \ exit(EXIT_FAILURE); \ }; }G_STMT_END /* Convert hex string to int */ int xtoi(const gchar *str); /* UUID converters */ const gchar *uuid2name(const gchar *uuid); const gchar *name2uuid(const gchar *name); /* FS helpers */ gboolean is_file(const gchar *filename, GError **error); gboolean is_dir(const gchar *dirname, GError **error); gchar *get_absolute_path(const gchar *path); #endif /* __HELPERS_H */ bluez-tools-0.1.38+git662e/src/bt-agent.10000644000175000017500000001105311472236011020061 0ustar iwamatsuiwamatsu.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "bt-agent 1" .TH bt-agent 1 "2010-08-11" "" "bluez-tools" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" bt\-adapter \- a bluetooth agent .SH "SYNOPSIS" .IX Header "SYNOPSIS" bt-agent [\s-1OPTION\s0...] .PP Help Options: \-h, \-\-help .PP Application Options: \-a, \-\-adapter= .SH "DESCRIPTION" .IX Header "DESCRIPTION" This interactive utility is used to manage incoming Bluetooth requests (eg. request of pincode, request of authorize a connection/service request, etc). .SH "OPTIONS" .IX Header "OPTIONS" \&\fB\-h, \-\-help\fR Show help .PP \&\fB\-a, \-\-adapter \fR Specify adapter to use by his Name or \s-1MAC\s0 address (if this option does not defined \- default adapter used) .SH "AUTHOR" .IX Header "AUTHOR" Alexander Orlenko . .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIbt\-adapter\fR\|(1) \fIbt\-audio\fR\|(1) \fIbt\-device\fR\|(1) \fIbt\-input\fR\|(1) \fIbt\-monitor\fR\|(1) \fIbt\-network\fR\|(1) \fIbt\-serial\fR\|(1) bluez-tools-0.1.38+git662e/src/bt-adapter.10000644000175000017500000001525211472236011020410 0ustar iwamatsuiwamatsu.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "bt-adapter 1" .TH bt-adapter 1 "2010-08-16" "" "bluez-tools" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" bt\-adapter \- a bluetooth adapter manager .SH "SYNOPSIS" .IX Header "SYNOPSIS" bt-adapter [\s-1OPTION\s0...] .PP Help Options: \-h, \-\-help .PP Application Options: \-l, \-\-list \-a, \-\-adapter= \-i, \-\-info \-d, \-\-discover \-\-set .SH "DESCRIPTION" .IX Header "DESCRIPTION" This utility is used to manage Bluetooth adapters. You can list all available adapters, show information about adapter, change adapter properties or discover remote devices. .SH "OPTIONS" .IX Header "OPTIONS" \&\fB\-h, \-\-help\fR Show help .PP \&\fB\-l, \-\-list\fR List all available adapters .PP \&\fB\-a, \-\-adapter \fR Specify adapter to use by his Name or \s-1MAC\s0 address (if this option does not defined \- default adapter used) .PP \&\fB\-i, \-\-info\fR Show information about adapter (returns all properties) .PP \&\fB\-d, \-\-discover\fR Discover remote devices (with remote device name resolving) .PP \&\fB\-\-set \fR Change adapter properties (see \s-1ADAPTER\s0 \s-1PROPERTIES\s0 section for list of available properties) .SH "ADAPTER PROPERTIES" .IX Header "ADAPTER PROPERTIES" string Address [ro] The Bluetooth adapter address (\s-1MAC\s0). .PP string Name [rw] The Bluetooth adapter friendly name. .PP uint32 Class [ro] The Bluetooth class of device. .PP boolean Powered [rw] Switch an adapter on or off. This will also set the appropiate connectable state. .PP boolean Discoverable [rw] Switch an adapter to discoverable or non-discoverable to either make it visible or hide it. .PP .Vb 3 \& If the DiscoverableTimeout is set to a non\-zero \& value then the system will set this value back to \& false after the timer expired. \& \& In case the adapter is switched off, setting this \& value will fail. .Ve .PP boolean Pairable [rw] Switch an adapter to pairable or non-pairable. .PP .Vb 2 \& Note that this property only affects incoming pairing \& requests. .Ve .PP uint32 PaireableTimeout [rw] The pairable timeout in seconds. A value of zero means that the timeout is disabled and it will stay in pareable mode forever. .PP uint32 DiscoverableTimeout [rw] The discoverable timeout in seconds. A value of zero means that the timeout is disabled and it will stay in discoverable/limited mode forever. .PP .Vb 2 \& The default value for the discoverable timeout should \& be 180 seconds (3 minutes). .Ve .PP boolean Discovering [ro] Indicates that a device discovery procedure is active. .PP list UUIDs [ro] List of 128\-bit UUIDs that represents the available local services. .SH "AUTHOR" .IX Header "AUTHOR" Alexander Orlenko . .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIbt\-agent\fR\|(1) \fIbt\-audio\fR\|(1) \fIbt\-device\fR\|(1) \fIbt\-input\fR\|(1) \fIbt\-monitor\fR\|(1) \fIbt\-network\fR\|(1) \fIbt\-serial\fR\|(1) bluez-tools-0.1.38+git662e/src/bt-obex.c0000644000175000017500000004376111463543407020027 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "lib/dbus-common.h" #include "lib/helpers.h" #include "lib/bluez-api.h" #include "lib/obexd-api.h" static GHashTable *server_transfers = NULL; static GMainLoop *mainloop = NULL; static void sigterm_handler(int sig) { g_message("%s received", sig == SIGTERM ? "SIGTERM" : "SIGINT"); if (g_main_loop_is_running(mainloop)) g_main_loop_quit(mainloop); } static void agent_released(OBEXAgent *agent, gpointer data) { g_assert(data != NULL); GMainLoop *mainloop = data; if (g_main_loop_is_running(mainloop)) g_main_loop_quit(mainloop); } /* OBEXTransfer signals */ static void obextransfer_progress(OBEXTransfer *transfer, gint total, gint transfered, gpointer data) { guint pp = (transfered / (gfloat) total)*100; static gboolean update_progress = FALSE; if (!update_progress) { g_print("[OBEXTransfer] Progress: %3u%%", pp); update_progress = TRUE; } else { g_print("\b\b\b\b%3u%%", pp); } if (pp == 100) { g_print("\n"); update_progress = FALSE; } } /* OBEXManager signals */ static void obexmanager_session_created(OBEXManager *manager, const gchar *session_path, gpointer data) { g_print("[OBEXManager] FTP session opened\n"); } static void obexmanager_session_removed(OBEXManager *manager, const gchar *session_path, gpointer data) { g_print("[OBEXManager] FTP session closed\n", session_path); } static void obexmanager_transfer_started(OBEXManager *manager, const gchar *transfer_path, gpointer data) { g_print("[OBEXManager] Transfer started\n", transfer_path); OBEXTransfer *t = g_object_new(OBEXTRANSFER_TYPE, "DBusObjectPath", transfer_path, NULL); g_signal_connect(t, "Progress", G_CALLBACK(obextransfer_progress), NULL); g_hash_table_insert(server_transfers, g_strdup(transfer_path), t); } static void obexmanager_transfer_completed(OBEXManager *manager, const gchar *transfer_path, gboolean success, gpointer data) { OBEXTransfer *t = g_hash_table_lookup(server_transfers, transfer_path); if (t) { g_print("[OBEXManager] Transfer %s\n", success == TRUE ? "succeeded" : "failed"); g_object_unref(t); g_hash_table_remove(server_transfers, transfer_path); } else { // Bug ? } } /* Async callback for SendFiles() */ /*static void send_files_done(gpointer data) { g_assert(data != NULL); GMainLoop *mainloop = data; g_main_loop_quit(mainloop); }*/ /* Main arguments */ static gchar *adapter_arg = NULL; static gboolean server_arg = FALSE; static gchar *server_path_arg = NULL; static gboolean opp_arg = FALSE; static gchar *opp_device_arg = NULL; static gchar *opp_file_arg = NULL; static gchar *ftp_arg = NULL; static GOptionEntry entries[] = { {"adapter", 'a', 0, G_OPTION_ARG_STRING, &adapter_arg, "Adapter name or MAC", ""}, {"server", 's', 0, G_OPTION_ARG_NONE, &server_arg, "Register self at OBEX server", NULL}, {"opp", 'p', 0, G_OPTION_ARG_NONE, &opp_arg, "Send file to remote device", NULL}, {"ftp", 'f', 0, G_OPTION_ARG_STRING, &ftp_arg, "Start FTP session with remote device", ""}, {NULL} }; int main(int argc, char *argv[]) { GError *error = NULL; GOptionContext *context; /* Query current locale */ setlocale(LC_CTYPE, ""); g_type_init(); dbus_init(); context = g_option_context_new(" - a bluetooth OBEX client/server"); g_option_context_add_main_entries(context, entries, NULL); g_option_context_set_summary(context, "Version "PACKAGE_VERSION); g_option_context_set_description(context, "Server Options:\n" " -s, --server []\n" " Register self at OBEX server and use given `path` as OPP save directory\n" " If `path` does not specified - use current directory\n\n" "OPP Options:\n" " -p, --opp \n" " Send `file` to remote device using Object Push Profile\n\n" //"Report bugs to <"PACKAGE_BUGREPORT">." "Project home page <"PACKAGE_URL">." ); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("%s: %s\n", g_get_prgname(), error->message); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } else if (!server_arg && !opp_arg && (!ftp_arg || strlen(ftp_arg) == 0)) { g_print("%s", g_option_context_get_help(context, FALSE, NULL)); exit(EXIT_FAILURE); } else if (server_arg && argc != 1 && (argc != 2 || strlen(argv[1]) == 0)) { g_print("%s: Invalid arguments for --server\n", g_get_prgname()); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } else if (opp_arg && (argc != 3 || strlen(argv[1]) == 0 || strlen(argv[2]) == 0)) { g_print("%s: Invalid arguments for --opp\n", g_get_prgname()); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } g_option_context_free(context); if (!dbus_system_connect(&error)) { g_printerr("Couldn't connect to DBus system bus: %s\n", error->message); exit(EXIT_FAILURE); } if (!dbus_session_connect(&error)) { g_printerr("Couldn't connect to DBus session bus: %s\n", error->message); exit(EXIT_FAILURE); } /* Check, that bluetooth daemon is running */ if (!intf_supported(BLUEZ_DBUS_NAME, MANAGER_DBUS_PATH, MANAGER_DBUS_INTERFACE)) { g_printerr("%s: bluez service is not found\n", g_get_prgname()); g_printerr("Did you forget to run bluetoothd?\n"); exit(EXIT_FAILURE); } /* Check, that obexd daemon is running */ if (!intf_supported(OBEXS_DBUS_NAME, OBEXMANAGER_DBUS_PATH, OBEXMANAGER_DBUS_INTERFACE)) { g_printerr("%s: obex service is not found\n", g_get_prgname()); g_printerr("Did you forget to run obexd?\n"); exit(EXIT_FAILURE); } if (server_arg) { if (argc == 2) { server_path_arg = argv[1]; } /* Check that `path` is valid */ gchar *root_folder = server_path_arg == NULL ? g_get_current_dir() : g_strdup(server_path_arg); if (!is_dir(root_folder, &error)) { exit_if_error(error); } server_transfers = g_hash_table_new(g_str_hash, g_str_equal); OBEXManager *manager = g_object_new(OBEXMANAGER_TYPE, NULL); g_signal_connect(manager, "SessionCreated", G_CALLBACK(obexmanager_session_created), NULL); g_signal_connect(manager, "SessionRemoved", G_CALLBACK(obexmanager_session_removed), NULL); g_signal_connect(manager, "TransferStarted", G_CALLBACK(obexmanager_transfer_started), NULL); g_signal_connect(manager, "TransferCompleted", G_CALLBACK(obexmanager_transfer_completed), NULL); OBEXAgent *agent = g_object_new(OBEXAGENT_TYPE, "RootFolder", root_folder, NULL); g_free(root_folder); obexmanager_register_agent(manager, OBEXAGENT_DBUS_PATH, &error); exit_if_error(error); mainloop = g_main_loop_new(NULL, FALSE); /* Add SIGTERM && SIGINT handlers */ struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = sigterm_handler; sigaction(SIGTERM, &sa, NULL); sigaction(SIGINT, &sa, NULL); g_main_loop_run(mainloop); /* Waiting for connections... */ g_main_loop_unref(mainloop); /* Stop active transfers */ GHashTableIter iter; gpointer key, value; g_hash_table_iter_init(&iter, server_transfers); while (g_hash_table_iter_next(&iter, &key, &value)) { OBEXTransfer *t = OBEXTRANSFER(value); obextransfer_cancel(t, NULL); // skip errors g_object_unref(t); g_hash_table_iter_remove(&iter); } g_hash_table_unref(server_transfers); obexmanager_unregister_agent(manager, OBEXAGENT_DBUS_PATH, &error); g_object_unref(agent); g_object_unref(manager); } else if (opp_arg) { opp_device_arg = argv[1]; opp_file_arg = argv[2]; /* Check that `file` is valid */ if (!is_file(opp_file_arg, &error)) { exit_if_error(error); } gchar * files_to_send[] = {NULL, NULL}; files_to_send[0] = g_path_is_absolute(opp_file_arg) ? g_strdup(opp_file_arg) : get_absolute_path(opp_file_arg); /* Get source address (address of adapter) */ Adapter *adapter = find_adapter(adapter_arg, &error); exit_if_error(error); gchar *src_address = g_strdup(adapter_get_address(adapter)); /* Get destination address (address of remote device) */ gchar *dst_address = NULL; if (g_regex_match_simple("^\\x{2}:\\x{2}:\\x{2}:\\x{2}:\\x{2}:\\x{2}$", opp_device_arg, 0, 0)) { dst_address = g_strdup(opp_device_arg); } else { Device *device = find_device(adapter, opp_device_arg, &error); exit_if_error(error); dst_address = g_strdup(device_get_address(device)); g_object_unref(device); } g_object_unref(adapter); /* Build arguments */ GHashTable *device_dict = g_hash_table_new(g_str_hash, g_str_equal); GValue src_v = {0}; GValue dst_v = {0}; g_value_init(&src_v, G_TYPE_STRING); g_value_init(&dst_v, G_TYPE_STRING); g_value_set_string(&src_v, src_address); g_value_set_string(&dst_v, dst_address); g_hash_table_insert(device_dict, "Source", &src_v); g_hash_table_insert(device_dict, "Destination", &dst_v); mainloop = g_main_loop_new(NULL, FALSE); OBEXClient *client = g_object_new(OBEXCLIENT_TYPE, NULL); OBEXAgent *agent = g_object_new(OBEXAGENT_TYPE, NULL); g_signal_connect(agent, "AgentReleased", G_CALLBACK(agent_released), mainloop); /* Sending file(s) */ obexclient_send_files(client, device_dict, files_to_send, OBEXAGENT_DBUS_PATH, &error); exit_if_error(error); /* Add SIGTERM && SIGINT handlers */ struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = sigterm_handler; sigaction(SIGTERM, &sa, NULL); sigaction(SIGINT, &sa, NULL); g_main_loop_run(mainloop); /* Sending files process here ?? */ g_main_loop_unref(mainloop); g_object_unref(agent); g_object_unref(client); g_value_unset(&src_v); g_value_unset(&dst_v); g_hash_table_unref(device_dict); g_free(src_address); g_free(dst_address); g_free(files_to_send[0]); files_to_send[0] = NULL; } else if (ftp_arg) { /* Get source address (address of adapter) */ Adapter *adapter = find_adapter(adapter_arg, &error); exit_if_error(error); gchar *src_address = g_strdup(adapter_get_address(adapter)); /* Get destination address (address of remote device) */ Device *device = find_device(adapter, ftp_arg, &error); exit_if_error(error); gchar *dst_address = g_strdup(device == NULL ? ftp_arg : device_get_address(device)); g_object_unref(device); g_object_unref(adapter); /* Build arguments */ GHashTable *device_dict = g_hash_table_new(g_str_hash, g_str_equal); GValue src_v = {0}; GValue dst_v = {0}; GValue target_v = {0}; g_value_init(&src_v, G_TYPE_STRING); g_value_init(&dst_v, G_TYPE_STRING); g_value_init(&target_v, G_TYPE_STRING); g_value_set_string(&src_v, src_address); g_value_set_string(&dst_v, dst_address); g_value_set_string(&target_v, "FTP"); g_hash_table_insert(device_dict, "Source", &src_v); g_hash_table_insert(device_dict, "Destination", &dst_v); g_hash_table_insert(device_dict, "Target", &target_v); OBEXClient *client = g_object_new(OBEXCLIENT_TYPE, NULL); OBEXAgent *agent = g_object_new(OBEXAGENT_TYPE, NULL); /* Create FTP session */ gchar *session_path = obexclient_create_session(client, device_dict, &error); exit_if_error(error); OBEXClientFileTransfer *ftp_session = g_object_new(OBEXCLIENT_FILE_TRANSFER_TYPE, "DBusObjectPath", session_path, NULL); g_free(session_path); g_print("FTP session opened\n"); while (TRUE) { gchar *cmd = readline("> "); if (cmd == NULL) { continue; } else { add_history(cmd); } gint f_argc; gchar **f_argv; /* Parsing command line */ if (!g_shell_parse_argv(cmd, &f_argc, &f_argv, &error)) { g_print("%s\n", error->message); g_error_free(error); error = NULL; g_free(cmd); continue; } /* Execute commands */ if (g_strcmp0(f_argv[0], "cd") == 0) { if (f_argc != 2 || strlen(f_argv[1]) == 0) { g_print("invalid arguments\n"); } else { obexclient_file_transfer_change_folder(ftp_session, f_argv[1], &error); if (error) { g_print("%s\n", error->message); g_error_free(error); error = NULL; } } } else if (g_strcmp0(f_argv[0], "mkdir") == 0) { if (f_argc != 2 || strlen(f_argv[1]) == 0) { g_print("invalid arguments\n"); } else { obexclient_file_transfer_create_folder(ftp_session, f_argv[1], &error); if (error) { g_print("%s\n", error->message); g_error_free(error); error = NULL; } } } else if (g_strcmp0(f_argv[0], "ls") == 0) { if (f_argc != 1) { g_print("invalid arguments\n"); } else { GPtrArray *folders = obexclient_file_transfer_list_folder(ftp_session, &error); if (error) { g_print("%s\n", error->message); g_error_free(error); error = NULL; } else { for (int i = 0; i < folders->len; i++) { GHashTable *el = g_ptr_array_index(folders, i); g_print( "%s\t%llu\t%s\n", g_value_get_string(g_hash_table_lookup(el, "Type")), G_VALUE_HOLDS_UINT64(g_hash_table_lookup(el, "Size")) ? g_value_get_uint64(g_hash_table_lookup(el, "Size")) : 0, g_value_get_string(g_hash_table_lookup(el, "Name")) ); } } if (folders) g_ptr_array_unref(folders); /*obexclient_remove_session(client, obexclient_file_transfer_get_dbus_object_path(ftp_session), &error); exit_if_error(error); g_object_unref(ftp_session); session_path = obexclient_create_session(client, device_dict, &error); exit_if_error(error); ftp_session = g_object_new(OBEXCLIENT_FILE_TRANSFER_TYPE, "DBusObjectPath", session_path, NULL); g_free(session_path);*/ } } else if (g_strcmp0(f_argv[0], "get") == 0) { if (f_argc != 3 || strlen(f_argv[1]) == 0 || strlen(f_argv[2]) == 0) { g_print("invalid arguments\n"); } else { gchar *abs_dst_path = get_absolute_path(f_argv[2]); gchar *dir = g_path_get_dirname(abs_dst_path); if (!is_dir(dir, &error)) { g_print("%s\n", error->message); g_error_free(error); error = NULL; } else { obexclient_file_transfer_get_file(ftp_session, abs_dst_path, f_argv[1], &error); if (error) { g_print("%s\n", error->message); g_error_free(error); error = NULL; } } g_free(dir); g_free(abs_dst_path); } } else if (g_strcmp0(f_argv[0], "put") == 0) { if (f_argc != 3 || strlen(f_argv[1]) == 0 || strlen(f_argv[2]) == 0) { g_print("invalid arguments\n"); } else { gchar *abs_src_path = get_absolute_path(f_argv[1]); if (!is_file(abs_src_path, &error)) { g_print("%s\n", error->message); g_error_free(error); error = NULL; } else { obexclient_file_transfer_put_file(ftp_session, abs_src_path, f_argv[2], &error); if (error) { g_print("%s\n", error->message); g_error_free(error); error = NULL; } } g_free(abs_src_path); } } else if (g_strcmp0(f_argv[0], "cp") == 0) { if (f_argc != 3 || strlen(f_argv[1]) == 0 || strlen(f_argv[2]) == 0) { g_print("invalid arguments\n"); } else { obexclient_file_transfer_copy_file(ftp_session, f_argv[1], f_argv[2], &error); if (error) { g_print("%s\n", error->message); g_error_free(error); error = NULL; } } } else if (g_strcmp0(f_argv[0], "mv") == 0) { if (f_argc != 3 || strlen(f_argv[1]) == 0 || strlen(f_argv[2]) == 0) { g_print("invalid arguments\n"); } else { obexclient_file_transfer_move_file(ftp_session, f_argv[1], f_argv[2], &error); if (error) { g_print("%s\n", error->message); g_error_free(error); error = NULL; } } } else if (g_strcmp0(f_argv[0], "rm") == 0) { if (f_argc != 2 || strlen(f_argv[1]) == 0) { g_print("invalid arguments\n"); } else { obexclient_file_transfer_delete(ftp_session, f_argv[1], &error); if (error) { g_print("%s\n", error->message); g_error_free(error); error = NULL; } } } else if (g_strcmp0(f_argv[0], "help") == 0) { g_print( "help\t\t\tShow this message\n" "exit\t\t\tClose FTP session\n" "cd \t\tChange the current folder of the remote device\n" "mkdir \t\tCreate a new folder in the remote device\n" "ls\t\t\tList folder contents\n" "get \t\tCopy the src file (from remote device) to the dst file (on local filesystem)\n" "put \t\tCopy the src file (from local filesystem) to the dst file (on remote device)\n" "cp \t\tCopy a file within the remote device from src file to dst file\n" "mv \t\tMove a file within the remote device from src file to dst file\n" "rm \t\tDeletes the specified file/folder\n" ); } else if (g_strcmp0(f_argv[0], "exit") == 0 || g_strcmp0(f_argv[0], "quit") == 0) { obexclient_remove_session(client, obexclient_file_transfer_get_dbus_object_path(ftp_session), &error); exit_if_error(error); g_strfreev(f_argv); g_free(cmd); break; } else { g_print("invalid command\n"); } g_strfreev(f_argv); g_free(cmd); } g_object_unref(agent); g_object_unref(client); g_object_unref(ftp_session); g_value_unset(&src_v); g_value_unset(&dst_v); g_value_unset(&target_v); g_hash_table_unref(device_dict); g_free(src_address); g_free(dst_address); } dbus_disconnect(); exit(EXIT_SUCCESS); } bluez-tools-0.1.38+git662e/src/bt-input.10000644000175000017500000001127711472236011020132 0ustar iwamatsuiwamatsu.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "bt-input 1" .TH bt-input 1 "2010-08-11" "" "bluez-tools" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" bt\-input \- a bluetooth input manager .SH "SYNOPSIS" .IX Header "SYNOPSIS" bt-input [\s-1OPTION\s0...] .PP Help Options: \-h, \-\-help .PP Application Options: \-a, \-\-adapter= \-c, \-\-connect= \-d, \-\-disconnect= .SH "DESCRIPTION" .IX Header "DESCRIPTION" This utility is used to manage outgoing input (\s-1HID\s0) service connections. .SH "OPTIONS" .IX Header "OPTIONS" \&\fB\-h, \-\-help\fR Show help .PP \&\fB\-a, \-\-adapter \fR Specify adapter to use by his Name or \s-1MAC\s0 address (if this option does not defined \- default adapter used) .PP \&\fB\-c, \-\-connect \fR Connect to the input device .PP \&\fB\-d, \-\-disconnect \fR Disconnect from the input device .SH "AUTHOR" .IX Header "AUTHOR" Alexander Orlenko . .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIbt\-adapter\fR\|(1) \fIbt\-agent\fR\|(1) \fIbt\-audio\fR\|(1) \fIbt\-device\fR\|(1) \fIbt\-monitor\fR\|(1) \fIbt\-network\fR\|(1) \fIbt\-serial\fR\|(1) bluez-tools-0.1.38+git662e/src/bt-monitor.c0000644000175000017500000004240111463543011020536 0ustar iwamatsuiwamatsu/* * * bluez-tools - a set of tools to manage bluetooth devices for linux * * Copyright (C) 2010 Alexander Orlenko * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "lib/dbus-common.h" #include "lib/helpers.h" #include "lib/bluez-api.h" static gchar *adapter_arg = NULL; // adapter_path => GPtrArray{adapter_object, device1_object, device2_object, ...} static GHashTable *captured_adapters_devices_t = NULL; // device_path => GPtrArray{device_object, service1_object, service2_object, ...} static GHashTable *captured_devices_services_t = NULL; static void capture_adapter(Adapter *adapter); static void release_adapter(Adapter *adapter); static void capture_device(Device *device); static void release_device(Device *device); static void reload_device_services(Device *device); /* * Manager signals */ static void manager_adapter_added(Manager *manager, const gchar *adapter_path, gpointer data) { //g_print("manager_adapter_added()\n"); if (adapter_arg == NULL) { Adapter *adapter = g_object_new(ADAPTER_TYPE, "DBusObjectPath", adapter_path, NULL); g_print("[Manager] Adapter added: %s (%s)\n", adapter_get_name(adapter), adapter_get_address(adapter)); capture_adapter(adapter); } } static void manager_adapter_removed(Manager *manager, const gchar *adapter_path, gpointer data) { //g_print("manager_adapter_removed()\n"); GSList *t = g_hash_table_lookup(captured_adapters_devices_t, adapter_path); if (t != NULL) { Adapter *adapter = ADAPTER(g_slist_nth_data(t, 0)); g_print("[Manager] Adapter removed: %s (%s)\n", adapter_get_name(adapter), adapter_get_address(adapter)); release_adapter(adapter); } // Exit if removed user-captured adapter if (adapter_arg != NULL && g_hash_table_size(captured_adapters_devices_t) == 0) { exit(EXIT_SUCCESS); } } static void manager_default_adapter_changed(Manager *manager, const gchar *adapter_path, gpointer data) { //g_print("manager_default_adapter_changed()\n"); if (adapter_arg == NULL) { Adapter *adapter = g_object_new(ADAPTER_TYPE, "DBusObjectPath", adapter_path, NULL); g_print("[Manager] Default adapter changed: %s (%s)\n", adapter_get_name(adapter), adapter_get_address(adapter)); g_object_unref(adapter); } } static void manager_property_changed(Manager *manager, const gchar *name, const GValue *value, gpointer data) { //g_print("manager_property_changed()\n"); if (adapter_arg == NULL) { // Only one property: Adapters g_print("[Manager] Property changed: %s\n", name); } } /* * Adapter signals */ static void adapter_device_created(Adapter *adapter, const gchar *device_path, gpointer data) { //g_print("adapter_device_created()\n"); if (intf_supported(BLUEZ_DBUS_NAME, device_path, DEVICE_DBUS_INTERFACE)) { Device *device = g_object_new(DEVICE_TYPE, "DBusObjectPath", device_path, NULL); g_print("[Adapter: %s (%s)] Device created: %s (%s)\n", adapter_get_name(adapter), adapter_get_address(adapter), device_get_alias(device), device_get_address(device)); capture_device(device); } else { g_print("[Adapter: %s (%s)]* Device created: %s\n", adapter_get_name(adapter), adapter_get_address(adapter), device_path); } } static void adapter_device_disappeared(Adapter *adapter, const gchar *address, gpointer data) { //g_print("adapter_device_disappeared()\n"); g_print("[Adapter: %s (%s)] Device disappeared: %s\n", adapter_get_name(adapter), adapter_get_address(adapter), address); } static void adapter_device_found(Adapter *adapter, const gchar *address, GHashTable *values, gpointer data) { //g_print("adapter_device_found()\n"); g_print("[Adapter: %s (%s)] Device found:\n", adapter_get_name(adapter), adapter_get_address(adapter)); g_print("[%s]\n", address); g_print(" Name: %s\n", g_value_get_string(g_hash_table_lookup(values, "Name"))); g_print(" Alias: %s\n", g_value_get_string(g_hash_table_lookup(values, "Alias"))); g_print(" Address: %s\n", g_value_get_string(g_hash_table_lookup(values, "Address"))); g_print(" Icon: %s\n", g_value_get_string(g_hash_table_lookup(values, "Icon"))); g_print(" Class: 0x%x\n", g_value_get_uint(g_hash_table_lookup(values, "Class"))); g_print(" LegacyPairing: %d\n", g_value_get_boolean(g_hash_table_lookup(values, "LegacyPairing"))); g_print(" Paired: %d\n", g_value_get_boolean(g_hash_table_lookup(values, "Paired"))); g_print(" RSSI: %d\n", g_value_get_int(g_hash_table_lookup(values, "RSSI"))); g_print("\n"); } static void adapter_device_removed(Adapter *adapter, const gchar *device_path, gpointer data) { //g_print("adapter_device_removed()\n"); GSList *t2 = g_hash_table_lookup(captured_devices_services_t, device_path); if (t2 != NULL) { Device *device = DEVICE(g_slist_nth_data(t2, 0)); g_print("[Adapter: %s (%s)] Device removed: %s (%s)\n", adapter_get_name(adapter), adapter_get_address(adapter), device_get_alias(device), device_get_address(device)); release_device(device); } else { g_print("[Adapter: %s (%s)]* Device removed: %s\n", adapter_get_name(adapter), adapter_get_address(adapter), device_path); } } static void adapter_property_changed(Adapter *adapter, const gchar *name, const GValue *value, gpointer data) { //g_print("adapter_property_changed()\n"); g_print("[Adapter: %s (%s)] Property changed: %s", adapter_get_name(adapter), adapter_get_address(adapter), name); if (G_VALUE_HOLDS_BOOLEAN(value)) { g_print(" -> %d\n", g_value_get_boolean(value)); } else if (G_VALUE_HOLDS_INT(value)) { g_print(" -> %d\n", g_value_get_int(value)); } else if (G_VALUE_HOLDS_UINT(value)) { g_print(" -> %d\n", g_value_get_uint(value)); } else if (G_VALUE_HOLDS_STRING(value)) { g_print(" -> %s\n", g_value_get_string(value)); } else { g_print("\n"); } } /* * Device signals */ static void device_disconnect_requested(Device *device, gpointer data) { //g_print("device_disconnect_requested()\n"); g_print("[Device: %s (%s)] Disconnect requested\n", device_get_alias(device), device_get_address(device)); } static void device_property_changed(Device *device, const gchar *name, const GValue *value, gpointer data) { //g_print("device_property_changed()\n"); g_print("[Device: %s (%s)] Property changed: %s", device_get_alias(device), device_get_address(device), name); if (G_VALUE_HOLDS_BOOLEAN(value)) { g_print(" -> %d\n", g_value_get_boolean(value)); } else if (G_VALUE_HOLDS_INT(value)) { g_print(" -> %d\n", g_value_get_int(value)); } else if (G_VALUE_HOLDS_UINT(value)) { g_print(" -> %d\n", g_value_get_uint(value)); } else if (G_VALUE_HOLDS_STRING(value)) { g_print(" -> %s\n", g_value_get_string(value)); } else { g_print("\n"); } if (g_strcmp0(name, "UUIDs") == 0) { reload_device_services(device); } } /* * Services signals */ static void audio_property_changed(Audio *audio, const gchar *name, const GValue *value, gpointer data) { //g_print("audio_property_changed()\n"); Device *device = DEVICE(data); g_print("[Device: %s (%s)] Audio property changed: %s", device_get_alias(device), device_get_address(device), name); if (G_VALUE_HOLDS_BOOLEAN(value)) { g_print(" -> %d\n", g_value_get_boolean(value)); } else if (G_VALUE_HOLDS_INT(value)) { g_print(" -> %d\n", g_value_get_int(value)); } else if (G_VALUE_HOLDS_UINT(value)) { g_print(" -> %d\n", g_value_get_uint(value)); } else if (G_VALUE_HOLDS_STRING(value)) { g_print(" -> %s\n", g_value_get_string(value)); } else { g_print("\n"); } } static void input_property_changed(Input *input, const gchar *name, const GValue *value, gpointer data) { //g_print("input_property_changed()\n"); Device *device = DEVICE(data); g_print("[Device: %s (%s)] Input property changed: %s", device_get_alias(device), device_get_address(device), name); if (G_VALUE_HOLDS_BOOLEAN(value)) { g_print(" -> %d\n", g_value_get_boolean(value)); } else if (G_VALUE_HOLDS_INT(value)) { g_print(" -> %d\n", g_value_get_int(value)); } else if (G_VALUE_HOLDS_UINT(value)) { g_print(" -> %d\n", g_value_get_uint(value)); } else if (G_VALUE_HOLDS_STRING(value)) { g_print(" -> %s\n", g_value_get_string(value)); } else { g_print("\n"); } } static void network_property_changed(Network *network, const gchar *name, const GValue *value, gpointer data) { //g_print("network_property_changed()\n"); Device *device = DEVICE(data); g_print("[Device: %s (%s)] Network property changed: %s", device_get_alias(device), device_get_address(device), name); if (G_VALUE_HOLDS_BOOLEAN(value)) { g_print(" -> %d\n", g_value_get_boolean(value)); } else if (G_VALUE_HOLDS_INT(value)) { g_print(" -> %d\n", g_value_get_int(value)); } else if (G_VALUE_HOLDS_UINT(value)) { g_print(" -> %d\n", g_value_get_uint(value)); } else if (G_VALUE_HOLDS_STRING(value)) { g_print(" -> %s\n", g_value_get_string(value)); } else { g_print("\n"); } } /* * Capturing methods */ static void capture_adapter(Adapter *adapter) { //g_print("capture_adapter()\n"); g_assert(ADAPTER_IS(adapter)); GSList *t = g_slist_append(NULL, adapter); g_hash_table_insert(captured_adapters_devices_t, g_strdup(adapter_get_dbus_object_path(adapter)), t); g_signal_connect(adapter, "DeviceCreated", G_CALLBACK(adapter_device_created), NULL); g_signal_connect(adapter, "DeviceDisappeared", G_CALLBACK(adapter_device_disappeared), NULL); g_signal_connect(adapter, "DeviceFound", G_CALLBACK(adapter_device_found), NULL); g_signal_connect(adapter, "DeviceRemoved", G_CALLBACK(adapter_device_removed), NULL); g_signal_connect(adapter, "PropertyChanged", G_CALLBACK(adapter_property_changed), NULL); // Capturing signals from devices const GPtrArray *devices_list = adapter_get_devices(adapter); g_assert(devices_list != NULL); for (int i = 0; i < devices_list->len; i++) { const gchar *device_path = g_ptr_array_index(devices_list, i); Device *device = g_object_new(DEVICE_TYPE, "DBusObjectPath", device_path, NULL); capture_device(device); } } static void release_adapter(Adapter *adapter) { //g_print("release_adapter()\n"); g_assert(ADAPTER_IS(adapter)); GSList *t = g_hash_table_lookup(captured_adapters_devices_t, adapter_get_dbus_object_path(adapter)); while (g_slist_length(t) > 1) { Device *device = DEVICE(g_slist_nth_data(t, 1)); release_device(device); t = g_hash_table_lookup(captured_adapters_devices_t, adapter_get_dbus_object_path(adapter)); } g_slist_free(t); g_hash_table_remove(captured_adapters_devices_t, adapter_get_dbus_object_path(adapter)); g_object_unref(adapter); } static void capture_device(Device *device) { //g_print("capture_device()\n"); g_assert(DEVICE_IS(device)); GSList *t = g_hash_table_lookup(captured_adapters_devices_t, device_get_adapter(device)); if (t == NULL) { Adapter *adapter = g_object_new(ADAPTER_TYPE, "DBusObjectPath", device_get_adapter(device), NULL); g_printerr("[Device: %s (%s)] Uncaptured adapter: %s (%s)\n", device_get_alias(device), device_get_address(device), adapter_get_name(adapter), adapter_get_address(adapter)); g_object_unref(adapter); return; } t = g_slist_append(t, device); GSList *t2 = g_hash_table_lookup(captured_devices_services_t, device_get_dbus_object_path(device)); if (t2 != NULL) { g_printerr("[Device: %s (%s)] Already captured device\n", device_get_alias(device), device_get_address(device)); return; } t2 = g_slist_append(t2, device); g_signal_connect(device, "DisconnectRequested", G_CALLBACK(device_disconnect_requested), NULL); g_signal_connect(device, "PropertyChanged", G_CALLBACK(device_property_changed), NULL); g_hash_table_insert(captured_adapters_devices_t, g_strdup(device_get_adapter(device)), t); g_hash_table_insert(captured_devices_services_t, g_strdup(device_get_dbus_object_path(device)), t2); reload_device_services(device); } static void release_device(Device *device) { //g_print("release_device()\n"); g_assert(DEVICE_IS(device)); GSList *t = g_hash_table_lookup(captured_adapters_devices_t, device_get_adapter(device)); if (t != NULL) { t = g_slist_remove(t, device); g_hash_table_insert(captured_adapters_devices_t, g_strdup(device_get_adapter(device)), t); } GSList *t2 = g_hash_table_lookup(captured_devices_services_t, device_get_dbus_object_path(device)); while (g_slist_length(t2) > 1) { GObject *service = g_slist_nth_data(t2, 1); t2 = g_slist_remove(t2, service); g_object_unref(service); } g_slist_free(t2); g_hash_table_remove(captured_devices_services_t, device_get_dbus_object_path(device)); g_object_unref(device); } static void reload_device_services(Device *device) { //g_print("reload_device_services()\n"); GSList *t2 = g_hash_table_lookup(captured_devices_services_t, device_get_dbus_object_path(device)); if (t2 == NULL) { g_printerr("[Device: %s (%s)] Uncaptured device\n", device_get_alias(device), device_get_address(device)); return; } while (g_slist_length(t2) > 1) { GObject *service = g_slist_nth_data(t2, 1); t2 = g_slist_remove(t2, service); g_object_unref(service); } // Capturing signals from available services if (intf_supported(BLUEZ_DBUS_NAME, device_get_dbus_object_path(device), AUDIO_DBUS_INTERFACE)) { Audio *audio = g_object_new(AUDIO_TYPE, "DBusObjectPath", device_get_dbus_object_path(device), NULL); g_signal_connect(audio, "PropertyChanged", G_CALLBACK(audio_property_changed), device); t2 = g_slist_append(t2, audio); } if (intf_supported(BLUEZ_DBUS_NAME, device_get_dbus_object_path(device), INPUT_DBUS_INTERFACE)) { Input *input = g_object_new(INPUT_TYPE, "DBusObjectPath", device_get_dbus_object_path(device), NULL); g_signal_connect(input, "PropertyChanged", G_CALLBACK(input_property_changed), device); t2 = g_slist_append(t2, input); } if (intf_supported(BLUEZ_DBUS_NAME, device_get_dbus_object_path(device), NETWORK_DBUS_INTERFACE)) { Network *network = g_object_new(NETWORK_TYPE, "DBusObjectPath", device_get_dbus_object_path(device), NULL); g_signal_connect(network, "PropertyChanged", G_CALLBACK(network_property_changed), device); t2 = g_slist_append(t2, network); } g_hash_table_insert(captured_devices_services_t, g_strdup(device_get_dbus_object_path(device)), t2); } static GOptionEntry entries[] = { {"adapter", 'a', 0, G_OPTION_ARG_STRING, &adapter_arg, "Adapter Name or MAC", ""}, {NULL} }; int main(int argc, char *argv[]) { GError *error = NULL; GOptionContext *context; /* Query current locale */ setlocale(LC_CTYPE, ""); g_type_init(); dbus_init(); context = g_option_context_new("- a bluetooth monitor"); g_option_context_add_main_entries(context, entries, NULL); g_option_context_set_summary(context, "Version "PACKAGE_VERSION); g_option_context_set_description(context, //"Report bugs to <"PACKAGE_BUGREPORT">." "Project home page <"PACKAGE_URL">." ); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("%s: %s\n", g_get_prgname(), error->message); g_print("Try `%s --help` for more information.\n", g_get_prgname()); exit(EXIT_FAILURE); } g_option_context_free(context); if (!dbus_system_connect(&error)) { g_printerr("Couldn't connect to DBus system bus: %s\n", error->message); exit(EXIT_FAILURE); } /* Check, that bluetooth daemon is running */ if (!intf_supported(BLUEZ_DBUS_NAME, MANAGER_DBUS_PATH, MANAGER_DBUS_INTERFACE)) { g_printerr("%s: bluez service is not found\n", g_get_prgname()); g_printerr("Did you forget to run bluetoothd?\n"); exit(EXIT_FAILURE); } captured_adapters_devices_t = g_hash_table_new(g_str_hash, g_str_equal); captured_devices_services_t = g_hash_table_new(g_str_hash, g_str_equal); Manager *manager = g_object_new(MANAGER_TYPE, NULL); if (adapter_arg != NULL) { Adapter *adapter = find_adapter(adapter_arg, &error); exit_if_error(error); capture_adapter(adapter); } else { const GPtrArray *adapters_list = manager_get_adapters(manager); g_assert(adapters_list != NULL); if (adapters_list->len == 0) { g_print("No adapters found\n"); exit(EXIT_FAILURE); } for (int i = 0; i < adapters_list->len; i++) { const gchar *adapter_path = g_ptr_array_index(adapters_list, i); Adapter *adapter = g_object_new(ADAPTER_TYPE, "DBusObjectPath", adapter_path, NULL); capture_adapter(adapter); } } g_signal_connect(manager, "AdapterAdded", G_CALLBACK(manager_adapter_added), NULL); g_signal_connect(manager, "AdapterRemoved", G_CALLBACK(manager_adapter_removed), NULL); g_signal_connect(manager, "DefaultAdapterChanged", G_CALLBACK(manager_default_adapter_changed), NULL); g_signal_connect(manager, "PropertyChanged", G_CALLBACK(manager_property_changed), NULL); g_print("Monitor registered\n"); GMainLoop *mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); // TODO: Add SIGINT handler (Ctrl+C) g_main_loop_unref(mainloop); g_object_unref(manager); dbus_disconnect(); exit(EXIT_SUCCESS); }